From 64fe80db1f06c01084a1c8c498ac874ce4e476ce Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 7 Jul 2015 14:44:59 +0200 Subject: Replace GetAppData(SHL_SVDDE) with a static pointer var Change-Id: I63d35dc3dbfb1185d5795316d2c1d77745d85451 --- svl/source/svdde/ddecli.cxx | 23 +++++++++++++++-------- svl/source/svdde/ddeimp.hxx | 6 +----- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'svl/source/svdde') diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index 860f7c65579b..f771075a333d 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -29,20 +29,27 @@ #include #include -DdeInstData* ImpInitInstData() +namespace { + +DdeInstData * theDdeInstData; + +} + +DdeInstData* ImpGetInstData() { - DdeInstData* pData = new DdeInstData; + return theDdeInstData; +} - DdeInstData** ppInst = (DdeInstData**)GetAppData( SHL_SVDDE ); - *ppInst = pData; - return pData; +DdeInstData* ImpInitInstData() +{ + theDdeInstData = new DdeInstData; + return theDdeInstData; } void ImpDeinitInstData() { - DdeInstData** ppInst = (DdeInstData**)GetAppData( SHL_SVDDE ); - delete (*ppInst); - *ppInst = 0; + delete theDdeInstData; + theDdeInstData = 0; } diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx index 23bffe9f7405..265025cdb3b3 100644 --- a/svl/source/svdde/ddeimp.hxx +++ b/svl/source/svdde/ddeimp.hxx @@ -26,7 +26,6 @@ #include #include #include -#include #include @@ -121,10 +120,7 @@ public: } }; -inline DdeInstData* ImpGetInstData() -{ - return (DdeInstData*)(*GetAppData( SHL_SVDDE )); -} +DdeInstData* ImpGetInstData(); DdeInstData* ImpInitInstData(); void ImpDeinitInstData(); -- cgit