summaryrefslogtreecommitdiffstats
path: root/include/unotools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-27 14:35:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-27 14:42:24 +0100
commit68dea1c1b61a99cdef556ba7d8ccfdad1be8a663 (patch)
tree8a342345b1bb1d948b95fbd1b98d80b9fef44234 /include/unotools
parentSimplify a bit iterator + remove double check (diff)
downloadcore-68dea1c1b61a99cdef556ba7d8ccfdad1be8a663.tar.gz
core-68dea1c1b61a99cdef556ba7d8ccfdad1be8a663.zip
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
Diffstat (limited to 'include/unotools')
-rw-r--r--include/unotools/ucbhelper.hxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/unotools/ucbhelper.hxx b/include/unotools/ucbhelper.hxx
index fad06ced5e2d..fe29a3a54201 100644
--- a/include/unotools/ucbhelper.hxx
+++ b/include/unotools/ucbhelper.hxx
@@ -26,9 +26,15 @@
#include "sal/types.h"
#include "unotools/unotoolsdllapi.h"
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
-} } } }
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class Any;
+ class XComponentContext;
+ }
+ namespace ucb{
+ class XCommandEnvironment;
+ }
+} } }
namespace ucbhelper { class Content; }
namespace utl { namespace UCBContentHelper {
@@ -53,6 +59,12 @@ UNOTOOLS_DLLPUBLIC bool MakeFolder(
ucbhelper::Content & parent, OUString const & title,
ucbhelper::Content & result, bool exclusive = false);
+/// like mkdir -p
+UNOTOOLS_DLLPUBLIC bool ensureFolder(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xCtx,
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > xEnv,
+ const OUString& rFolder, ucbhelper::Content & result);
+
/// @return the value of the "Size" property of the given content, or zero if
/// obtaining the property yields a void value or raises a
/// non-RuntimeException (RuntimeExceptions are passed through)