LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/source/ui/drawfunc - drawsh4.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 44 2.3 %
Date: 2013-07-09 Functions: 2 3 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "scitems.hxx"
      21             : #include <svx/drawitem.hxx>
      22             : #include <svx/fontwork.hxx>
      23             : #include <svx/svdotext.hxx>
      24             : #include <svx/xdef.hxx>
      25             : #include <sfx2/objsh.hxx>
      26             : #include <sfx2/viewfrm.hxx>
      27             : #include <svx/svdoashp.hxx>
      28             : #include "drawsh.hxx"
      29             : #include "drawview.hxx"
      30             : #include "viewdata.hxx"
      31             : #include "tabvwsh.hxx"
      32             : #include "sc.hrc"
      33             : 
      34             : 
      35             : //------------------------------------------------------------------
      36             : 
      37           0 : void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
      38             : {
      39           0 :     const SdrObject*    pObj        = NULL;
      40           0 :     SvxFontWorkDialog*  pDlg        = NULL;
      41           0 :     ScDrawView*         pDrView     = pViewData->GetScDrawView();
      42           0 :     const SdrMarkList&  rMarkList   = pDrView->GetMarkedObjectList();
      43           0 :     sal_uInt16              nId = SvxFontWorkChildWindow::GetChildWindowId();
      44             : 
      45           0 :     SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
      46           0 :     if ( pViewFrm->HasChildWindow(nId) )
      47           0 :         pDlg = (SvxFontWorkDialog*)(pViewFrm->GetChildWindow(nId)->GetWindow());
      48             : 
      49           0 :     if ( rMarkList.GetMarkCount() == 1 )
      50           0 :         pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
      51             : 
      52           0 :     const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
      53             :     const bool bDeactivate(
      54           0 :         !pObj ||
      55           0 :         !pTextObj ||
      56           0 :         !pTextObj->HasText() ||
      57           0 :         dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
      58             : 
      59           0 :     if(bDeactivate)
      60             :     {
      61           0 :         if ( pDlg )
      62           0 :             pDlg->SetActive(false);
      63             : 
      64           0 :         rSet.DisableItem(XATTR_FORMTXTSTYLE);
      65           0 :         rSet.DisableItem(XATTR_FORMTXTADJUST);
      66           0 :         rSet.DisableItem(XATTR_FORMTXTDISTANCE);
      67           0 :         rSet.DisableItem(XATTR_FORMTXTSTART);
      68           0 :         rSet.DisableItem(XATTR_FORMTXTMIRROR);
      69           0 :         rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
      70           0 :         rSet.DisableItem(XATTR_FORMTXTOUTLINE);
      71           0 :         rSet.DisableItem(XATTR_FORMTXTSHADOW);
      72           0 :         rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
      73           0 :         rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
      74           0 :         rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
      75             :     }
      76             :     else
      77             :     {
      78           0 :         if ( pDlg )
      79             :         {
      80           0 :             SfxObjectShell* pDocSh = SfxObjectShell::Current();
      81             : 
      82           0 :             if ( pDocSh )
      83             :             {
      84           0 :                 const SfxPoolItem*  pItem = pDocSh->GetItem( SID_COLOR_TABLE );
      85           0 :                 XColorListRef pColorList;
      86             : 
      87           0 :                 if ( pItem )
      88           0 :                     pColorList = ((SvxColorListItem*)pItem)->GetColorList();
      89             : 
      90           0 :                 pDlg->SetActive();
      91             : 
      92           0 :                 if ( pColorList.is() )
      93           0 :                     pDlg->SetColorList( pColorList );
      94             :             }
      95             :         }
      96           0 :         SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
      97           0 :         pDrView->GetAttributes(aViewAttr);
      98           0 :         rSet.Set(aViewAttr);
      99             :     }
     100          93 : }
     101             : 
     102             : 
     103             : 
     104             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10