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: protarea.cxx,v $
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 ************************************************************************/
32 #include "protarea.hxx"
35 // NOT FULLY DEFINED SERVICES
40 ProtectionArea::Index( ary::cpp::E_ClassKey i_eClassKey
) const
42 return i_eClassKey
== ary::cpp::CK_class
44 : i_eClassKey
== ary::cpp::CK_struct
51 ProtectionArea::ProtectionArea( const char * i_sLabel
,
52 const char * i_sTitle
)
53 : pSglTable( new S_Slot_Table(i_sTitle
) ),
59 ProtectionArea::~ProtectionArea()
65 ProtectionArea::GetTable()
67 csv_assert(pSglTable
);
69 return pSglTable
->GetTable();
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();
94 ProtectionArea::Label() const
101 ProtectionArea::WasUsed_Area() const
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 **********************//
121 S_Slot_Table::S_Slot_Table(const char * i_sTitle
)
122 : sTableTitle(i_sTitle
)
127 S_Slot_Table::~S_Slot_Table()
133 S_Slot_Table::GetTable()
137 : *( pTable
= &Create_ChildListTable(sTableTitle
) );