2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-02 14:13:40 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2009-09-30 09:14:44 +02:00
|
|
|
|
2010-10-14 22:33:33 +01:00
|
|
|
#include <sal/macros.h>
|
|
|
|
#include <sal/config.h>
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2008-02-04 12:58:36 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
#include "com/sun/star/uno/RuntimeException.hpp"
|
|
|
|
#include "osl/file.hxx"
|
|
|
|
#include "osl/security.hxx"
|
|
|
|
#include "osl/thread.h"
|
|
|
|
#include "rtl/strbuf.hxx"
|
|
|
|
#include "rtl/ustrbuf.hxx"
|
2010-10-14 22:33:33 +01:00
|
|
|
#include "sal/macros.h"
|
2007-06-19 15:11:58 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
#include "gconfaccess.hxx"
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
|
|
|
|
#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
namespace gconfaccess {
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
namespace uno = css::uno ;
|
2011-02-26 22:26:51 +01:00
|
|
|
|
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::rtl::OString;
|
|
|
|
using ::rtl::OStringToOUString;
|
|
|
|
using ::rtl::OUStringBuffer;
|
2009-09-30 09:14:44 +02:00
|
|
|
|
|
|
|
GConfClient* getGconfClient()
|
|
|
|
{
|
|
|
|
static GConfClient* mClient= 0;
|
|
|
|
if (mClient == NULL)
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2009-09-30 09:14:44 +02:00
|
|
|
/* initialize glib object type library */
|
|
|
|
g_type_init();
|
|
|
|
|
|
|
|
GError* aError = NULL;
|
|
|
|
if (!gconf_init(0, NULL, &aError))
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
OUString msg("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " +
|
|
|
|
OUString::createFromAscii(aError->message));
|
2009-09-30 09:14:44 +02:00
|
|
|
|
|
|
|
g_error_free(aError);
|
|
|
|
aError = NULL;
|
2013-01-14 23:03:40 -02:00
|
|
|
throw uno::RuntimeException(msg, NULL);
|
2009-09-30 09:14:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mClient = gconf_client_get_default();
|
|
|
|
if (!mClient)
|
|
|
|
{
|
2010-11-19 19:34:59 +01:00
|
|
|
throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
|
|
|
|
("GconfBackend:GconfLayer: Cannot Initialize Gconf connection")),NULL);
|
2009-09-30 09:14:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char * const PreloadValuesList[] =
|
|
|
|
{
|
|
|
|
"/desktop/gnome/interface",
|
|
|
|
"/system/proxy",
|
|
|
|
"/system/http_proxy/host",
|
|
|
|
"/desktop/gnome/url-handlers/mailto",
|
|
|
|
#ifdef ENABLE_LOCKDOWN
|
|
|
|
"/apps/openoffice",
|
|
|
|
"/desktop/gnome/lockdown",
|
|
|
|
"/apps/openoffice/lockdown",
|
|
|
|
#endif // ENABLE_LOCKDOWN
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
int i = 0;
|
|
|
|
while( PreloadValuesList[i] != NULL )
|
|
|
|
gconf_client_preload( mClient, PreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
return mClient;
|
|
|
|
}
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2007-06-19 15:11:58 +00:00
|
|
|
static OUString xdg_user_dir_lookup (const char *type)
|
|
|
|
{
|
|
|
|
char *config_home;
|
|
|
|
char *p;
|
|
|
|
bool bError = false;
|
|
|
|
|
|
|
|
osl::Security aSecurity;
|
|
|
|
oslFileHandle handle;
|
|
|
|
OUString aHomeDirURL;
|
|
|
|
OUString aDocumentsDirURL;
|
|
|
|
OUString aConfigFileURL;
|
|
|
|
OUStringBuffer aUserDirBuf;
|
|
|
|
|
|
|
|
if (!aSecurity.getHomeDir( aHomeDirURL ) )
|
|
|
|
{
|
2012-06-02 22:43:34 -05:00
|
|
|
osl::FileBase::getFileURLFromSystemPath(rtl::OUString("/tmp"), aDocumentsDirURL);
|
2011-10-02 17:57:05 +02:00
|
|
|
return aDocumentsDirURL;
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
config_home = getenv ("XDG_CONFIG_HOME");
|
|
|
|
if (config_home == NULL || config_home[0] == 0)
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
aConfigFileURL = aHomeDirURL + "/.config/user-dirs.dirs";
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
aConfigFileURL = OUString::createFromAscii(config_home) + "/user-dirs.dirs";
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(osl_File_E_None == osl_openFile(aConfigFileURL.pData, &handle, osl_File_OpenFlag_Read))
|
|
|
|
{
|
2011-10-02 17:57:05 +02:00
|
|
|
rtl::ByteSequence seq;
|
|
|
|
while (osl_File_E_None == osl_readLine(handle , (sal_Sequence **)&seq))
|
2007-06-19 15:11:58 +00:00
|
|
|
{
|
2011-10-02 17:57:05 +02:00
|
|
|
/* Remove newline at end */
|
|
|
|
int relative = 0;
|
|
|
|
int len = seq.getLength();
|
|
|
|
if(len>0 && seq[len-1] == '\n')
|
|
|
|
seq[len-1] = 0;
|
|
|
|
|
|
|
|
p = (char *)seq.getArray();
|
|
|
|
while (*p == ' ' || *p == '\t')
|
|
|
|
p++;
|
|
|
|
if (strncmp (p, "XDG_", 4) != 0)
|
|
|
|
continue;
|
|
|
|
p += 4;
|
|
|
|
if (strncmp (p, type, strlen (type)) != 0)
|
|
|
|
continue;
|
|
|
|
p += strlen (type);
|
|
|
|
if (strncmp (p, "_DIR", 4) != 0)
|
|
|
|
continue;
|
|
|
|
p += 4;
|
|
|
|
while (*p == ' ' || *p == '\t')
|
|
|
|
p++;
|
|
|
|
if (*p != '=')
|
|
|
|
continue;
|
2007-06-19 15:11:58 +00:00
|
|
|
p++;
|
2011-10-02 17:57:05 +02:00
|
|
|
while (*p == ' ' || *p == '\t')
|
|
|
|
p++;
|
|
|
|
if (*p != '"')
|
|
|
|
continue;
|
|
|
|
p++;
|
|
|
|
if (strncmp (p, "$HOME/", 6) == 0)
|
|
|
|
{
|
|
|
|
p += 6;
|
|
|
|
relative = 1;
|
|
|
|
}
|
|
|
|
else if (*p != '/')
|
|
|
|
continue;
|
|
|
|
if (relative)
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
aUserDirBuf = OUStringBuffer(aHomeDirURL + "/");
|
2011-10-02 17:57:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aUserDirBuf = OUStringBuffer();
|
|
|
|
}
|
|
|
|
while (*p && *p != '"')
|
|
|
|
{
|
|
|
|
if ((*p == '\\') && (*(p+1) != 0))
|
|
|
|
p++;
|
|
|
|
aUserDirBuf.append((sal_Unicode)*p++);
|
|
|
|
}
|
|
|
|
}//end of while
|
|
|
|
osl_closeFile(handle);
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
else
|
2011-10-02 17:57:05 +02:00
|
|
|
bError = true;
|
2007-06-19 15:11:58 +00:00
|
|
|
if (aUserDirBuf.getLength()>0 && !bError)
|
|
|
|
{
|
2011-10-02 17:57:05 +02:00
|
|
|
aDocumentsDirURL = aUserDirBuf.makeStringAndClear();
|
|
|
|
osl::Directory aDocumentsDir( aDocumentsDirURL );
|
|
|
|
if( osl::FileBase::E_None == aDocumentsDir.open() )
|
|
|
|
return aDocumentsDirURL;
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
/* Special case desktop for historical compatibility */
|
|
|
|
if (strcmp (type, "DESKTOP") == 0)
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
return aHomeDirURL + "/Desktop";
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
return aHomeDirURL + "/Documents";
|
2007-06-19 15:11:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any makeAnyOfGconfValue( GConfValue *pGconfValue )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
switch( pGconfValue->type )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
|
|
|
case GCONF_VALUE_BOOL:
|
2011-03-04 18:53:06 +00:00
|
|
|
return uno::makeAny( (sal_Bool) gconf_value_get_bool( pGconfValue ) );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
|
|
|
case GCONF_VALUE_INT:
|
2011-03-04 18:53:06 +00:00
|
|
|
return uno::makeAny( (sal_Int32) gconf_value_get_int( pGconfValue ) );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
|
|
|
case GCONF_VALUE_STRING:
|
|
|
|
return uno::makeAny( OStringToOUString( rtl::OString(
|
2011-03-04 18:53:06 +00:00
|
|
|
gconf_value_get_string(pGconfValue) ), RTL_TEXTENCODING_UTF8 ) );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf( stderr, "makeAnyOfGconfValue: Type not handled.\n" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return uno::Any();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
static void splitFontName( GConfValue *pGconfValue, rtl::OUString &rName, sal_Int16 &rHeight)
|
2006-11-01 13:22:41 +00:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
rtl::OString aFont( gconf_value_get_string( pGconfValue ) );
|
2012-12-05 17:29:32 +01:00
|
|
|
aFont = aFont.trim();
|
2006-11-01 13:22:41 +00:00
|
|
|
sal_Int32 nIdx = aFont.lastIndexOf( ' ' );
|
|
|
|
if (nIdx < 1) { // urk
|
|
|
|
rHeight = 12;
|
|
|
|
nIdx = aFont.getLength();
|
|
|
|
} else {
|
|
|
|
rtl::OString aSize = aFont.copy( nIdx + 1 );
|
|
|
|
rHeight = static_cast<sal_Int16>( aSize.toInt32() );
|
|
|
|
}
|
|
|
|
|
|
|
|
rName = rtl::OStringToOUString( aFont.copy( 0, nIdx ), RTL_TEXTENCODING_UTF8 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any translateToOOo( const ConfigurationValue &rValue, GConfValue *pGconfValue )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2007-06-19 15:11:58 +00:00
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
switch( rValue.nSettingId )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
|
|
|
case SETTING_PROXY_MODE:
|
|
|
|
{
|
|
|
|
rtl::OUString aProxyMode;
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any aOriginalValue = makeAnyOfGconfValue( pGconfValue );
|
2006-03-22 08:37:16 +00:00
|
|
|
aOriginalValue >>= aProxyMode;
|
|
|
|
|
2012-04-06 14:09:04 +02:00
|
|
|
if( aProxyMode == "manual" )
|
2006-03-22 08:37:16 +00:00
|
|
|
return uno::makeAny( (sal_Int32) 1 );
|
2012-04-06 14:09:04 +02:00
|
|
|
else if( aProxyMode == "none" )
|
2006-03-22 08:37:16 +00:00
|
|
|
return uno::makeAny( (sal_Int32) 0 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2007-04-04 06:47:04 +00:00
|
|
|
case SETTING_NO_PROXY_FOR:
|
|
|
|
{
|
|
|
|
rtl::OStringBuffer aBuffer;
|
2011-03-04 18:53:06 +00:00
|
|
|
if( (GCONF_VALUE_LIST == pGconfValue->type) && (GCONF_VALUE_STRING == gconf_value_get_list_type(pGconfValue)) )
|
2007-04-04 06:47:04 +00:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
GSList * list = gconf_value_get_list(pGconfValue);
|
2007-04-04 06:47:04 +00:00
|
|
|
for(; list; list = g_slist_next(list))
|
|
|
|
{
|
2013-01-14 23:03:40 -02:00
|
|
|
aBuffer.append(gconf_value_get_string((GConfValue *) list->data) + OString(";"));
|
2007-04-04 06:47:04 +00:00
|
|
|
}
|
|
|
|
// Remove trailing ";"
|
|
|
|
aBuffer.setLength(aBuffer.getLength()-1);
|
|
|
|
return uno::makeAny(rtl::OStringToOUString(aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
g_warning( "unexpected type for ignore_hosts" );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-03-22 08:37:16 +00:00
|
|
|
case SETTING_MAILER_PROGRAM:
|
|
|
|
{
|
|
|
|
rtl::OUString aMailer;
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any aOriginalValue = makeAnyOfGconfValue( pGconfValue );
|
2006-03-22 08:37:16 +00:00
|
|
|
aOriginalValue >>= aMailer;
|
|
|
|
sal_Int32 nIndex = 0;
|
|
|
|
return uno::makeAny( aMailer.getToken( 0, ' ', nIndex ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef ENABLE_LOCKDOWN
|
|
|
|
// "short" values need to be returned a sal_Int16
|
|
|
|
case SETTING_FONT_ANTI_ALIASING_MIN_PIXEL:
|
|
|
|
case SETTING_SYMBOL_SET:
|
|
|
|
{
|
2010-11-05 15:19:36 +00:00
|
|
|
sal_Int32 nShortValue(0);
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any aOriginalValue = makeAnyOfGconfValue( pGconfValue );
|
2006-03-22 08:37:16 +00:00
|
|
|
aOriginalValue >>= nShortValue;
|
|
|
|
return uno::makeAny( (sal_Int16) nShortValue );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif // ENABLE_LOCKDOWN
|
|
|
|
|
|
|
|
// "boolean" values that need a string to be returned
|
|
|
|
case SETTING_ENABLE_ACCESSIBILITY:
|
|
|
|
#ifdef ENABLE_LOCKDOWN
|
|
|
|
case SETTING_DISABLE_PRINTING:
|
|
|
|
#endif // ENABLE_LOCKDOWN
|
|
|
|
{
|
2006-07-19 16:15:23 +00:00
|
|
|
sal_Bool bBooleanValue = false;
|
2011-03-04 18:53:06 +00:00
|
|
|
uno::Any aOriginalValue = makeAnyOfGconfValue( pGconfValue );
|
2006-03-22 08:37:16 +00:00
|
|
|
aOriginalValue >>= bBooleanValue;
|
|
|
|
return uno::makeAny( rtl::OUString::valueOf( (sal_Bool) bBooleanValue ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
case SETTING_WORK_DIRECTORY:
|
|
|
|
{
|
2007-06-19 15:11:58 +00:00
|
|
|
rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS");
|
|
|
|
|
2006-07-13 11:31:14 +00:00
|
|
|
return uno::makeAny( aDocumentsDirURL );
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case SETTING_USER_GIVENNAME:
|
|
|
|
{
|
|
|
|
rtl::OUString aCompleteName( rtl::OStringToOUString(
|
|
|
|
g_get_real_name(), osl_getThreadTextEncoding() ) );
|
|
|
|
sal_Int32 nIndex = 0;
|
|
|
|
rtl::OUString aGivenName;
|
|
|
|
do
|
|
|
|
aGivenName = aCompleteName.getToken( 0, ' ', nIndex );
|
|
|
|
while ( nIndex == 0 );
|
|
|
|
|
|
|
|
return uno::makeAny( aGivenName );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case SETTING_USER_SURNAME:
|
|
|
|
{
|
|
|
|
rtl::OUString aCompleteName( rtl::OStringToOUString(
|
|
|
|
g_get_real_name(), osl_getThreadTextEncoding() ) );
|
|
|
|
sal_Int32 nIndex = 0;
|
|
|
|
rtl::OUString aSurname;
|
|
|
|
do
|
|
|
|
aSurname = aCompleteName.getToken( 0, ' ', nIndex );
|
|
|
|
while ( nIndex >= 0 );
|
|
|
|
|
|
|
|
return uno::makeAny( aSurname );
|
|
|
|
}
|
|
|
|
|
2006-11-01 13:22:41 +00:00
|
|
|
case SETTING_SOURCEVIEWFONT_NAME:
|
|
|
|
case SETTING_SOURCEVIEWFONT_HEIGHT:
|
|
|
|
{
|
|
|
|
rtl::OUString aName;
|
|
|
|
sal_Int16 nHeight;
|
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
splitFontName (pGconfValue, aName, nHeight);
|
|
|
|
if (rValue.nSettingId == SETTING_SOURCEVIEWFONT_NAME)
|
2006-11-01 13:22:41 +00:00
|
|
|
return uno::makeAny( aName );
|
|
|
|
else
|
|
|
|
return uno::makeAny( nHeight );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-03-22 08:37:16 +00:00
|
|
|
default:
|
|
|
|
fprintf( stderr, "Unhandled setting to translate.\n" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return uno::Any();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const ConfigurationValue &rValue )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
switch( rValue.nDependsOn )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
|
|
|
case SETTING_PROXY_MODE:
|
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
GConfValue* pGconfValue = gconf_client_get( pClient, GCONF_PROXY_MODE_KEY, NULL );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
if ( pGconfValue != NULL )
|
2006-11-01 13:22:41 +00:00
|
|
|
{
|
2012-05-29 09:01:32 +02:00
|
|
|
bool bOk = g_ascii_strcasecmp( "manual", gconf_value_get_string( pGconfValue ) ) == 0;
|
2011-03-04 18:53:06 +00:00
|
|
|
gconf_value_free( pGconfValue );
|
2006-11-01 13:22:41 +00:00
|
|
|
if (bOk) return sal_True;
|
|
|
|
}
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SETTING_WORK_DIRECTORY:
|
|
|
|
{
|
2009-06-04 15:06:14 +00:00
|
|
|
rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS");
|
|
|
|
osl::Directory aDocumentsDir( aDocumentsDirURL );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-06-04 15:06:14 +00:00
|
|
|
if( osl::FileBase::E_None == aDocumentsDir.open() )
|
|
|
|
return sal_True;
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SETTING_USER_GIVENNAME:
|
|
|
|
{
|
|
|
|
rtl::OUString aCompleteName( rtl::OStringToOUString(
|
|
|
|
g_get_real_name(), osl_getThreadTextEncoding() ) );
|
2012-04-06 19:49:53 +02:00
|
|
|
if( aCompleteName != "Unknown" )
|
2006-03-22 08:37:16 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SETTING_USER_SURNAME:
|
|
|
|
{
|
|
|
|
rtl::OUString aCompleteName( rtl::OStringToOUString(
|
|
|
|
g_get_real_name(), osl_getThreadTextEncoding() ) );
|
2012-04-06 19:49:53 +02:00
|
|
|
if( aCompleteName != "Unknown" )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2012-07-12 22:10:17 +02:00
|
|
|
if( aCompleteName.trim().indexOf( ' ' ) != -1 )
|
2006-03-22 08:37:16 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef ENABLE_LOCKDOWN
|
|
|
|
case SETTING_AUTO_SAVE:
|
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
GConfValue* pGconfValue = gconf_client_get( pClient, GCONF_AUTO_SAVE_KEY, NULL );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
if( ( pGconfValue != NULL ) )
|
2006-11-01 13:22:41 +00:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
bool bOk = gconf_value_get_bool( pGconfValue );
|
|
|
|
gconf_value_free( pGconfValue );
|
2006-11-01 13:22:41 +00:00
|
|
|
if (bOk) return sal_True;
|
|
|
|
}
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif // ENABLE_LOCKDOWN
|
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf( stderr, "Unhandled setting to check dependency.\n" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
}
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
ConfigurationValue const ConfigurationValues[] =
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
|
|
|
{
|
2009-09-30 09:14:44 +02:00
|
|
|
SETTING_ENABLE_ACCESSIBILITY,
|
|
|
|
"/desktop/gnome/interface/accessibility",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_PROXY_MODE,
|
|
|
|
GCONF_PROXY_MODE_KEY,
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_PROXY_HTTP_HOST,
|
|
|
|
"/system/http_proxy/host",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_PROXY_HTTP_PORT,
|
|
|
|
"/system/http_proxy/port",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_PROXY_HTTPS_HOST,
|
|
|
|
"/system/proxy/secure_host",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
|
|
|
{
|
2009-09-30 09:14:44 +02:00
|
|
|
SETTING_PROXY_HTTPS_PORT,
|
|
|
|
"/system/proxy/secure_port",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_PROXY_FTP_HOST,
|
|
|
|
"/system/proxy/ftp_host",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-11-01 13:22:41 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_PROXY_FTP_PORT,
|
|
|
|
"/system/proxy/ftp_port",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_NO_PROXY_FOR,
|
|
|
|
"/system/http_proxy/ignore_hosts",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTING_PROXY_MODE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_MAILER_PROGRAM,
|
|
|
|
"/desktop/gnome/url-handlers/mailto/command",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ExternalMailer"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
{
|
|
|
|
SETTING_SOURCEVIEWFONT_NAME,
|
|
|
|
"/desktop/gnome/interface/monospace_font_name",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("SourceViewFontName"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
{
|
|
|
|
SETTING_SOURCEVIEWFONT_HEIGHT,
|
|
|
|
"/desktop/gnome/interface/monospace_font_name",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-11-01 13:22:41 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_WORK_DIRECTORY,
|
|
|
|
"/desktop/gnome/url-handlers/mailto/command", // dummy
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2012-07-09 09:47:52 +01:00
|
|
|
{
|
|
|
|
SETTING_USER_GIVENNAME,
|
|
|
|
"/desktop/gnome/url-handlers/mailto/command", // dummy
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("givenname"),
|
|
|
|
sal_True,
|
|
|
|
SETTING_USER_GIVENNAME
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_USER_SURNAME,
|
|
|
|
"/desktop/gnome/url-handlers/mailto/command", // dummy
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("sn"),
|
|
|
|
sal_True,
|
|
|
|
SETTING_USER_SURNAME
|
|
|
|
},
|
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
#ifdef ENABLE_LOCKDOWN
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2009-09-30 09:14:44 +02:00
|
|
|
SETTING_WRITER_DEFAULT_DOC_FORMAT,
|
|
|
|
"/apps/openoffice/writer_default_document_format",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("TextDocumentSetupFactoryDefaultFilter"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
|
|
|
|
"/apps/openoffice/impress_default_document_format",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("PresentationDocumentSetupFactoryDefaultFilter"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_CALC_DEFAULT_DOC_FORMAT,
|
|
|
|
"/apps/openoffice/calc_default_document_format",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("SpreadsheetDocumentSetupFactoryDefaultFilter"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_AUTO_SAVE,
|
|
|
|
GCONF_AUTO_SAVE_KEY,
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("AutoSaveEnabled"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_AUTO_SAVE_INTERVAL,
|
|
|
|
"/apps/openoffice/auto_save_interval",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("AutoSaveTimeIntervall"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTING_AUTO_SAVE
|
|
|
|
},
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
|
|
|
SETTING_DISABLE_PRINTING,
|
|
|
|
"/desktop/gnome/lockdown/disable_printing",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("DisablePrinting"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_USE_SYSTEM_FILE_DIALOG,
|
|
|
|
"/apps/openoffice/use_system_file_dialog",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("UseSystemFileDialog"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_PRINTING_MODIFIES_DOCUMENT,
|
|
|
|
"/apps/openoffice/printing_modifies_doc",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("PrintingModifiesDocument"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_SHOW_ICONS_IN_MENUS,
|
|
|
|
"/apps/openoffice/show_menu_icons",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ShowIconsInMenues"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_SHOW_INACTIVE_MENUITEMS,
|
|
|
|
"/apps/openoffice/show_menu_inactive_items",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("DontHideDisabledEntry"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_SHOW_FONT_PREVIEW,
|
|
|
|
"/apps/openoffice/show_font_preview",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("ShowFontBoxWYSIWYG"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_SHOW_FONT_HISTORY,
|
|
|
|
"/apps/openoffice/show_font_history",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("FontViewHistory"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_ENABLE_OPENGL,
|
|
|
|
"/apps/openoffice/use_opengl",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("OpenGL"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_OPTIMIZE_OPENGL,
|
|
|
|
"/apps/openoffice/optimize_opengl",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("OpenGL_Faster"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_USE_SYSTEM_FONT,
|
|
|
|
"/apps/openoffice/use_system_font",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("AccessibilityIsSystemFont"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_USE_FONT_ANTI_ALIASING,
|
|
|
|
"/apps/openoffice/use_font_anti_aliasing",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("FontAntiAliasingEnabled"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
|
|
|
|
"/apps/openoffice/font_anti_aliasing_min_pixel",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("FontAntiAliasingMinPixelHeight"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_WARN_CREATE_PDF,
|
|
|
|
"/apps/openoffice/lockdown/warn_info_create_pdf",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WarnCreatePDF"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_WARN_PRINT_DOC,
|
|
|
|
"/apps/openoffice/lockdown/warn_info_printing",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WarnPrintDoc"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_WARN_SAVEORSEND_DOC,
|
|
|
|
"/apps/openoffice/lockdown/warn_info_saving",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WarnSaveOrSendDoc"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_WARN_SIGN_DOC,
|
|
|
|
"/apps/openoffice/lockdown/warn_info_signing",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WarnSignDoc"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_REMOVE_PERSONAL_INFO,
|
|
|
|
"/apps/openoffice/lockdown/remove_personal_info_on_save",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("RemovePersonalInfoOnSaving"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_RECOMMEND_PASSWORD,
|
|
|
|
"/apps/openoffice/lockdown/recommend_password_on_save",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("RecommendPasswordProtection"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_UNDO_STEPS,
|
|
|
|
"/apps/openoffice/undo_steps",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("UndoSteps"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_SYMBOL_SET,
|
|
|
|
"/apps/openoffice/icon_size",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("SymbolSet"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_True,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_MACRO_SECURITY_LEVEL,
|
|
|
|
"/apps/openoffice/lockdown/macro_security_level",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("MacroSecurityLevel"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_CREATE_BACKUP,
|
|
|
|
"/apps/openoffice/create_backup",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("CreateBackup"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
SETTING_WARN_ALIEN_FORMAT,
|
|
|
|
"/apps/openoffice/warn_alien_format",
|
2011-01-17 10:29:58 +00:00
|
|
|
RTL_CONSTASCII_STRINGPARAM("WarnAlienFormat"),
|
2009-09-30 09:14:44 +02:00
|
|
|
sal_False,
|
|
|
|
SETTINGS_LAST
|
|
|
|
},
|
|
|
|
|
|
|
|
#endif // ENABLE_LOCKDOWN
|
|
|
|
};
|
|
|
|
|
2012-05-29 17:23:51 +01:00
|
|
|
std::size_t const nConfigurationValues =
|
|
|
|
sizeof ConfigurationValues / sizeof ConfigurationValues[0];
|
2009-09-30 09:14:44 +02:00
|
|
|
|
2009-10-01 13:40:46 +02:00
|
|
|
css::beans::Optional< css::uno::Any > getValue(ConfigurationValue const & data)
|
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
GConfClient* pClient = getGconfClient();
|
|
|
|
GConfValue* pGconfValue;
|
|
|
|
if( ( data.nDependsOn == SETTINGS_LAST ) || isDependencySatisfied( pClient, data ) )
|
2009-09-30 09:14:44 +02:00
|
|
|
{
|
2011-03-04 18:53:06 +00:00
|
|
|
pGconfValue = gconf_client_get( pClient, data.GconfItem, NULL );
|
2006-03-22 08:37:16 +00:00
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
if( pGconfValue != NULL )
|
2006-03-22 08:37:16 +00:00
|
|
|
{
|
2009-09-30 09:14:44 +02:00
|
|
|
css::uno::Any value;
|
|
|
|
if( data.bNeedsTranslation )
|
2011-03-04 18:53:06 +00:00
|
|
|
value = translateToOOo( data, pGconfValue );
|
2009-09-30 09:14:44 +02:00
|
|
|
else
|
2011-03-04 18:53:06 +00:00
|
|
|
value = makeAnyOfGconfValue( pGconfValue );
|
2009-09-30 09:14:44 +02:00
|
|
|
|
2011-03-04 18:53:06 +00:00
|
|
|
gconf_value_free( pGconfValue );
|
2009-09-30 09:14:44 +02:00
|
|
|
|
2009-10-01 13:40:46 +02:00
|
|
|
return css::beans::Optional< css::uno::Any >(true, value);
|
2006-03-22 08:37:16 +00:00
|
|
|
}
|
|
|
|
}
|
2009-10-01 13:40:46 +02:00
|
|
|
return css::beans::Optional< css::uno::Any >();
|
2009-09-30 09:14:44 +02:00
|
|
|
}
|
2006-03-22 08:37:16 +00:00
|
|
|
|
|
|
|
}
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|