summaryrefslogtreecommitdiff
path: root/svtools/source/config
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-10-16 00:05:16 +0200
committerMathias Bauer <mba@openoffice.org>2009-10-16 00:05:16 +0200
commitad482351a6c12cddb06575f6a9a00ec1b72d92fb (patch)
treee97f35e966aef21423e70f325a66943664ed62a9 /svtools/source/config
parent9a4d0581c72653e60562d1b8e2121772d21f8a9e (diff)
#i103496#: split svtools; improve ConfitItems
Diffstat (limited to 'svtools/source/config')
-rw-r--r--svtools/source/config/accessibilityoptions.cxx4
-rw-r--r--svtools/source/config/apearcfg.cxx5
-rw-r--r--svtools/source/config/colorcfg.cxx99
-rw-r--r--svtools/source/config/extcolorcfg.cxx4
-rw-r--r--svtools/source/config/fontsubstconfig.cxx6
-rw-r--r--svtools/source/config/optionsdrawinglayer.cxx5
6 files changed, 31 insertions, 92 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 147d0fea5c59..4077231c5c84 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -55,7 +55,7 @@
#include <unotools/loghelper.hxx>
#endif
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
@@ -539,7 +539,7 @@ SvtAccessibilityOptions::~SvtAccessibilityOptions()
void SvtAccessibilityOptions::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- Broadcast( rHint );
+ NotifyListeners(0);
if ( rHint.IsA(TYPE(SfxSimpleHint)) )
{
if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_ACCESSIBILITY_CHANGED )
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index ccfc402ac221..0d4865ee563e 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -171,6 +171,11 @@ void SvtTabAppearanceCfg::Commit()
}
PutProperties(rNames, aValues);
}
+
+void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
+{
+}
+
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index f600be830b41..9008d7a27ee1 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -41,8 +41,8 @@
#include <unotools/configitem.hxx>
#include <unotools/configpathes.hxx>
#include <com/sun/star/uno/Sequence.h>
-#include <svtools/poolitem.hxx> //Any2Bool
-#include <svtools/smplhint.hxx>
+#include <svl/poolitem.hxx> //Any2Bool
+#include <svl/smplhint.hxx>
#include <vos/mutex.hxx>
#include <itemholder2.hxx>
@@ -76,15 +76,12 @@ ColorConfig_Impl* ColorConfig::m_pImpl = NULL;
/* -----------------------------16.01.01 15:36--------------------------------
---------------------------------------------------------------------------*/
-class ColorConfig_Impl : public utl::ConfigItem, public SfxBroadcaster
+class ColorConfig_Impl : public utl::ConfigItem
{
ColorConfigValue m_aConfigValues[ColorConfigEntryCount];
sal_Bool m_bEditMode;
rtl::OUString m_sIsVisible;
rtl::OUString m_sLoadedScheme;
- sal_Bool m_bIsBroadcastEnabled;
- static sal_Bool m_bLockBroadcast;
- static sal_Bool m_bBroadcastWhenUnlocked;
uno::Sequence< ::rtl::OUString> GetPropertyNames(const rtl::OUString& rScheme);
public:
@@ -113,13 +110,6 @@ public:
void ClearModified(){ConfigItem::ClearModified();}
void SettingsChanged();
- static void DisableBroadcast();
- static void EnableBroadcast();
- static sal_Bool IsEnableBroadcast();
-
- static void LockBroadcast();
- static void UnlockBroadcast();
-
// #100822#
DECL_LINK( DataChangedEventListener, VclWindowEvent* );
@@ -214,13 +204,10 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const rtl::OUString&
/* -----------------------------22.03.2002 14:37------------------------------
---------------------------------------------------------------------------*/
-sal_Bool ColorConfig_Impl::m_bLockBroadcast = sal_False;
-sal_Bool ColorConfig_Impl::m_bBroadcastWhenUnlocked = sal_False;
ColorConfig_Impl::ColorConfig_Impl(sal_Bool bEditMode) :
ConfigItem(C2U("Office.UI/ColorScheme")),
m_bEditMode(bEditMode),
- m_sIsVisible(C2U("/IsVisible")),
- m_bIsBroadcastEnabled(sal_True)
+ m_sIsVisible(C2U("/IsVisible"))
{
if(!m_bEditMode)
{
@@ -244,23 +231,6 @@ ColorConfig_Impl::~ColorConfig_Impl()
// #100822#
::Application::RemoveEventListener( LINK(this, ColorConfig_Impl, DataChangedEventListener) );
}
-// -----------------------------------------------------------------------------
-void ColorConfig_Impl::DisableBroadcast()
-{
- if ( ColorConfig::m_pImpl )
- ColorConfig::m_pImpl->m_bIsBroadcastEnabled = sal_False;
-}
-// -----------------------------------------------------------------------------
-void ColorConfig_Impl::EnableBroadcast()
-{
- if ( ColorConfig::m_pImpl )
- ColorConfig::m_pImpl->m_bIsBroadcastEnabled = sal_True;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ColorConfig_Impl::IsEnableBroadcast()
-{
- return ColorConfig::m_pImpl ? ColorConfig::m_pImpl->m_bIsBroadcastEnabled : sal_False;
-}
/* -----------------------------22.03.2002 14:38------------------------------
---------------------------------------------------------------------------*/
@@ -303,16 +273,7 @@ void ColorConfig_Impl::Notify( const uno::Sequence<OUString>& )
{
//loading via notification always uses the default setting
Load(::rtl::OUString());
-
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
-
- if(m_bLockBroadcast)
- {
- m_bBroadcastWhenUnlocked = sal_True;
- ImplUpdateApplicationSettings();
- }
- else
- Broadcast(SfxSimpleHint(SFX_HINT_COLORS_CHANGED));
+ NotifyListeners(0);
}
/* -----------------------------22.03.2002 14:38------------------------------
@@ -409,34 +370,7 @@ void ColorConfig_Impl::SettingsChanged()
ImplUpdateApplicationSettings();
- Broadcast( SfxSimpleHint( SFX_HINT_COLORS_CHANGED ) );
-}
-/* -----------------11.12.2002 09:21-----------------
- *
- * --------------------------------------------------*/
-void ColorConfig_Impl::LockBroadcast()
-{
- m_bLockBroadcast = sal_True;
-}
-/* -----------------11.12.2002 09:21-----------------
- *
- * --------------------------------------------------*/
-void ColorConfig_Impl::UnlockBroadcast()
-{
- if ( m_bBroadcastWhenUnlocked )
- {
- m_bBroadcastWhenUnlocked = ColorConfig::m_pImpl != NULL;
- if ( m_bBroadcastWhenUnlocked )
- {
- ColorConfig::m_pImpl->ImplUpdateApplicationSettings();
- if ( ColorConfig::m_pImpl->IsEnableBroadcast() )
- {
- m_bBroadcastWhenUnlocked = sal_False;
- ColorConfig::m_pImpl->Broadcast(SfxSimpleHint(SFX_HINT_COLORS_CHANGED));
- }
- }
- }
- m_bLockBroadcast = sal_False;
+ NotifyListeners(0);
}
/* -----------------------------2002/08/16 12:07 -----------------------------
#100822#
@@ -495,7 +429,7 @@ ColorConfig::ColorConfig()
ItemHolder2::holdConfigItem(E_COLORCFG);
}
++nColorRefCount_Impl;
- StartListening( *m_pImpl);
+ m_pImpl->AddListener(this);
}
/* -----------------------------16.01.01 15:36--------------------------------
@@ -503,7 +437,7 @@ ColorConfig::ColorConfig()
ColorConfig::~ColorConfig()
{
::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
- EndListening( *m_pImpl);
+ m_pImpl->RemoveListener(this);
if(!--nColorRefCount_Impl)
{
delete m_pImpl;
@@ -631,15 +565,6 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS
return aRet;
}
-/* -----------------------------12.04.2002 09:25------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfig::Notify( SfxBroadcaster&, const SfxHint& rHint )
-{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
-
- Broadcast( rHint );
-}
/* -----------------------------25.03.2002 12:01------------------------------
---------------------------------------------------------------------------*/
@@ -647,14 +572,14 @@ EditableColorConfig::EditableColorConfig() :
m_pImpl(new ColorConfig_Impl),
m_bModified(sal_False)
{
- m_pImpl->LockBroadcast();
+ m_pImpl->BlockBroadcasts(TRUE);
}
/*-- 25.03.2002 12:03:08---------------------------------------------------
-----------------------------------------------------------------------*/
EditableColorConfig::~EditableColorConfig()
{
- m_pImpl->UnlockBroadcast();
+ m_pImpl->BlockBroadcasts(FALSE);
if(m_bModified)
m_pImpl->SetModified();
if(m_pImpl->IsModified())
@@ -752,12 +677,12 @@ void EditableColorConfig::Commit()
// -----------------------------------------------------------------------------
void EditableColorConfig::DisableBroadcast()
{
- m_pImpl->DisableBroadcast();
+ m_pImpl->BlockBroadcasts(TRUE);
}
// -----------------------------------------------------------------------------
void EditableColorConfig::EnableBroadcast()
{
- m_pImpl->EnableBroadcast();
+ m_pImpl->BlockBroadcasts(FALSE);
}
// -----------------------------------------------------------------------------
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 66dfd8af1ebb..89bf41ac9f58 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -40,8 +40,8 @@
#include <unotools/configitem.hxx>
#include <unotools/configpathes.hxx>
#include <com/sun/star/uno/Sequence.h>
-#include <svtools/poolitem.hxx> //Any2Bool
-#include <svtools/smplhint.hxx>
+#include <svl/poolitem.hxx> //Any2Bool
+#include <svl/smplhint.hxx>
#include <vos/mutex.hxx>
/* #100822# ----
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index 4d1c9b7db5c5..dc9bfa64e6d4 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svtools.hxx"
#include "fontsubstconfig.hxx"
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -124,6 +124,10 @@ SvtFontSubstConfig::~SvtFontSubstConfig()
/*-- 18.01.01 12:08:00---------------------------------------------------
-----------------------------------------------------------------------*/
+void SvtFontSubstConfig::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
+{
+}
+
void SvtFontSubstConfig::Commit()
{
Sequence<OUString> aNames(1);
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index abb044c7863e..d4aeda6e6be8 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -191,6 +191,7 @@ public:
//---------------------------------------------------------------------------------------------------------
virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
//---------------------------------------------------------------------------------------------------------
// public interface
@@ -735,6 +736,10 @@ void SvtOptionsDrawinglayer_Impl::Commit()
PutProperties( aSeqNames, aSeqValues );
}
+void SvtOptionsDrawinglayer_Impl::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& )
+{
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************