diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-04-15 14:02:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-04-15 14:02:47 +0100 |
commit | ec240eafe9b25620383aa54015f5c55e0f64227a (patch) | |
tree | 20914f1eb8a701302635e409f5dcae07afc839fb /sd/source/ui/view/viewshel.cxx | |
parent | 20015bfb1b10ebbd017e44b021656ae99006f845 (diff) |
Split construct into bits that depend on showing the window and not
This fixes a horrific a11y problem where Show triggers callbacks
to virtual methods, while the object is not fully constructed,
which means, that the *baseclass* virtual method is called,
not the *derived* virtual method that constructs the a11y wrapper
enable a11y, and run the smoketest with dbg-util before touching
this stuff
Diffstat (limited to 'sd/source/ui/view/viewshel.cxx')
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index a7b217993cf9..9c742859d679 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -218,11 +218,6 @@ void ViewShell::construct(void) mpContentWindow->SetViewShell(this); mpContentWindow->SetPosSizePixel( GetParentWindow()->GetPosPixel(),GetParentWindow()->GetSizePixel()); - mpContentWindow->Show(); - static_cast< ::Window*>(mpContentWindow.get())->Resize(); - OSL_TRACE("content window has size %d %d", - mpContentWindow->GetSizePixel().Width(), - mpContentWindow->GetSizePixel().Height()); if ( ! GetDocSh()->IsPreview()) { @@ -231,18 +226,12 @@ void ViewShell::construct(void) mpHorizontalScrollBar->EnableRTL (sal_False); mpHorizontalScrollBar->SetRange(Range(0, 32000)); mpHorizontalScrollBar->SetScrollHdl(LINK(this, ViewShell, HScrollHdl)); - mpHorizontalScrollBar->Show(); mpVerticalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG))); mpVerticalScrollBar->SetRange(Range(0, 32000)); mpVerticalScrollBar->SetScrollHdl(LINK(this, ViewShell, VScrollHdl)); - mpVerticalScrollBar->Show(); - maScrBarWH = Size( - mpVerticalScrollBar->GetSizePixel().Width(), - mpHorizontalScrollBar->GetSizePixel().Height()); mpScrollBarBox.reset(new ScrollBarBox(GetParentWindow(), WB_SIZEABLE)); - mpScrollBarBox->Show(); } String aName( RTL_CONSTASCII_USTRINGPARAM( "ViewShell" )); @@ -264,12 +253,31 @@ void ViewShell::construct(void) // Register the sub shell factory. mpImpl->mpSubShellFactory.reset(new ViewShellObjectBarFactory(*this)); GetViewShellBase().GetViewShellManager()->AddSubShellFactory(this,mpImpl->mpSubShellFactory); - - GetParentWindow()->Show(); } +void ViewShell::doShow(void) +{ + mpContentWindow->Show(); + static_cast< ::Window*>(mpContentWindow.get())->Resize(); + OSL_TRACE("content window has size %d %d", + mpContentWindow->GetSizePixel().Width(), + mpContentWindow->GetSizePixel().Height()); + + if ( ! GetDocSh()->IsPreview()) + { + // Show scroll bars + mpHorizontalScrollBar->Show(); + + mpVerticalScrollBar->Show(); + maScrBarWH = Size( + mpVerticalScrollBar->GetSizePixel().Width(), + mpHorizontalScrollBar->GetSizePixel().Height()); + mpScrollBarBox->Show(); + } + GetParentWindow()->Show(); +} void ViewShell::Init (bool bIsMainViewShell) { |