1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewobjectcontactofsdrobj.cxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_svx.hxx"
35 #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
36 #include <svx/sdr/contact/viewcontactofsdrobj.hxx>
37 #include <svx/sdr/contact/objectcontact.hxx>
38 #include <svx/sdr/contact/displayinfo.hxx>
39 #include <svx/svdobj.hxx>
40 #include <svx/svdoole2.hxx>
41 #include <svx/svdview.hxx>
43 //////////////////////////////////////////////////////////////////////////////
49 const SdrObject
& ViewObjectContactOfSdrObj::getSdrObject() const
51 return static_cast< ViewContactOfSdrObj
& >(GetViewContact()).GetSdrObject();
54 ViewObjectContactOfSdrObj::ViewObjectContactOfSdrObj(ObjectContact
& rObjectContact
, ViewContact
& rViewContact
)
55 : ViewObjectContact(rObjectContact
, rViewContact
)
59 ViewObjectContactOfSdrObj::~ViewObjectContactOfSdrObj()
63 bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo
& rDisplayInfo
) const
65 const SdrObject
& rObject
= getSdrObject();
67 // Test layer visibility
68 if(!rDisplayInfo
.GetProcessLayers().IsSet(rObject
.GetLayer()))
73 // Test if print output but not printable
74 if(GetObjectContact().isOutputToPrinter() && !rObject
.IsPrintable())
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());
95 if(bHideOle
|| bHideChart
|| bHideDraw
)
97 if(OBJ_OLE2
== rObject
.GetObjIdentifier())
99 if(((SdrOle2Obj
&)rObject
).IsChart())
116 else if(OBJ_GRAF
== rObject
.GetObjIdentifier())
118 // graphic handled like OLE
126 // any other draw object
137 } // end of namespace contact
138 } // end of namespace sdr
140 //////////////////////////////////////////////////////////////////////////////