summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2006-11-01 13:22:41 +0000
committerVladimir Glazounov <vg@openoffice.org>2006-11-01 13:22:41 +0000
commit5b8e944435bc279e1ce07217bc9366a792bf3741 (patch)
tree96bfce0ce0cad3f34b40cfff0838f3de2a701006 /shell
parent9f0c9243e425725b14345e9de11b0f1352454589 (diff)
INTEGRATION: CWS shellfix04 (1.9.18); FILE MERGED
2006/10/12 13:13:21 obr 1.9.18.4: #i67985# fixed merge error 2006/10/12 13:08:27 obr 1.9.18.3: #i67985# patch applied 2006/10/10 06:06:13 obr 1.9.18.2: RESYNC: (1.9-1.10); FILE MERGED 2006/09/04 13:42:25 obr 1.9.18.1: #i69058# patch applied
Diffstat (limited to 'shell')
-rw-r--r--shell/source/backends/gconfbe/gconflayer.cxx59
1 files changed, 51 insertions, 8 deletions
diff --git a/shell/source/backends/gconfbe/gconflayer.cxx b/shell/source/backends/gconfbe/gconflayer.cxx
index 5f4f67a324b5..6e40ec88e6d6 100644
--- a/shell/source/backends/gconfbe/gconflayer.cxx
+++ b/shell/source/backends/gconfbe/gconflayer.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: gconflayer.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 01:37:20 $
+ * last change: $Author: vg $ $Date: 2006-11-01 14:22:41 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -121,6 +121,24 @@ uno::Any makeAnyOfGconfValue( GConfValue *aGconfValue )
//------------------------------------------------------------------------------
+static void splitFontName( GConfValue *aGconfValue, rtl::OUString &rName, sal_Int16 &rHeight)
+{
+ rtl::OString aFont( gconf_value_get_string( aGconfValue ) );
+ aFont.trim();
+ 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 );
+}
+
+//------------------------------------------------------------------------------
+
uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValue )
{
switch( aValue.nSettingId )
@@ -208,6 +226,20 @@ uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValu
return uno::makeAny( aSurname );
}
+ case SETTING_SOURCEVIEWFONT_NAME:
+ case SETTING_SOURCEVIEWFONT_HEIGHT:
+ {
+ rtl::OUString aName;
+ sal_Int16 nHeight;
+
+ splitFontName (aGconfValue, aName, nHeight);
+ if (aValue.nSettingId == SETTING_SOURCEVIEWFONT_NAME)
+ return uno::makeAny( aName );
+ else
+ return uno::makeAny( nHeight );
+ }
+
+
default:
fprintf( stderr, "Unhandled setting to translate.\n" );
break;
@@ -227,8 +259,12 @@ sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
GConfClient* aClient = GconfBackend::getGconfClient();
GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_PROXY_MODE_KEY, NULL );
- if( ( aGconfValue != NULL ) && ( g_strcasecmp( "manual", gconf_value_get_string( aGconfValue ) ) == 0 ) )
- return sal_True;
+ if ( aGconfValue != NULL )
+ {
+ bool bOk = g_strcasecmp( "manual", gconf_value_get_string( aGconfValue ) ) == 0;
+ gconf_value_free( aGconfValue );
+ if (bOk) return sal_True;
+ }
}
break;
@@ -274,8 +310,12 @@ sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
GConfClient* aClient = GconfBackend::getGconfClient();
GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_AUTO_SAVE_KEY, NULL );
- if( ( aGconfValue != NULL ) && gconf_value_get_bool( aGconfValue ) )
- return sal_True;
+ if( ( aGconfValue != NULL ) )
+ {
+ bool bOk = gconf_value_get_bool( aGconfValue );
+ gconf_value_free( aGconfValue );
+ if (bOk) return sal_True;
+ }
}
break;
#endif // ENABLE_LOCKDOWN
@@ -313,11 +353,11 @@ void SAL_CALL GconfLayer::readData( const uno::Reference<backend::XLayerHandler>
for( i = 0; i < m_nConfigurationValues; i++ )
{
- aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
-
if( ( m_pConfigurationValuesList[i].nDependsOn != SETTINGS_LAST ) && !isDependencySatisfied( m_pConfigurationValuesList[i] ) )
continue;
+ aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
+
if( aGconfValue != NULL )
{
aPropInfoList[nProperties].Name = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfItem );
@@ -329,6 +369,8 @@ void SAL_CALL GconfLayer::readData( const uno::Reference<backend::XLayerHandler>
else
aPropInfoList[nProperties].Value = makeAnyOfGconfValue( aGconfValue );
+ gconf_value_free( aGconfValue );
+
nProperties++;
}
}
@@ -384,6 +426,7 @@ rtl::OUString SAL_CALL GconfLayer::getTimestamp( void )
break;
}
nHashCode = (nHashCode << 5) - nHashCode;
+ gconf_value_free( aGconfValue );
}
}