From 53b8f63d0a8a8d1f99e2f4bf20934cf52c2b6bcd Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 27 Sep 2015 22:11:59 +0200 Subject: tdf#93587: insert table in draw ole object Don't disable "Insert table" option in case of Ole object Change-Id: Ibe87d35db320f4a9d5c971e3f7b25199fcacbde4 Reviewed-on: https://gerrit.libreoffice.org/18897 Tested-by: Jenkins Reviewed-by: Katarina Behrens (cherry picked from commit 2135b4a88d755c0b79a3b93b2269f08b709220c5) Reviewed-on: https://gerrit.libreoffice.org/19067 --- sd/source/ui/table/tablefunction.cxx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index d78cfffaa559..c0c4aef5fef6 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -224,24 +224,16 @@ void DrawViewShell::FuTable(SfxRequest& rReq) void DrawViewShell::GetTableMenuState( SfxItemSet &rSet ) { - bool bIsUIActive = GetDocSh()->IsUIActive(); - if( bIsUIActive ) + OUString aActiveLayer = mpDrawView->GetActiveLayer(); + SdrPageView* pPV = mpDrawView->GetSdrPageView(); + + if( + ( !aActiveLayer.isEmpty() && pPV && ( pPV->IsLayerLocked(aActiveLayer) || + !pPV->IsLayerVisible(aActiveLayer) ) ) || + SD_MOD()->GetWaterCan() ) { rSet.DisableItem( SID_INSERT_TABLE ); } - else - { - OUString aActiveLayer = mpDrawView->GetActiveLayer(); - SdrPageView* pPV = mpDrawView->GetSdrPageView(); - - if( bIsUIActive || - ( !aActiveLayer.isEmpty() && pPV && ( pPV->IsLayerLocked(aActiveLayer) || - !pPV->IsLayerVisible(aActiveLayer) ) ) || - SD_MOD()->GetWaterCan() ) - { - rSet.DisableItem( SID_INSERT_TABLE ); - } - } } void CreateTableFromRTF( SvStream& rStream, SdDrawDocument* pModel ) -- cgit v1.2.3