Update ooo320-m1
[ooovba.git] / writerfilter / source / doctok / WW8Table.cxx
blob5c320ce6e25628e46b046326580464b78a372b7b
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: WW8Table.cxx,v $
10 * $Revision: 1.4 $
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 <resources.hxx>
33 namespace writerfilter {
34 namespace doctok {
36 /* WW8sprmTDefTable */
38 sal_uInt32 WW8sprmTDefTable::get_cellx_count()
40 return getU8(0x4) + 1;
43 sal_uInt16 WW8sprmTDefTable::get_cellx(sal_uInt32 nIndex)
45 return getU16(0x5 + nIndex * 2);
48 sal_uInt32 WW8sprmTDefTable::get_tc_count()
50 return get_cellx_count() - 1;
53 writerfilter::Reference<Properties>::Pointer_t
54 WW8sprmTDefTable::get_tc(sal_uInt32 pos)
56 return writerfilter::Reference<Properties>::Pointer_t
57 (new WW8TC(this,
58 0x5 + get_cellx_count() * 2 + pos * WW8TC::getSize()));
61 /* WW8sprmTTableBorders */
63 sal_uInt32 WW8sprmTTableBorders::get_rgbbrc_count()
65 return 6;
68 writerfilter::Reference<Properties>::Pointer_t
69 WW8sprmTTableBorders::get_rgbbrc(sal_uInt32 pos)
71 return writerfilter::Reference<Properties>::Pointer_t
72 (new WW8BRC(*this, 0x3 + pos * WW8BRC::getSize()));
75 /* WW8sprmTCellBottomColor */
77 sal_uInt32 WW8sprmTCellBottomColor::calcSize()
79 return get_cellBottomColor_count() * 4 + 3;
82 sal_uInt32 WW8sprmTCellBottomColor::get_cellBottomColor_count()
84 return getU8(0x2) / 4;
87 sal_uInt32 WW8sprmTCellBottomColor::get_cellBottomColor(sal_uInt32 pos)
89 return getU32(0x3 + 4 * pos);
92 /* WW8sprmTCellLeftColor */
94 sal_uInt32 WW8sprmTCellLeftColor::calcSize()
96 return get_cellLeftColor_count() * 4 + 3;
99 sal_uInt32 WW8sprmTCellLeftColor::get_cellLeftColor_count()
101 return getU8(0x2) / 4;
104 sal_uInt32 WW8sprmTCellLeftColor::get_cellLeftColor(sal_uInt32 pos)
106 return getU32(0x3 + 4 * pos);
109 /* WW8sprmTCellTopColor */
111 sal_uInt32 WW8sprmTCellTopColor::calcSize()
113 return get_cellTopColor_count() * 4 + 3;
116 sal_uInt32 WW8sprmTCellTopColor::get_cellTopColor_count()
118 return getU8(0x2) / 4;
121 sal_uInt32 WW8sprmTCellTopColor::get_cellTopColor(sal_uInt32 pos)
123 return getU32(0x3 + 4 * pos);
126 /* WW8sprmTCellRightColor */
128 sal_uInt32 WW8sprmTCellRightColor::calcSize()
130 return get_cellRightColor_count() * 4 + 3;
133 sal_uInt32 WW8sprmTCellRightColor::get_cellRightColor_count()
135 return getU8(0x2) / 4;
138 sal_uInt32 WW8sprmTCellRightColor::get_cellRightColor(sal_uInt32 pos)
140 return getU32(0x3 + 4 * pos);
143 /* WW8sprmTGridLineProps */
145 sal_uInt32 WW8sprmTGridLineProps::calcSize()
147 return getSize();
150 /* WW8sprmTDefTableShd */
152 sal_uInt32 WW8sprmTDefTableShd::calcSize()
154 return get_shd_count() * WW8SHD::getSize() + 3;
157 sal_uInt32 WW8sprmTDefTableShd::get_shd_count()
159 return getU8(0x2) / WW8SHD::getSize();
162 writerfilter::Reference<Properties>::Pointer_t
163 WW8sprmTDefTableShd::get_shd(sal_uInt32 pos)
165 return writerfilter::Reference<Properties>::Pointer_t
166 (new WW8SHD(*this, 0x3 + pos * WW8SHD::getSize()));
169 /* WW8sprmTCellShd */
171 sal_uInt32 WW8sprmTCellShd::calcSize()
173 return get_shd_count() * WW8CellShd::getSize();
176 sal_uInt32 WW8sprmTCellShd::get_shd_count()
178 return getU8(0x2) / WW8CellShd::getSize();
181 writerfilter::Reference<Properties>::Pointer_t
182 WW8sprmTCellShd::get_shd(sal_uInt32 pos)
184 return writerfilter::Reference<Properties>::Pointer_t
185 (new WW8CellShd(*this, 0x3 + pos * WW8CellShd::getSize()));
188 /* WW8sprmTCellShadow */
190 sal_uInt32 WW8sprmTCellShadow::calcSize()
192 return get_cellShadow_count() * WW8CellShd::getSize();
195 sal_uInt32 WW8sprmTCellShadow::get_cellShadow_count()
197 return getU8(0x2) / WW8CellShd::getSize();
200 writerfilter::Reference<Properties>::Pointer_t
201 WW8sprmTCellShadow::get_cellShadow(sal_uInt32 pos)
203 return writerfilter::Reference<Properties>::Pointer_t
204 (new WW8CellShd(*this, 0x3 + pos * WW8CellShd::getSize()));