diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-27 14:35:18 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2013-08-27 13:49:59 +0000 |
commit | ef0a7a309d03c83f59a32595132f3f3e4c9893c0 (patch) | |
tree | e9c239cd3651f1fca0e0634da3f61a5cc6cdd834 /sfx2 | |
parent | df2c34045d753fc80484f7d7f128ec5e8b52ffc7 (diff) |
Resolves: fdo#67743 ensure user autocorr config dir exists
We try and copy the shared one to the user location the first time we create a
customized user file. If the dir doesn't exist then that migration doesn't
happen. The new autocorr file is then written, creating the dir, and any
further operations will reattempt the skipped share copy, and this time succeed
because the dir now exists. Which overwrites the previously written customized
content.
This is similar to fdo#65501 "ensure configured backup dir exists before using
it", so reuse that code and move it into unotools.
Change-Id: I38fa621b8d7295d70b09172a028569ea95404120
(cherry picked from commit 68dea1c1b61a99cdef556ba7d8ccfdad1be8a663)
Reviewed-on: https://gerrit.libreoffice.org/5645
Reviewed-by: Thorsten Behrens <tbehrens@suse.com>
Tested-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 25b7f27ec1dc..c1ad6037aa87 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2126,25 +2126,6 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont aTransactTemp.EnableKillingFile( true ); } -bool ensureFolder( - uno::Reference< uno::XComponentContext > xCtx, - uno::Reference< ucb::XCommandEnvironment > xEnv, - const OUString& rFolder, ucbhelper::Content & result) -{ - INetURLObject aURL( rFolder ); - OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); - aURL.removeSegment(); - ::ucbhelper::Content aParent; - - if ( ::ucbhelper::Content::create( aURL.GetMainURL( INetURLObject::NO_DECODE ), - xEnv, xCtx, aParent ) ) - { - return ::utl::UCBContentHelper::MakeFolder(aParent, aTitle, result); - } - - return false; -} - //------------------------------------------------------------------ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent ) { @@ -2163,7 +2144,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont // create content for the parent folder ( = backup folder ) ::ucbhelper::Content aContent; Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv; - if( ensureFolder(comphelper::getProcessComponentContext(), xEnv, aBakDir, aContent) ) + if( ::utl::UCBContentHelper::ensureFolder(comphelper::getProcessComponentContext(), xEnv, aBakDir, aContent) ) DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aBakDir ); if ( pImp->m_aBackupURL.isEmpty() ) @@ -2203,7 +2184,7 @@ void SfxMedium::DoBackup_Impl() // create content for the parent folder ( = backup folder ) ::ucbhelper::Content aContent; Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv; - if( ensureFolder(comphelper::getProcessComponentContext(), xEnv, aBakDir, aContent) ) + if( ::utl::UCBContentHelper::ensureFolder(comphelper::getProcessComponentContext(), xEnv, aBakDir, aContent) ) { // save as ".bak" file INetURLObject aDest( aBakDir ); |