adjust to apply

f41
Caolán McNamara 11 years ago
parent e12435cdc9
commit ed42b79dc6

@ -1,8 +1,8 @@
From bbf82f684060980d267733ee589d263d6b25340c Mon Sep 17 00:00:00 2001
From 6805be76c930312d18e732f4572b6c2611cc8e0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 24 Feb 2014 15:27:36 +0000
Subject: [PATCH] Related: rhbz#1065807 rework #i66157# for multiple writable
template dirs
Subject: [PATCH 2/4] Related: rhbz#1065807 rework #i66157# for multiple
writable template dirs
if there are multiple user-level template dirs then we should be able to
remove/rename content in all of them, not just the default writable target.
@ -22,18 +22,18 @@ Change-Id: I56afe991d4297ba692e914ae95ea02d68553f60a
1 file changed, 66 insertions(+), 14 deletions(-)
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 574232a..47b8fed 100644
index ff07ef3..4cf76c4 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -67,6 +67,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/thePathSettings.hpp>
@@ -54,6 +54,7 @@
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/util/PathSettings.hpp>
#include <rtl/ref.hxx>
#include <svtools/templatefoldercache.hxx>
@@ -187,6 +188,7 @@ class SfxDocTplService_Impl
#include <unotools/configmgr.hxx>
@@ -180,6 +181,7 @@ class SfxDocTplService_Impl
::osl::Mutex maMutex;
Sequence< OUString > maTemplateDirs;
@ -41,7 +41,7 @@ index 574232a..47b8fed 100644
OUString maRootURL;
NameList_Impl maNames;
Locale maLocale;
@@ -271,8 +273,16 @@ class SfxDocTplService_Impl
@@ -264,8 +266,16 @@ class SfxDocTplService_Impl
void updateData( DocTemplates_EntryData_Impl *pData );
@ -59,7 +59,7 @@ index 574232a..47b8fed 100644
~SfxDocTplService_Impl();
sal_Bool init() { if ( !mbIsInitialized ) init_Impl(); return mbIsInitialized; }
@@ -552,7 +562,7 @@ void SfxDocTplService_Impl::getDirList()
@@ -545,7 +555,7 @@ void SfxDocTplService_Impl::getDirList()
// TODO/LATER: let use service, register listener
INetURLObject aURL;
OUString aDirs = SvtPathOptions().GetTemplatePath();
@ -68,7 +68,7 @@ index 574232a..47b8fed 100644
maTemplateDirs = Sequence< OUString >( nCount );
@@ -560,7 +570,7 @@ void SfxDocTplService_Impl::getDirList()
@@ -553,7 +563,7 @@ void SfxDocTplService_Impl::getDirList()
const OUString aPrefix(
"vnd.sun.star.expand:" );
@ -77,12 +77,12 @@ index 574232a..47b8fed 100644
{
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetURL( aDirs.getToken( i, C_DELIM ) );
@@ -578,6 +588,23 @@ void SfxDocTplService_Impl::getDirList()
@@ -571,6 +581,23 @@ void SfxDocTplService_Impl::getDirList()
aValue <<= maTemplateDirs;
+ css::uno::Reference< css::util::XPathSettings > xPathSettings =
+ css::util::thePathSettings::get(mxContext);
+ css::util::PathSettings::create( xContext );
+
+ // load internal paths
+ OUString sProp( "Template_internal" );
@ -101,7 +101,7 @@ index 574232a..47b8fed 100644
// Store the template dir list
setProperty( maRootContent, aPropName, aValue );
}
@@ -1538,13 +1565,16 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
@@ -1547,13 +1574,16 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
if ( !maTemplateDirs.getLength() )
return sal_False;
@ -122,7 +122,7 @@ index 574232a..47b8fed 100644
return sal_False;
// now get the content of the Group
@@ -1652,14 +1682,14 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
@@ -1661,14 +1691,14 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
if ( !maTemplateDirs.getLength() )
return sal_False;
@ -141,7 +141,7 @@ index 574232a..47b8fed 100644
// check that the group can be renamed ( all the contents must be in target location )
sal_Bool bCanBeRenamed = sal_False;
@@ -1761,7 +1791,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
@@ -1770,7 +1800,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aValue >>= aTemplateToRemoveTargetURL;
if ( aGroupTargetURL.isEmpty() || !maTemplateDirs.getLength()
@ -150,9 +150,9 @@ index 574232a..47b8fed 100644
return sal_False; // it is not allowed to remove the template
}
@@ -2050,6 +2080,29 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
return sal_False;
}
@@ -2032,6 +2062,29 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
catch ( Exception& )
{ return sal_False; }
+bool SfxDocTplService_Impl::isInternalTemplateDir(const OUString& rURL) const
+{
@ -178,9 +178,9 @@ index 574232a..47b8fed 100644
+ return OUString();
+}
sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
const OUString& rTemplateName )
@@ -2091,8 +2144,7 @@ sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
// either the document has title and it is the same as requested, or we have to set it
sal_Bool bCorrectTitle = ( bDocHasTitle && aTitle.equals( rTemplateName ) );
@@ -2101,8 +2154,7 @@ sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
// delete the target template
if ( !aTargetURL.isEmpty() )
{

@ -1,25 +1,25 @@
From 838b77f5f3d6d8fd98891e99a23ff78a6a357cb2 Mon Sep 17 00:00:00 2001
From c309eed705edd358ba2db8b26d711d0f8ae41dca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 24 Feb 2014 11:38:13 +0000
Subject: [PATCH] Resolves: rhbz#1065807 use xdg ~/Templates for default
Subject: [PATCH 3/4] Resolves: rhbz#1065807 use xdg ~/Templates for default
Template location
(if it exists)
Change-Id: I98fc9fd54d1f56c8bed24ce4d2ebf53756ded2cc
---
framework/source/services/pathsettings.cxx | 6 +++
framework/source/services/pathsettings.cxx | 6 ++++
.../registry/data/org/openoffice/Office/Paths.xcu | 13 +++++++
shell/source/backends/desktopbe/desktopbackend.cxx | 21 ++++++++---
shell/source/backends/gconfbe/gconfaccess.cxx | 43 +++++++++++++++-------
shell/source/backends/gconfbe/gconfaccess.cxx | 41 ++++++++++++++++------
shell/source/backends/gconfbe/gconfaccess.hxx | 1 +
5 files changed, 66 insertions(+), 18 deletions(-)
5 files changed, 66 insertions(+), 16 deletions(-)
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 90d61d2..105c5a6 100644
index 15fb3c0..bdb2949 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -644,6 +644,12 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath)
@@ -280,6 +280,12 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath)
// read the writeable path
xPath->getByName(CFGPROP_WRITEPATH) >>= aPathVal.sWritePath;
@ -59,10 +59,10 @@ index 4b5ec7d..2ef605e 100644
</node>
<node oor:name="UIConfig" oor:op="fuse" oor:mandatory="true">
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
index 8233bff..0acf337 100644
index 3e8e8c1..52d8358 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -153,11 +153,22 @@ css::uno::Any Default::getPropertyValue(OUString const & PropertyName)
@@ -154,11 +154,22 @@ css::uno::Any Default::getPropertyValue(OUString const & PropertyName)
css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
css::uno::RuntimeException)
{
@ -91,7 +91,7 @@ index 8233bff..0acf337 100644
return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
}
diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx
index 8cf9f4b..1bdad66 100644
index de8eb29..0d407d6 100644
--- a/shell/source/backends/gconfbe/gconfaccess.cxx
+++ b/shell/source/backends/gconfbe/gconfaccess.cxx
@@ -23,6 +23,7 @@
@ -102,7 +102,7 @@ index 8cf9f4b..1bdad66 100644
#include "osl/file.hxx"
#include "osl/security.hxx"
#include "osl/thread.h"
@@ -189,19 +190,10 @@ static OUString xdg_user_dir_lookup (const char *type)
@@ -189,15 +190,8 @@ static OUString xdg_user_dir_lookup (const char *type)
if( osl::FileBase::E_None == aDocumentsDir.open() )
return aDocumentsDirURL;
}
@ -119,12 +119,8 @@ index 8cf9f4b..1bdad66 100644
+ return aHomeDirURL + "/" + OUString::createFromAscii(type);
}
-
-
uno::Any makeAnyOfGconfValue( GConfValue *pGconfValue )
{
switch( pGconfValue->type )
@@ -317,11 +309,18 @@ uno::Any translateToOOo( const ConfigurationValue &rValue, GConfValue *pGconfVal
//------------------------------------------------------------------------------
@@ -317,11 +311,18 @@ uno::Any translateToOOo( const ConfigurationValue &rValue, GConfValue *pGconfVal
case SETTING_WORK_DIRECTORY:
{
@ -144,7 +140,7 @@ index 8cf9f4b..1bdad66 100644
case SETTING_USER_GIVENNAME:
{
OUString aCompleteName( OStringToOUString(
@@ -392,7 +391,7 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
@@ -392,7 +393,7 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
case SETTING_WORK_DIRECTORY:
{
@ -153,7 +149,7 @@ index 8cf9f4b..1bdad66 100644
osl::Directory aDocumentsDir( aDocumentsDirURL );
if( osl::FileBase::E_None == aDocumentsDir.open() )
@@ -400,6 +399,16 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
@@ -400,6 +401,16 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
}
break;
@ -170,7 +166,7 @@ index 8cf9f4b..1bdad66 100644
case SETTING_USER_GIVENNAME:
{
OUString aCompleteName( OStringToOUString(
@@ -563,6 +572,14 @@ ConfigurationValue const ConfigurationValues[] =
@@ -563,6 +574,14 @@ ConfigurationValue const ConfigurationValues[] =
},
{

@ -1,7 +1,7 @@
From 6f48d0bb2d3f3b4e4d3e46d3a5cdeaa552df1933 Mon Sep 17 00:00:00 2001
From 783e5a2e149694974fcce79a01144c78f154bfee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 25 Feb 2014 09:55:48 +0000
Subject: [PATCH] explictly list common lang-independant template dir
Subject: [PATCH 4/4] explictly list common lang-independant template dir
Change-Id: I50d8efe46fc2eb3dfe615ad1f6eb7ee03cdcd29a
---

Loading…
Cancel
Save