summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-09-30 17:04:56 +0200
committerMathias Bauer <mba@openoffice.org>2010-09-30 17:04:56 +0200
commit7825ac7bb42ee7e9b336c34e063ad6c3426c527f (patch)
treefe2475b729fc5cadbcdf8f03380a4c9f1f1c7180 /vcl/source
parent86e601e36c69b8c7111d5cd015e391aacb39ae03 (diff)
CWS changehid: make sure that resource isn't closed when ImplAutoHelpId is called
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/window.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 13ceaac01998..c7fa33ce8b76 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1206,18 +1206,20 @@ void Window::ImplLoadRes( const ResId& rResId )
{
ULONG nObjMask = 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
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+
// ResourceStyle
ULONG nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
-
- // HelpId
- rtl::OString aHelpId;
if( nObjMask & WINDOW_HELPID )
aHelpId = ReadByteStringRes();
- if( ! aHelpId.getLength() )
- aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+
SetHelpId( aHelpId );
BOOL bPos = FALSE;