Kaydet (Commit) ef2c49c9 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS perform06 (1.6.60); FILE MERGED

2005/11/07 13:32:40 as 1.6.60.2: #i56589# dont cache GlobalEventConfig() inside ItemHolder1^... combination of static pointer and WeakImplHelper cant not work
2005/10/25 08:04:02 as 1.6.60.1: #i56589# hold config items alive till office die
üst ca34339d
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: itemholder1.cxx,v $ * $RCSfile: itemholder1.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 14:40:15 $ * last change: $Author: rt $ $Date: 2005-11-11 08:50:10 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -46,21 +46,38 @@ ...@@ -46,21 +46,38 @@
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
#endif #endif
#include <moduleoptions.hxx> #include <accelcfg.hxx>
#include <addxmltostorageoptions.hxx> #include <addxmltostorageoptions.hxx>
#include <cacheoptions.hxx>
#include <cmdoptions.hxx>
#include <compatibility.hxx>
#include <defaultoptions.hxx>
#include <dynamicmenuoptions.hxx>
#include <eventcfg.hxx>
#include <extendedsecurityoptions.hxx> #include <extendedsecurityoptions.hxx>
#include <fltrcfg.hxx>
#include <fontoptions.hxx> #include <fontoptions.hxx>
#include <historyoptions.hxx> #include <historyoptions.hxx>
#include <inetoptions.hxx> #include <inetoptions.hxx>
#include <internaloptions.hxx> #include <internaloptions.hxx>
#include <languageoptions.hxx> #include <javaoptions.hxx>
#include <lingucfg.hxx>
#include <localisationoptions.hxx> #include <localisationoptions.hxx>
#include <menuoptions.hxx> #include <menuoptions.hxx>
#include <miscopt.hxx> #include <miscopt.hxx>
#include <moduleoptions.hxx> #include <moduleoptions.hxx>
#include <options3d.hxx>
#include <pathoptions.hxx>
#include <printwarningoptions.hxx>
#include <regoptions.hxx>
#include <saveopt.hxx> #include <saveopt.hxx>
#include <searchopt.hxx>
#include <securityoptions.hxx> #include <securityoptions.hxx>
#include <sourceviewconfig.hxx>
#include <startoptions.hxx> #include <startoptions.hxx>
#include <viewoptions.hxx>
#include <workingsetoptions.hxx>
#include <xmlaccelcfg.hxx>
//----------------------------------------------- //-----------------------------------------------
// namespaces // namespaces
...@@ -110,14 +127,22 @@ ItemHolder1::~ItemHolder1() ...@@ -110,14 +127,22 @@ ItemHolder1::~ItemHolder1()
} }
//----------------------------------------------- //-----------------------------------------------
ItemHolder1* ItemHolder1::getGlobalItemHolder() void ItemHolder1::holdConfigItem(EItem eItem)
{ {
static ItemHolder1* pHolder = new ItemHolder1(); static ItemHolder1* pHolder = new ItemHolder1();
return pHolder; pHolder->impl_addItem(eItem);
} }
//----------------------------------------------- //-----------------------------------------------
void ItemHolder1::holdConfigItem(EItem eItem) void SAL_CALL ItemHolder1::disposing(const css::lang::EventObject& aEvent)
throw(css::uno::RuntimeException)
{
css::uno::Reference< css::uno::XInterface > xSelfHold(static_cast< css::lang::XEventListener* >(this), css::uno::UNO_QUERY);
impl_releaseAllItems();
}
//-----------------------------------------------
void ItemHolder1::impl_addItem(EItem eItem)
{ {
::osl::ResettableMutexGuard aLock(m_aLock); ::osl::ResettableMutexGuard aLock(m_aLock);
...@@ -138,13 +163,6 @@ void ItemHolder1::holdConfigItem(EItem eItem) ...@@ -138,13 +163,6 @@ void ItemHolder1::holdConfigItem(EItem eItem)
m_lItems.push_back(aNewItem); m_lItems.push_back(aNewItem);
} }
//-----------------------------------------------
void SAL_CALL ItemHolder1::disposing(const css::lang::EventObject& aEvent)
throw(css::uno::RuntimeException)
{
impl_releaseAllItems();
}
//----------------------------------------------- //-----------------------------------------------
void ItemHolder1::impl_releaseAllItems() void ItemHolder1::impl_releaseAllItems()
{ {
...@@ -166,18 +184,42 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem) ...@@ -166,18 +184,42 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
{ {
switch(rItem.eItem) switch(rItem.eItem)
{ {
case E_MODULEOPTIONS : case E_ACCELCFG :
rItem.pItem = new SvtModuleOptions(); rItem.pItem = new SvtAcceleratorConfiguration();
break; break;
case E_ADDXMLTOSTORAGEOPTIONS : case E_ADDXMLTOSTORAGEOPTIONS :
rItem.pItem = new SvtAddXMLToStorageOptions(); rItem.pItem = new SvtAddXMLToStorageOptions();
break; break;
case E_CMDOPTIONS :
rItem.pItem = new SvtCommandOptions();
break;
case E_COMPATIBILITY :
rItem.pItem = new SvtCompatibilityOptions();
break;
case E_DEFAULTOPTIONS :
rItem.pItem = new SvtDefaultOptions();
break;
case E_DYNAMICMENUOPTIONS :
rItem.pItem = new SvtDynamicMenuOptions();
break;
case E_EVENTCFG :
//rItem.pItem = new GlobalEventConfig();
break;
case E_EXTENDEDSECURITYOPTIONS : case E_EXTENDEDSECURITYOPTIONS :
rItem.pItem = new SvtExtendedSecurityOptions(); rItem.pItem = new SvtExtendedSecurityOptions();
break; break;
case E_FLTRCFG :
// no ref count rItem.pItem = new SvtFilterOptions();
break;
case E_FONTOPTIONS : case E_FONTOPTIONS :
rItem.pItem = new SvtFontOptions(); rItem.pItem = new SvtFontOptions();
break; break;
...@@ -194,6 +236,14 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem) ...@@ -194,6 +236,14 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
rItem.pItem = new SvtInternalOptions(); rItem.pItem = new SvtInternalOptions();
break; break;
case E_JAVAOPTIONS :
// no ref count rItem.pItem = new SvtJavaOptions();
break;
case E_LINGUCFG :
rItem.pItem = new SvtLinguConfig();
break;
case E_LOCALISATIONOPTIONS : case E_LOCALISATIONOPTIONS :
rItem.pItem = new SvtLocalisationOptions(); rItem.pItem = new SvtLocalisationOptions();
break; break;
...@@ -206,80 +256,78 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem) ...@@ -206,80 +256,78 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
rItem.pItem = new SvtMiscOptions(); rItem.pItem = new SvtMiscOptions();
break; break;
case E_SAVEOPTIONS : case E_MODULEOPTIONS :
rItem.pItem = new SvtSaveOptions(); rItem.pItem = new SvtModuleOptions();
break; break;
case E_SECURITYOPTIONS : case E_OPTIONS3D :
rItem.pItem = new SvtSecurityOptions(); rItem.pItem = new SvtOptions3D();
break; break;
case E_STARTOPTIONS : case E_PATHOPTIONS :
rItem.pItem = new SvtStartOptions(); rItem.pItem = new SvtPathOptions();
break; break;
}
}
//----------------------------------------------- case E_PRINTWARNINGOPTIONS :
void ItemHolder1::impl_deleteItem(TItemInfo& rItem) rItem.pItem = new SvtPrintWarningOptions();
{
if (!rItem.pItem)
return;
switch(rItem.eItem)
{
case E_MODULEOPTIONS :
delete (SvtModuleOptions*)rItem.pItem;
break; break;
case E_ADDXMLTOSTORAGEOPTIONS : case E_REGOPTIONS :
delete (SvtAddXMLToStorageOptions*)rItem.pItem; // no ref count rItem.pItem = new ::svt::RegOptions();
break; break;
case E_EXTENDEDSECURITYOPTIONS : case E_SAVEOPTIONS :
delete (SvtExtendedSecurityOptions*)rItem.pItem; rItem.pItem = new SvtSaveOptions();
break; break;
case E_FONTOPTIONS : case E_SEARCHOPT :
delete (SvtFontOptions*)rItem.pItem; // no ref count rItem.pItem = new SvtSearchOptions();
break; break;
case E_HISTORYOPTIONS : case E_SECURITYOPTIONS :
delete (SvtHistoryOptions*)rItem.pItem; rItem.pItem = new SvtSecurityOptions();
break; break;
case E_INETOPTIONS : case E_SOURCEVIEWCONFIG :
delete (SvtInetOptions*)rItem.pItem; rItem.pItem = new ::svt::SourceViewConfig();
break; break;
case E_INTERNALOPTIONS : case E_STARTOPTIONS :
delete (SvtInternalOptions*)rItem.pItem; rItem.pItem = new SvtStartOptions();
break; break;
case E_LOCALISATIONOPTIONS : case E_VIEWOPTIONS_DIALOG :
delete (SvtLocalisationOptions*)rItem.pItem; rItem.pItem = new SvtViewOptions(E_DIALOG, ::rtl::OUString());
break; break;
case E_MENUOPTIONS : case E_VIEWOPTIONS_TABDIALOG :
delete (SvtMenuOptions*)rItem.pItem; rItem.pItem = new SvtViewOptions(E_TABDIALOG, ::rtl::OUString());
break; break;
case E_MISCOPTIONS : case E_VIEWOPTIONS_TABPAGE :
delete (SvtMiscOptions*)rItem.pItem; rItem.pItem = new SvtViewOptions(E_TABPAGE, ::rtl::OUString());
break; break;
case E_SAVEOPTIONS : case E_VIEWOPTIONS_WINDOW :
delete (SvtSaveOptions*)rItem.pItem; rItem.pItem = new SvtViewOptions(E_WINDOW, ::rtl::OUString());
break; break;
case E_SECURITYOPTIONS : case E_WORKINGSETOPTIONS :
delete (SvtSecurityOptions*)rItem.pItem; rItem.pItem = new SvtWorkingSetOptions();
break; break;
case E_STARTOPTIONS : case E_XMLACCELCFG :
delete (SvtStartOptions*)rItem.pItem; // ??? TODO
break; break;
} }
}
rItem.pItem = 0; //-----------------------------------------------
void ItemHolder1::impl_deleteItem(TItemInfo& rItem)
{
if (rItem.pItem)
{
delete rItem.pItem;
rItem.pItem = 0;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment