Update ooo320-m1
[ooovba.git] / autodoc / source / display / html / protarea.cxx
blob9734b164f5a449599d669c6ec2763d5107ccd696
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: protarea.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include "protarea.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include "hdimpl.hxx"
39 inline UINT8
40 ProtectionArea::Index( ary::cpp::E_ClassKey i_eClassKey ) const
42 return i_eClassKey == ary::cpp::CK_class
43 ? 0
44 : i_eClassKey == ary::cpp::CK_struct
45 ? 1
46 : 2;
51 ProtectionArea::ProtectionArea( const char * i_sLabel,
52 const char * i_sTitle )
53 : pSglTable( new S_Slot_Table(i_sTitle) ),
54 aClassesTables(),
55 sLabel(i_sLabel)
59 ProtectionArea::~ProtectionArea()
64 csi::html::Table &
65 ProtectionArea::GetTable()
67 csv_assert(pSglTable);
69 return pSglTable->GetTable();
72 csi::html::Table &
73 ProtectionArea::GetTable( ary::cpp::E_ClassKey i_eClassKey )
75 csv_assert(aClassesTables[Index(i_eClassKey)]);
76 return aClassesTables[Index(i_eClassKey)]->GetTable();
79 DYN csi::html::Table *
80 ProtectionArea::ReleaseTable()
82 csv_assert(pSglTable);
83 return pSglTable->ReleaseTable();
86 DYN csi::html::Table *
87 ProtectionArea::ReleaseTable( ary::cpp::E_ClassKey i_eClassKey )
89 csv_assert(aClassesTables[Index(i_eClassKey)]);
90 return aClassesTables[Index(i_eClassKey)]->ReleaseTable();
93 const char *
94 ProtectionArea::Label() const
96 return sLabel;
100 bool
101 ProtectionArea::WasUsed_Area() const
103 if ( pSglTable )
105 return pSglTable->WasUsed();
108 typedef const Dyn<ProtectionArea::S_Slot_Table> cdyntab;
110 // Workaround a maybe compiler bug in Solaris5-CC ?
111 // should normally work without the cast,
112 // because that is exactly the genuine type, given:
113 return static_cast< cdyntab& >(aClassesTables[0])->WasUsed()
114 OR static_cast< cdyntab& >(aClassesTables[1])->WasUsed()
115 OR static_cast< cdyntab& >(aClassesTables[2])->WasUsed();
118 //******************* S_Slot_Table **********************//
120 ProtectionArea::
121 S_Slot_Table::S_Slot_Table(const char * i_sTitle)
122 : sTableTitle(i_sTitle)
126 ProtectionArea::
127 S_Slot_Table::~S_Slot_Table()
131 csi::html::Table &
132 ProtectionArea::
133 S_Slot_Table::GetTable()
135 return pTable
136 ? *pTable
137 : *( pTable = &Create_ChildListTable(sTableTitle) );