fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / drawfunc / drawsh4.cxx
blobb9fbb88e13d391a9564934e7458d9a03bfecb287
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
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"
34 void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
36 const SdrObject* pObj = NULL;
37 SvxFontWorkDialog* pDlg = NULL;
38 ScDrawView* pDrView = pViewData->GetScDrawView();
39 const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
40 sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
42 SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
43 if (pViewFrm->HasChildWindow(nId))
45 SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
46 pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL;
49 if ( rMarkList.GetMarkCount() == 1 )
50 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
52 const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
53 const bool bDeactivate(
54 !pObj ||
55 !pTextObj ||
56 !pTextObj->HasText() ||
57 dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
59 if(bDeactivate)
61 rSet.DisableItem(XATTR_FORMTXTSTYLE);
62 rSet.DisableItem(XATTR_FORMTXTADJUST);
63 rSet.DisableItem(XATTR_FORMTXTDISTANCE);
64 rSet.DisableItem(XATTR_FORMTXTSTART);
65 rSet.DisableItem(XATTR_FORMTXTMIRROR);
66 rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
67 rSet.DisableItem(XATTR_FORMTXTOUTLINE);
68 rSet.DisableItem(XATTR_FORMTXTSHADOW);
69 rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
70 rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
71 rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
73 else
75 if ( pDlg )
77 SfxObjectShell* pDocSh = SfxObjectShell::Current();
79 if ( pDocSh )
81 const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
82 XColorListRef pColorList;
84 if ( pItem )
85 pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
87 if ( pColorList.is() )
88 pDlg->SetColorList( pColorList );
91 SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
92 pDrView->GetAttributes(aViewAttr);
93 rSet.Set(aViewAttr);
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */