summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/drviews3.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-02-28 02:15:29 +0000
committerMichael Stahl <mstahl@redhat.com>2014-06-05 21:33:27 +0000
commitb4c090d8e6ad7727fc5a0399349b9ed0b5ff75f2 (patch)
tree5c1d1c7d12d29d84574e3d6f19ae005dcdfcb7b1 /sd/source/ui/view/drviews3.cxx
parent2dd048b2613a8309ba7673ef2cefae6dee56b235 (diff)
Resolves: fdo#78953 secured usage of LayerTabBar in Draw...
was #i87182# secured usage of LayerTabBar in Draw... ensured initialization when used as OLE (cherry picked from commit 903afaa8ea0766e01ba41a227d2794c2c40b129a) Conflicts: sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx sd/source/ui/view/drviews3.cxx sd/source/ui/view/drviews7.cxx sd/source/ui/view/drviewsb.cxx (cherry picked from commit b1cf64fe51fd0bb1e9bc8c3bb38d5cc7254d8d5f) Conflicts: sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx sd/source/ui/view/drviews3.cxx sd/source/ui/view/drviews7.cxx Change-Id: I86bb17bf422356247a319f89e54d1ead97b368b8 Reviewed-on: https://gerrit.libreoffice.org/9654 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd/source/ui/view/drviews3.cxx')
-rw-r--r--sd/source/ui/view/drviews3.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 31e89a4b8e36..f2929425c49d 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -199,17 +199,34 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_SWITCHLAYER: // BASIC
{
const SfxItemSet *pArgs = rReq.GetArgs ();
- sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId ();
- if( pArgs && pArgs->Count () == 1)
+ // #i87182#
+ bool bCurPageValid(false);
+ sal_uInt16 nCurPage(0);
+
+ if(GetLayerTabControl())
+ {
+ nCurPage = GetLayerTabControl()->GetCurPageId();
+ bCurPageValid = true;
+ }
+
+ if(pArgs && 1 == pArgs->Count())
{
SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
- if( pWhatLayer )
- nCurPage = (short) pWhatLayer->GetValue ();
+
+ if(pWhatLayer)
+ {
+ nCurPage = (short)pWhatLayer->GetValue();
+ bCurPageValid = true;
+ }
+ }
+
+ if(bCurPageValid)
+ {
+ mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
+ Invalidate();
}
- mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
- Invalidate();
rReq.Done ();
break;