diff options
Diffstat (limited to 'xfa/src/fwl')
-rw-r--r-- | xfa/src/fwl/src/core/fwl_appimp.cpp | 2 | ||||
-rw-r--r-- | xfa/src/fwl/src/core/fwl_noteimp.cpp | 19 | ||||
-rw-r--r-- | xfa/src/fwl/src/core/include/fwl_noteimp.h | 9 |
3 files changed, 23 insertions, 7 deletions
diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp index 70e46e6a41..e70d3f6a09 100644 --- a/xfa/src/fwl/src/core/fwl_appimp.cpp +++ b/xfa/src/fwl/src/core/fwl_appimp.cpp @@ -28,7 +28,7 @@ CFWL_AppImp::CFWL_AppImp(IFWL_AdapterNative *pAdapter) }
CFWL_AppImp::~CFWL_AppImp()
{
- delete CFWL_ToolTipContainer::getInstance();
+ CFWL_ToolTipContainer::DeleteInstance();
if (m_bFuelAdapter) {
FWL_ReleaseFuelAdapterNative(m_pAdapterNative);
m_pAdapterNative = NULL;
diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp index 40f0c1137d..417020ac0f 100644 --- a/xfa/src/fwl/src/core/fwl_noteimp.cpp +++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp @@ -938,6 +938,9 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event *pEvent, FX_DWORD dwFilter) }
return bRet;
}
+
+CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL;
+
CFWL_ToolTipContainer::CFWL_ToolTipContainer()
: pCurTarget(NULL)
, m_pToolTipImp(NULL)
@@ -959,13 +962,21 @@ CFWL_ToolTipContainer::~CFWL_ToolTipContainer() m_ToolTipDp = NULL;
}
}
+// static
CFWL_ToolTipContainer* CFWL_ToolTipContainer::getInstance()
{
- static CFWL_ToolTipContainer * _toolTipContainer = NULL;
- if (!_toolTipContainer) {
- _toolTipContainer = FX_NEW CFWL_ToolTipContainer;
+ if (!s_pInstance) {
+ s_pInstance = FX_NEW CFWL_ToolTipContainer;
+ }
+ return s_pInstance;
+}
+// static
+void CFWL_ToolTipContainer::DeleteInstance()
+{
+ if (s_pInstance) {
+ delete s_pInstance;
+ s_pInstance = NULL;
}
- return _toolTipContainer;
}
FX_ERR CFWL_ToolTipContainer::AddToolTipTarget(IFWL_ToolTipTarget *pTarget)
{
diff --git a/xfa/src/fwl/src/core/include/fwl_noteimp.h b/xfa/src/fwl/src/core/include/fwl_noteimp.h index 1e7239289b..aeed0b3955 100644 --- a/xfa/src/fwl/src/core/include/fwl_noteimp.h +++ b/xfa/src/fwl/src/core/include/fwl_noteimp.h @@ -127,8 +127,8 @@ protected: class CFWL_ToolTipContainer: public CFX_Object
{
public:
- virtual ~CFWL_ToolTipContainer();
static CFWL_ToolTipContainer* getInstance();
+ static void DeleteInstance();
FX_ERR AddToolTipTarget(IFWL_ToolTipTarget *pTarget);
FX_ERR RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget);
@@ -140,13 +140,18 @@ public: FX_BOOL ProcessLeave(CFWL_EvtMouse *pEvt);
FX_ERR SetToolTipInitialDelay(FX_INT32 iDelayTime);
- FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+ FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime);
+
protected:
CFWL_ToolTipContainer();
+ virtual ~CFWL_ToolTipContainer();
IFWL_ToolTipTarget *pCurTarget;
CFWL_ToolTipImp *m_pToolTipImp;
CFWL_CoreToopTipDP *m_ToolTipDp;
CFX_PtrArray m_arrWidget;
+
+private:
+ static CFWL_ToolTipContainer* s_pInstance;
};
#endif
|