Kaydet (Commit) 3abc9868 authored tarafından Caolán McNamara's avatar Caolán McNamara

GetAutoHelpId logically can only return an empty string now

Change-Id: Ie7368f083a5aa6bcfb249375fbae1f4cd92e02ba
üst 540b7d3a
...@@ -192,10 +192,7 @@ public: ...@@ -192,10 +192,7 @@ public:
sal_Int16 ReadShort(); sal_Int16 ReadShort();
sal_Int32 ReadLong(); sal_Int32 ReadLong();
OUString ReadString(); OUString ReadString();
OString ReadByteString(); OString ReadByteString();
/// Generate auto help ID for current resource stack
OString GetAutoHelpId();
static void SetReadStringHook( ResHookProc pProc ); static void SetReadStringHook( ResHookProc pProc );
static ResHookProc GetReadStringHook(); static ResHookProc GetReadStringHook();
......
...@@ -1386,57 +1386,6 @@ OString ResMgr::ReadByteString() ...@@ -1386,57 +1386,6 @@ OString ResMgr::ReadByteString()
return aRet; return aRet;
} }
OString ResMgr::GetAutoHelpId()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->GetAutoHelpId();
OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
if( nCurStack < 1 || nCurStack > 2 )
return OString();
// prepare HID, start with resource prefix
OStringBuffer aHID( 32 );
aHID.append( OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
aHID.append( '.' );
// append type
const ImpRCStack *pRC = StackTop();
OSL_ENSURE( pRC, "missing resource stack level" );
if ( nCurStack == 1 )
{
// auto help ids for top level windows
switch( pRC->pResource->GetRT() ) {
default: return OString();
}
}
else
{
// only controls with the following parents get auto help ids
const ImpRCStack *pRC1 = StackTop(1);
switch( pRC1->pResource->GetRT() ) {
default:
return OString();
}
}
// append resource id hierarchy
for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
{
aHID.append( '.' );
pRC = StackTop( nOff );
OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
if( pRC->pResource )
aHID.append( sal_Int32( pRC->pResource->GetId() ) );
}
return aHID.makeStringAndClear();
}
void ResMgr::SetReadStringHook( ResHookProc pProc ) void ResMgr::SetReadStringHook( ResHookProc pProc )
{ {
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() ); osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
......
...@@ -24,16 +24,6 @@ ...@@ -24,16 +24,6 @@
#include "window.h" #include "window.h"
static OString ImplAutoHelpID( ResMgr* pResMgr )
{
OString aRet;
if( pResMgr && Application::IsAutoHelpIdEnabled() )
aRet = pResMgr->GetAutoHelpId();
return aRet;
}
namespace vcl { namespace vcl {
WinBits Window::ImplInitRes( const ResId& rResId ) WinBits Window::ImplInitRes( const ResId& rResId )
...@@ -46,18 +36,12 @@ WinBits Window::ImplInitRes( const ResId& rResId ) ...@@ -46,18 +36,12 @@ WinBits Window::ImplInitRes( const ResId& rResId )
return nStyle; return nStyle;
} }
WindowResHeader Window::ImplLoadResHeader( const ResId& rResId ) WindowResHeader Window::ImplLoadResHeader( const ResId& /*rResId*/ )
{ {
WindowResHeader aHeader; WindowResHeader aHeader;
aHeader.nObjMask = (RscWindowFlags)ReadLongRes(); aHeader.nObjMask = (RscWindowFlags)ReadLongRes();
// we need to calculate auto helpids before the resource gets closed
// if the resource only contains flags, it will be closed before we try to read a help id
// so we always create an auto help id that might be overwritten later
// HelpId
aHeader.aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
// ResourceStyle // ResourceStyle
aHeader.nRSStyle = (RSWND)ReadLongRes(); aHeader.nRSStyle = (RSWND)ReadLongRes();
// WinBits // WinBits
......
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