1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
22 #include <svx/sdr/contact/viewcontactofsdrobj.hxx>
23 #include <svx/sdr/contact/objectcontact.hxx>
24 #include <svx/sdr/contact/displayinfo.hxx>
25 #include <svx/svdobj.hxx>
26 #include <svx/svdoole2.hxx>
27 #include <svx/svdview.hxx>
31 //////////////////////////////////////////////////////////////////////////////
37 const SdrObject
& ViewObjectContactOfSdrObj::getSdrObject() const
39 return static_cast< ViewContactOfSdrObj
& >(GetViewContact()).GetSdrObject();
42 ViewObjectContactOfSdrObj::ViewObjectContactOfSdrObj(ObjectContact
& rObjectContact
, ViewContact
& rViewContact
)
43 : ViewObjectContact(rObjectContact
, rViewContact
)
47 ViewObjectContactOfSdrObj::~ViewObjectContactOfSdrObj()
51 bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SetOfByte
& aLayers
) const
53 return aLayers
.IsSet(getSdrObject().GetLayer());
56 bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo
& rDisplayInfo
) const
58 const SdrObject
& rObject
= getSdrObject();
60 // Test layer visibility
61 if(!isPrimitiveVisibleOnAnyLayer(rDisplayInfo
.GetProcessLayers()))
66 if(GetObjectContact().isOutputToPrinter() )
68 // Test if print output but not printable
69 if( !rObject
.IsPrintable())
74 // test is object is not visible on screen
75 if( !rObject
.IsVisible() )
79 // Test for hidden object on MasterPage
80 if(rDisplayInfo
.GetSubContentActive() && rObject
.IsNotVisibleAsMaster())
85 // Test for Calc object hiding (for OLE and Graphic it's extra, see there)
86 const SdrPageView
* pSdrPageView
= GetObjectContact().TryToGetSdrPageView();
90 const SdrView
& rSdrView
= pSdrPageView
->GetView();
91 const bool bHideOle(rSdrView
.getHideOle());
92 const bool bHideChart(rSdrView
.getHideChart());
93 const bool bHideDraw(rSdrView
.getHideDraw());
94 const bool bHideFormControl(rSdrView
.getHideFormControl());
96 if(bHideOle
|| bHideChart
|| bHideDraw
|| bHideFormControl
)
98 if(OBJ_OLE2
== rObject
.GetObjIdentifier())
100 if(((SdrOle2Obj
&)rObject
).IsChart())
117 else if(OBJ_GRAF
== rObject
.GetObjIdentifier())
119 // graphic handled like OLE
127 const bool bIsFormControl
= dynamic_cast< const FmFormObj
* >( &rObject
) != 0;
128 if(bIsFormControl
&& bHideFormControl
)
132 // any other draw object
133 if(!bIsFormControl
&& bHideDraw
)
143 } // end of namespace contact
144 } // end of namespace sdr
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */