xref: /trunk/main/sw/source/filter/html/htmltabw.cxx (revision efeef26f)
1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*efeef26fSAndrew Rist  * distributed with this work for additional information
6*efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*efeef26fSAndrew Rist  *
11*efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*efeef26fSAndrew Rist  *
13*efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*efeef26fSAndrew Rist  * specific language governing permissions and limitations
18*efeef26fSAndrew Rist  * under the License.
19*efeef26fSAndrew Rist  *
20*efeef26fSAndrew Rist  *************************************************************/
21*efeef26fSAndrew Rist 
22*efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <hintids.hxx>
29cdf0e10cSrcweir #include <vcl/svapp.hxx>
30cdf0e10cSrcweir #include <svtools/htmlout.hxx>
31cdf0e10cSrcweir #include <svtools/htmltokn.h>
32cdf0e10cSrcweir #include <svtools/htmlkywd.hxx>
33cdf0e10cSrcweir #ifndef _WRKWIN_HXX //autogen
34cdf0e10cSrcweir #include <vcl/wrkwin.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <editeng/ulspitem.hxx>
37cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
38cdf0e10cSrcweir #include <editeng/brshitem.hxx>
39cdf0e10cSrcweir #include <editeng/boxitem.hxx>
40cdf0e10cSrcweir #include <com/sun/star/form/XFormsSupplier.hpp>
41cdf0e10cSrcweir #include <com/sun/star/form/XForm.hpp>
42cdf0e10cSrcweir #include <com/sun/star/form/XImageProducerSupplier.hpp>
43cdf0e10cSrcweir #include <com/sun/star/form/XFormController.hpp>
44cdf0e10cSrcweir #include <com/sun/star/container/XContainer.hpp>
45cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp>
46cdf0e10cSrcweir #include <com/sun/star/container/XSet.hpp>
47cdf0e10cSrcweir #include <fmtornt.hxx>
48cdf0e10cSrcweir #include <frmfmt.hxx>
49cdf0e10cSrcweir #include <fmtfsize.hxx>
50cdf0e10cSrcweir #include <fmtsrnd.hxx>
51cdf0e10cSrcweir #include <frmatr.hxx>
52cdf0e10cSrcweir #include <doc.hxx>
53cdf0e10cSrcweir #include <pam.hxx>
54cdf0e10cSrcweir #include <ndtxt.hxx>
55cdf0e10cSrcweir #include <swrect.hxx>
56cdf0e10cSrcweir #include <cellatr.hxx>
57cdf0e10cSrcweir #include <poolfmt.hxx>
58cdf0e10cSrcweir #include <swtable.hxx>
59cdf0e10cSrcweir #include <htmltbl.hxx>
60cdf0e10cSrcweir #include <htmlnum.hxx>
61cdf0e10cSrcweir #include <wrthtml.hxx>
62cdf0e10cSrcweir #include <wrtswtbl.hxx>
63cdf0e10cSrcweir #ifdef DBG_UTIL
64cdf0e10cSrcweir #ifndef _VIEWSH_HXX
65cdf0e10cSrcweir #include <viewsh.hxx>
66cdf0e10cSrcweir #endif
67cdf0e10cSrcweir #include <viewopt.hxx>
68cdf0e10cSrcweir #endif
69cdf0e10cSrcweir #include <sal/types.h>
70cdf0e10cSrcweir 
71cdf0e10cSrcweir //#define MAX_DEPTH (USHRT_MAX)
72cdf0e10cSrcweir #define MAX_DEPTH (3)
73cdf0e10cSrcweir 
74cdf0e10cSrcweir using namespace ::com::sun::star;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 
77cdf0e10cSrcweir class SwHTMLWrtTable : public SwWriteTable
78cdf0e10cSrcweir {
79cdf0e10cSrcweir 	void Pixelize( sal_uInt16& rValue );
80cdf0e10cSrcweir 	void PixelizeBorders();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void OutTableCell( SwHTMLWriter& rWrt, const SwWriteTableCell *pCell,
83cdf0e10cSrcweir 					   sal_Bool bOutVAlign ) const;
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	void OutTableCells( SwHTMLWriter& rWrt,
86cdf0e10cSrcweir 						const SwWriteTableCells& rCells,
87cdf0e10cSrcweir 						const SvxBrushItem *pBrushItem ) const;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	virtual sal_Bool ShouldExpandSub( const SwTableBox *pBox,
90cdf0e10cSrcweir 							sal_Bool bExpandedBefore, sal_uInt16 nDepth ) const;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	static sal_Bool HasTabBackground( const SwTableLine& rLine,
93cdf0e10cSrcweir 						sal_Bool bTop, sal_Bool bBottom, sal_Bool bLeft, sal_Bool bRight );
94cdf0e10cSrcweir 	static sal_Bool HasTabBackground( const SwTableBox& rBox,
95cdf0e10cSrcweir 						sal_Bool bTop, sal_Bool bBottom, sal_Bool bLeft, sal_Bool bRight );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir public:
98cdf0e10cSrcweir     SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth,
99cdf0e10cSrcweir                     sal_Bool bRel, sal_uInt16 nNumOfRowsToRepeat,
100cdf0e10cSrcweir 					sal_uInt16 nLeftSub=0, sal_uInt16 nRightSub=0 );
101cdf0e10cSrcweir 	SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     void Write( SwHTMLWriter& rWrt, sal_Int16 eAlign=text::HoriOrientation::NONE,
104cdf0e10cSrcweir 				sal_Bool bTHead=sal_False, const SwFrmFmt *pFrmFmt=0,
105cdf0e10cSrcweir                 const String *pCaption=0, sal_Bool bTopCaption=sal_False,
106cdf0e10cSrcweir 				sal_uInt16 nHSpace=0, sal_uInt16 nVSpace=0 ) const;
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 
SwHTMLWrtTable(const SwTableLines & rLines,long nWidth,sal_uInt32 nBWidth,sal_Bool bRel,sal_uInt16 nNumOfRowsToRepeat,sal_uInt16 nLSub,sal_uInt16 nRSub)110cdf0e10cSrcweir SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth,
111cdf0e10cSrcweir                                 sal_uInt32 nBWidth, sal_Bool bRel, sal_uInt16 nNumOfRowsToRepeat,
112cdf0e10cSrcweir 								sal_uInt16 nLSub, sal_uInt16 nRSub )
113cdf0e10cSrcweir 	: SwWriteTable( rLines, nWidth, nBWidth, bRel, MAX_DEPTH, nLSub, nRSub, nNumOfRowsToRepeat )
114cdf0e10cSrcweir {
115cdf0e10cSrcweir 	PixelizeBorders();
116cdf0e10cSrcweir }
117cdf0e10cSrcweir 
SwHTMLWrtTable(const SwHTMLTableLayout * pLayoutInfo)118cdf0e10cSrcweir SwHTMLWrtTable::SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo )
119cdf0e10cSrcweir 	: SwWriteTable( pLayoutInfo )
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	// Einige Twip-Werte an Pixel-Grenzen anpassen
122cdf0e10cSrcweir 	if( bCollectBorderWidth )
123cdf0e10cSrcweir 		PixelizeBorders();
124cdf0e10cSrcweir }
125cdf0e10cSrcweir 
Pixelize(sal_uInt16 & rValue)126cdf0e10cSrcweir void SwHTMLWrtTable::Pixelize( sal_uInt16& rValue )
127cdf0e10cSrcweir {
128cdf0e10cSrcweir 	if( rValue && Application::GetDefaultDevice() )
129cdf0e10cSrcweir 	{
130cdf0e10cSrcweir 		Size aSz( rValue, 0 );
131cdf0e10cSrcweir 		aSz = Application::GetDefaultDevice()->LogicToPixel( aSz, MapMode(MAP_TWIP) );
132cdf0e10cSrcweir 		if( !aSz.Width() )
133cdf0e10cSrcweir 			aSz.Width() = 1;
134cdf0e10cSrcweir 		aSz = Application::GetDefaultDevice()->PixelToLogic( aSz, MapMode(MAP_TWIP) );
135cdf0e10cSrcweir 		rValue = (sal_uInt16)aSz.Width();
136cdf0e10cSrcweir 	}
137cdf0e10cSrcweir }
138cdf0e10cSrcweir 
PixelizeBorders()139cdf0e10cSrcweir void SwHTMLWrtTable::PixelizeBorders()
140cdf0e10cSrcweir {
141cdf0e10cSrcweir 	Pixelize( nBorder );
142cdf0e10cSrcweir 	Pixelize( nCellSpacing );
143cdf0e10cSrcweir 	Pixelize( nCellPadding );
144cdf0e10cSrcweir }
145cdf0e10cSrcweir 
HasTabBackground(const SwTableBox & rBox,sal_Bool bTop,sal_Bool bBottom,sal_Bool bLeft,sal_Bool bRight)146cdf0e10cSrcweir sal_Bool SwHTMLWrtTable::HasTabBackground( const SwTableBox& rBox,
147cdf0e10cSrcweir 						sal_Bool bTop, sal_Bool bBottom, sal_Bool bLeft, sal_Bool bRight )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir 	ASSERT( bTop || bBottom || bLeft || bRight,
150cdf0e10cSrcweir 			"HasTabBackground: darf nicht aufgerufen werden" );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
153cdf0e10cSrcweir 	if( rBox.GetSttNd() )
154cdf0e10cSrcweir 	{
155cdf0e10cSrcweir 		const SvxBrushItem& rBrushItem =
156cdf0e10cSrcweir 			rBox.GetFrmFmt()->GetBackground();
157cdf0e10cSrcweir 
158cdf0e10cSrcweir         /// OD 02.09.2002 #99657#
159cdf0e10cSrcweir         /// The table box has a background, if its background color is not "no fill"/
160cdf0e10cSrcweir         /// "auto fill" or it has a background graphic.
161cdf0e10cSrcweir         bRet = rBrushItem.GetColor() != COL_TRANSPARENT ||
162cdf0e10cSrcweir 			   rBrushItem.GetGraphicLink() || rBrushItem.GetGraphic();
163cdf0e10cSrcweir 	}
164cdf0e10cSrcweir 	else
165cdf0e10cSrcweir 	{
166cdf0e10cSrcweir 		const SwTableLines& rLines = rBox.GetTabLines();
167cdf0e10cSrcweir 		sal_uInt16 nCount = rLines.Count();
168cdf0e10cSrcweir 		sal_Bool bLeftRight = bLeft || bRight;
169cdf0e10cSrcweir 		for( sal_uInt16 i=0; !bRet && i<nCount; i++ )
170cdf0e10cSrcweir 		{
171cdf0e10cSrcweir 			sal_Bool bT = bTop && 0 == i;
172cdf0e10cSrcweir 			sal_Bool bB = bBottom && nCount-1 == i;
173cdf0e10cSrcweir 			if( bT || bB || bLeftRight )
174cdf0e10cSrcweir 				bRet = HasTabBackground( *rLines[i], bT, bB, bLeft, bRight);
175cdf0e10cSrcweir 		}
176cdf0e10cSrcweir 	}
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	return bRet;
179cdf0e10cSrcweir }
180cdf0e10cSrcweir 
HasTabBackground(const SwTableLine & rLine,sal_Bool bTop,sal_Bool bBottom,sal_Bool bLeft,sal_Bool bRight)181cdf0e10cSrcweir sal_Bool SwHTMLWrtTable::HasTabBackground( const SwTableLine& rLine,
182cdf0e10cSrcweir 						sal_Bool bTop, sal_Bool bBottom, sal_Bool bLeft, sal_Bool bRight )
183cdf0e10cSrcweir {
184cdf0e10cSrcweir 	ASSERT( bTop || bBottom || bLeft || bRight,
185cdf0e10cSrcweir 			"HasTabBackground: darf nicht aufgerufen werden" );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
188cdf0e10cSrcweir 	const SvxBrushItem& rBrushItem = rLine.GetFrmFmt()->GetBackground();
189cdf0e10cSrcweir     /// OD 02.09.2002 #99657#
190cdf0e10cSrcweir     /// The table line has a background, if its background color is not "no fill"/
191cdf0e10cSrcweir     /// "auto fill" or it has a background graphic.
192cdf0e10cSrcweir     bRet = rBrushItem.GetColor() != COL_TRANSPARENT ||
193cdf0e10cSrcweir 		   rBrushItem.GetGraphicLink() || rBrushItem.GetGraphic();
194cdf0e10cSrcweir 
195cdf0e10cSrcweir 	if( !bRet )
196cdf0e10cSrcweir 	{
197cdf0e10cSrcweir 		const SwTableBoxes& rBoxes = rLine.GetTabBoxes();
198cdf0e10cSrcweir 		sal_uInt16 nCount = rBoxes.Count();
199cdf0e10cSrcweir 		sal_Bool bTopBottom = bTop || bBottom;
200cdf0e10cSrcweir 		for( sal_uInt16 i=0; !bRet && i<nCount; i++ )
201cdf0e10cSrcweir 		{
202cdf0e10cSrcweir 			sal_Bool bL = bLeft && 0 == i;
203cdf0e10cSrcweir 			sal_Bool bR = bRight && nCount-1 == i;
204cdf0e10cSrcweir 			if( bTopBottom || bL || bR )
205cdf0e10cSrcweir 				bRet = HasTabBackground( *rBoxes[i], bTop, bBottom, bL, bR );
206cdf0e10cSrcweir 		}
207cdf0e10cSrcweir 	}
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 	return bRet;
210cdf0e10cSrcweir }
211cdf0e10cSrcweir 
212cdf0e10cSrcweir sal_Bool lcl_WrtHTMLTbl_HasTabBorders( const SwTableLine*& rpLine, void* pPara );
213cdf0e10cSrcweir 
lcl_WrtHTMLTbl_HasTabBorders(const SwTableBox * & rpBox,void * pPara)214cdf0e10cSrcweir sal_Bool lcl_WrtHTMLTbl_HasTabBorders( const SwTableBox*& rpBox, void* pPara )
215cdf0e10cSrcweir {
216cdf0e10cSrcweir 	sal_Bool *pBorders = (sal_Bool *)pPara;
217cdf0e10cSrcweir 	if( *pBorders )
218cdf0e10cSrcweir 		return sal_False;
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 	if( !rpBox->GetSttNd() )
221cdf0e10cSrcweir 	{
222cdf0e10cSrcweir 		((SwTableBox *)rpBox)->GetTabLines().ForEach(
223cdf0e10cSrcweir 								&lcl_WrtHTMLTbl_HasTabBorders, pPara );
224cdf0e10cSrcweir 	}
225cdf0e10cSrcweir 	else
226cdf0e10cSrcweir 	{
227cdf0e10cSrcweir 		const SvxBoxItem& rBoxItem =
228cdf0e10cSrcweir             (const SvxBoxItem&)rpBox->GetFrmFmt()->GetFmtAttr( RES_BOX );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 		*pBorders = rBoxItem.GetTop() || rBoxItem.GetBottom() ||
231cdf0e10cSrcweir 					rBoxItem.GetLeft() || rBoxItem.GetRight();
232cdf0e10cSrcweir 	}
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	return !*pBorders;
235cdf0e10cSrcweir }
236cdf0e10cSrcweir 
lcl_WrtHTMLTbl_HasTabBorders(const SwTableLine * & rpLine,void * pPara)237cdf0e10cSrcweir sal_Bool lcl_WrtHTMLTbl_HasTabBorders( const SwTableLine*& rpLine, void* pPara )
238cdf0e10cSrcweir {
239cdf0e10cSrcweir 	sal_Bool *pBorders = (sal_Bool *)pPara;
240cdf0e10cSrcweir 	if( *pBorders )
241cdf0e10cSrcweir 		return sal_False;
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	((SwTableLine *)rpLine)->GetTabBoxes().ForEach(
244cdf0e10cSrcweir 									&lcl_WrtHTMLTbl_HasTabBorders, pPara );
245cdf0e10cSrcweir 	return !*pBorders;
246cdf0e10cSrcweir }
247cdf0e10cSrcweir 
248cdf0e10cSrcweir 
ShouldExpandSub(const SwTableBox * pBox,sal_Bool bExpandedBefore,sal_uInt16 nDepth) const249cdf0e10cSrcweir sal_Bool SwHTMLWrtTable::ShouldExpandSub( const SwTableBox *pBox,
250cdf0e10cSrcweir 									  sal_Bool bExpandedBefore,
251cdf0e10cSrcweir 									  sal_uInt16 nDepth ) const
252cdf0e10cSrcweir {
253cdf0e10cSrcweir 	sal_Bool bExpand = !pBox->GetSttNd() && nDepth>0;
254cdf0e10cSrcweir 	if( bExpand && bExpandedBefore )
255cdf0e10cSrcweir 	{
256cdf0e10cSrcweir 		// MIB 30.6.97: Wenn schon eine Box expandiert wurde, wird eine
257cdf0e10cSrcweir 		// weitere nur expandiert, wenn sie Umrandungen besitzt.
258cdf0e10cSrcweir 		sal_Bool bBorders = sal_False;
259cdf0e10cSrcweir 		lcl_WrtHTMLTbl_HasTabBorders( pBox, &bBorders );
260cdf0e10cSrcweir 		if( !bBorders )
261cdf0e10cSrcweir 			bBorders = HasTabBackground( *pBox, sal_True, sal_True, sal_True, sal_True );
262cdf0e10cSrcweir 		bExpand = bBorders;
263cdf0e10cSrcweir 	}
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	return bExpand;
266cdf0e10cSrcweir }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 
269cdf0e10cSrcweir // Eine Box als einzelne Zelle schreiben
OutTableCell(SwHTMLWriter & rWrt,const SwWriteTableCell * pCell,sal_Bool bOutVAlign) const270cdf0e10cSrcweir void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
271cdf0e10cSrcweir 								   const SwWriteTableCell *pCell,
272cdf0e10cSrcweir 								   sal_Bool bOutVAlign ) const
273cdf0e10cSrcweir {
274cdf0e10cSrcweir 	const SwTableBox *pBox = pCell->GetBox();
275cdf0e10cSrcweir 	sal_uInt16 nRow = pCell->GetRow();
276cdf0e10cSrcweir 	sal_uInt16 nCol = pCell->GetCol();
277cdf0e10cSrcweir 	sal_uInt16 nRowSpan = pCell->GetRowSpan();
278cdf0e10cSrcweir 	sal_uInt16 nColSpan = pCell->GetColSpan();
279cdf0e10cSrcweir 
280cdf0e10cSrcweir     if ( !nRowSpan )
281cdf0e10cSrcweir         return;
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	SwWriteTableCol *pCol = aCols[nCol];
284cdf0e10cSrcweir 
285cdf0e10cSrcweir //	sal_Bool bOutWidth = nColSpan>1 || pCol->GetOutWidth();
286cdf0e10cSrcweir 	sal_Bool bOutWidth = sal_True; //nColSpan==1 && pCol->GetOutWidth();
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 	const SwStartNode* pSttNd = pBox->GetSttNd();
289cdf0e10cSrcweir 	sal_Bool bHead = sal_False;
290cdf0e10cSrcweir 	if( pSttNd )
291cdf0e10cSrcweir 	{
292cdf0e10cSrcweir 		sal_uLong nNdPos = pSttNd->GetIndex()+1;
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 		// Art der Zelle (TD/TH) bestimmen
295cdf0e10cSrcweir 		SwNode* pNd;
296cdf0e10cSrcweir 		while( !( pNd = rWrt.pDoc->GetNodes()[nNdPos])->IsEndNode() )
297cdf0e10cSrcweir 		{
298cdf0e10cSrcweir 			if( pNd->IsTxtNode() )
299cdf0e10cSrcweir 			{
300cdf0e10cSrcweir 				// nur Absaetzte betrachten, an denen man was erkennt
301cdf0e10cSrcweir 				// Das ist der Fall, wenn die Vorlage eine der Tabellen-Vorlagen
302cdf0e10cSrcweir 				// ist oder von einer der beiden abgelitten ist.
303cdf0e10cSrcweir 				const SwFmt *pFmt = &((SwTxtNode*)pNd)->GetAnyFmtColl();
304cdf0e10cSrcweir 				sal_uInt16 nPoolId = pFmt->GetPoolFmtId();
305cdf0e10cSrcweir 				while( !pFmt->IsDefault() &&
306cdf0e10cSrcweir 					   RES_POOLCOLL_TABLE_HDLN!=nPoolId &&
307cdf0e10cSrcweir 					   RES_POOLCOLL_TABLE!=nPoolId )
308cdf0e10cSrcweir 				{
309cdf0e10cSrcweir 					pFmt = pFmt->DerivedFrom();
310cdf0e10cSrcweir 					nPoolId = pFmt->GetPoolFmtId();
311cdf0e10cSrcweir 				}
312cdf0e10cSrcweir 
313cdf0e10cSrcweir 				if( !pFmt->IsDefault() )
314cdf0e10cSrcweir 				{
315cdf0e10cSrcweir 					bHead = (RES_POOLCOLL_TABLE_HDLN==nPoolId);
316cdf0e10cSrcweir 					break;
317cdf0e10cSrcweir 				}
318cdf0e10cSrcweir 			}
319cdf0e10cSrcweir 			nNdPos++;
320cdf0e10cSrcweir 		}
321cdf0e10cSrcweir 	}
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 	rWrt.OutNewLine();	// <TH>/<TD> in neue Zeile
324cdf0e10cSrcweir 	ByteString sOut( '<' );
325cdf0e10cSrcweir 	sOut += (bHead ? OOO_STRING_SVTOOLS_HTML_tableheader : OOO_STRING_SVTOOLS_HTML_tabledata );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 	// ROW- und COLSPAN ausgeben
328cdf0e10cSrcweir 	if( nRowSpan>1 )
329cdf0e10cSrcweir 		(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_rowspan ) += '=')
330cdf0e10cSrcweir 			+= ByteString::CreateFromInt32( nRowSpan );
331cdf0e10cSrcweir 	if( nColSpan > 1 )
332cdf0e10cSrcweir 		(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_colspan ) += '=')
333cdf0e10cSrcweir 			+= ByteString::CreateFromInt32( nColSpan );
334cdf0e10cSrcweir 
335cdf0e10cSrcweir #ifndef PURE_HTML
336cdf0e10cSrcweir 	long nWidth = 0;
337cdf0e10cSrcweir     sal_uInt32 nPrcWidth = USHRT_MAX;
338cdf0e10cSrcweir 	if( bOutWidth )
339cdf0e10cSrcweir 	{
340cdf0e10cSrcweir 		if( bLayoutExport )
341cdf0e10cSrcweir 		{
342cdf0e10cSrcweir 			if( pCell->HasPrcWidthOpt() )
343cdf0e10cSrcweir 			{
344cdf0e10cSrcweir 				nPrcWidth = pCell->GetWidthOpt();
345cdf0e10cSrcweir 			}
346cdf0e10cSrcweir 			else
347cdf0e10cSrcweir 			{
348cdf0e10cSrcweir 				nWidth = pCell->GetWidthOpt();
349cdf0e10cSrcweir 				if( !nWidth )
350cdf0e10cSrcweir 					bOutWidth = sal_False;
351cdf0e10cSrcweir 			}
352cdf0e10cSrcweir 		}
353cdf0e10cSrcweir 		else
354cdf0e10cSrcweir 		{
355cdf0e10cSrcweir 			if( HasRelWidths() )
356cdf0e10cSrcweir 				nPrcWidth = (sal_uInt16)GetPrcWidth(nCol,nColSpan);
357cdf0e10cSrcweir 			else
358cdf0e10cSrcweir 				nWidth = GetAbsWidth( nCol, nColSpan );
359cdf0e10cSrcweir 		}
360cdf0e10cSrcweir 	}
361cdf0e10cSrcweir 
362cdf0e10cSrcweir 	long nHeight = pCell->GetHeight() > 0
363cdf0e10cSrcweir 						? GetAbsHeight( pCell->GetHeight(), nRow, nRowSpan )
364cdf0e10cSrcweir 						: 0;
365cdf0e10cSrcweir 	Size aPixelSz( nWidth, nHeight );
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 	// WIDTH ausgeben (Grrr: nur fuer Netscape)
368cdf0e10cSrcweir 	if( (aPixelSz.Width() || aPixelSz.Height()) && Application::GetDefaultDevice() )
369cdf0e10cSrcweir 	{
370cdf0e10cSrcweir 		Size aOldSz( aPixelSz );
371cdf0e10cSrcweir 		aPixelSz = Application::GetDefaultDevice()->LogicToPixel( aPixelSz,
372cdf0e10cSrcweir 														MapMode(MAP_TWIP) );
373cdf0e10cSrcweir 		if( aOldSz.Width() && !aPixelSz.Width() )
374cdf0e10cSrcweir 			aPixelSz.Width() = 1;
375cdf0e10cSrcweir 		if( aOldSz.Height() && !aPixelSz.Height() )
376cdf0e10cSrcweir 			aPixelSz.Height() = 1;
377cdf0e10cSrcweir 	}
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 	// WIDTH ausgeben: Aus Layout oder berechnet
380cdf0e10cSrcweir 	if( bOutWidth )
381cdf0e10cSrcweir 	{
382cdf0e10cSrcweir 		((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_width ) += '=';
383cdf0e10cSrcweir 		if( nPrcWidth != USHRT_MAX )
384cdf0e10cSrcweir 			(sOut += ByteString::CreateFromInt32(nPrcWidth)) += '%';
385cdf0e10cSrcweir 		else
386cdf0e10cSrcweir 			sOut += ByteString::CreateFromInt32(aPixelSz.Width());
387cdf0e10cSrcweir 		if( !bLayoutExport && nColSpan==1 )
388cdf0e10cSrcweir 			pCol->SetOutWidth( sal_False );
389cdf0e10cSrcweir 	}
390cdf0e10cSrcweir 
391cdf0e10cSrcweir 	if( nHeight )
392cdf0e10cSrcweir 	{
393cdf0e10cSrcweir 		(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_height) += '=')
394cdf0e10cSrcweir 			+= ByteString::CreateFromInt32(aPixelSz.Height());
395cdf0e10cSrcweir 	}
396cdf0e10cSrcweir #endif
397cdf0e10cSrcweir 
398cdf0e10cSrcweir 	const SfxItemSet& rItemSet = pBox->GetFrmFmt()->GetAttrSet();
399cdf0e10cSrcweir 	const SfxPoolItem *pItem;
400cdf0e10cSrcweir 
401cdf0e10cSrcweir 	// ALIGN wird jetzt nur noch an den Absaetzen ausgegeben
402cdf0e10cSrcweir 
403cdf0e10cSrcweir 	// VALIGN ausgeben
404cdf0e10cSrcweir 	if( bOutVAlign )
405cdf0e10cSrcweir 	{
406cdf0e10cSrcweir         sal_Int16 eVertOri = pCell->GetVertOri();
407cdf0e10cSrcweir         if( text::VertOrientation::TOP==eVertOri || text::VertOrientation::BOTTOM==eVertOri )
408cdf0e10cSrcweir 		{
409cdf0e10cSrcweir 			(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_valign) += '=')
410cdf0e10cSrcweir                 += (text::VertOrientation::TOP==eVertOri ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom);
411cdf0e10cSrcweir 		}
412cdf0e10cSrcweir 	}
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	rWrt.Strm() << sOut.GetBuffer();
415cdf0e10cSrcweir 	sOut.Erase();
416cdf0e10cSrcweir 
417cdf0e10cSrcweir 	rWrt.bTxtAttr = sal_False;
418cdf0e10cSrcweir 	rWrt.bOutOpts = sal_True;
419cdf0e10cSrcweir 	const SvxBrushItem *pBrushItem = 0;
420cdf0e10cSrcweir 	if( SFX_ITEM_SET==rItemSet.GetItemState( RES_BACKGROUND, sal_False, &pItem ) )
421cdf0e10cSrcweir 	{
422cdf0e10cSrcweir 		pBrushItem = (const SvxBrushItem *)pItem;
423cdf0e10cSrcweir 	}
424cdf0e10cSrcweir 	if( !pBrushItem )
425cdf0e10cSrcweir 		pBrushItem = pCell->GetBackground();
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 	if( pBrushItem )
428cdf0e10cSrcweir 	{
429cdf0e10cSrcweir 		// Hintergrund ausgeben
430cdf0e10cSrcweir 		String aDummy;
431cdf0e10cSrcweir 		rWrt.OutBackground( pBrushItem, aDummy, sal_False );
432cdf0e10cSrcweir 
433cdf0e10cSrcweir 		if( rWrt.bCfgOutStyles )
434cdf0e10cSrcweir 			OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem );
435cdf0e10cSrcweir 	}
436cdf0e10cSrcweir 
437cdf0e10cSrcweir 	sal_uInt32 nNumFmt = 0;
438cdf0e10cSrcweir 	double nValue = 0.0;
439cdf0e10cSrcweir 	sal_Bool bNumFmt = sal_False, bValue = sal_False;
440cdf0e10cSrcweir 	if( SFX_ITEM_SET==rItemSet.GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem ) )
441cdf0e10cSrcweir 	{
442cdf0e10cSrcweir 		nNumFmt = ((const SwTblBoxNumFormat *)pItem)->GetValue();
443cdf0e10cSrcweir 		bNumFmt = sal_True;
444cdf0e10cSrcweir 	}
445cdf0e10cSrcweir 	if( SFX_ITEM_SET==rItemSet.GetItemState( RES_BOXATR_VALUE, sal_False, &pItem ) )
446cdf0e10cSrcweir 	{
447cdf0e10cSrcweir 		nValue = ((const SwTblBoxValue *)pItem)->GetValue();
448cdf0e10cSrcweir 		bValue = sal_True;
449cdf0e10cSrcweir 		if( !bNumFmt )
450cdf0e10cSrcweir 			nNumFmt = pBox->GetFrmFmt()->GetTblBoxNumFmt().GetValue();
451cdf0e10cSrcweir 	}
452cdf0e10cSrcweir 
453cdf0e10cSrcweir 	if( bNumFmt || bValue )
454cdf0e10cSrcweir 		sOut = HTMLOutFuncs::CreateTableDataOptionsValNum( sOut,
455cdf0e10cSrcweir 					bValue, nValue, nNumFmt, *rWrt.pDoc->GetNumberFormatter(),
456cdf0e10cSrcweir                     rWrt.eDestEnc, &rWrt.aNonConvertableCharacters );
457cdf0e10cSrcweir 	sOut += '>';
458cdf0e10cSrcweir 	rWrt.Strm() << sOut.GetBuffer();
459cdf0e10cSrcweir 	rWrt.bLFPossible = sal_True;
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 	rWrt.IncIndentLevel();	// den Inhalt von <TD>...</TD> einruecken
462cdf0e10cSrcweir 
463cdf0e10cSrcweir 	if( pSttNd )
464cdf0e10cSrcweir 	{
465cdf0e10cSrcweir 		HTMLSaveData aSaveData( rWrt, pSttNd->GetIndex()+1,
466cdf0e10cSrcweir 								pSttNd->EndOfSectionIndex() );
467cdf0e10cSrcweir 		rWrt.Out_SwDoc( rWrt.pCurPam );
468cdf0e10cSrcweir 	}
469cdf0e10cSrcweir 	else
470cdf0e10cSrcweir 	{
471cdf0e10cSrcweir         sal_uInt16 nTWidth;
472cdf0e10cSrcweir         sal_uInt32 nBWidth;
473cdf0e10cSrcweir         sal_uInt16 nLSub, nRSub;
474cdf0e10cSrcweir 		if( HasRelWidths() )
475cdf0e10cSrcweir 		{
476cdf0e10cSrcweir 			nTWidth = 100;
477cdf0e10cSrcweir 			nBWidth = GetRawWidth( nCol, nColSpan );
478cdf0e10cSrcweir 			nLSub = 0;
479cdf0e10cSrcweir 			nRSub = 0;
480cdf0e10cSrcweir 		}
481cdf0e10cSrcweir 		else
482cdf0e10cSrcweir 		{
483cdf0e10cSrcweir 			nTWidth = GetAbsWidth( nCol, nColSpan );
484cdf0e10cSrcweir 			nBWidth = nTWidth;
485cdf0e10cSrcweir 			nLSub = GetLeftSpace( nCol );
486cdf0e10cSrcweir 			nRSub = GetRightSpace( nCol, nColSpan );
487cdf0e10cSrcweir 		}
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 		SwHTMLWrtTable aTableWrt( pBox->GetTabLines(), nTWidth,
490cdf0e10cSrcweir 								  nBWidth, HasRelWidths(), nLSub, nRSub );
491cdf0e10cSrcweir 		aTableWrt.Write( rWrt );
492cdf0e10cSrcweir 	}
493cdf0e10cSrcweir 
494cdf0e10cSrcweir 	rWrt.DecIndentLevel();	// den Inhalt von <TD>...</TD> einruecken
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 	if( rWrt.bLFPossible )
497cdf0e10cSrcweir 		rWrt.OutNewLine();
498cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), bHead ? OOO_STRING_SVTOOLS_HTML_tableheader
499cdf0e10cSrcweir 											  	   : OOO_STRING_SVTOOLS_HTML_tabledata,
500cdf0e10cSrcweir 								sal_False );
501cdf0e10cSrcweir 	rWrt.bLFPossible = sal_True;
502cdf0e10cSrcweir }
503cdf0e10cSrcweir 
504cdf0e10cSrcweir 
505cdf0e10cSrcweir // Eine Line als Zeilen ausgeben
OutTableCells(SwHTMLWriter & rWrt,const SwWriteTableCells & rCells,const SvxBrushItem * pBrushItem) const506cdf0e10cSrcweir void SwHTMLWrtTable::OutTableCells( SwHTMLWriter& rWrt,
507cdf0e10cSrcweir 								    const SwWriteTableCells& rCells,
508cdf0e10cSrcweir 									const SvxBrushItem *pBrushItem ) const
509cdf0e10cSrcweir {
510cdf0e10cSrcweir 	// Wenn die Zeile mehr als eine Zelle nethaelt und alle Zellen
511cdf0e10cSrcweir 	// die gleiche Ausrichtung besitzen, das VALIGN an der Zeile statt der
512cdf0e10cSrcweir 	// Zelle ausgeben
513cdf0e10cSrcweir     sal_Int16 eRowVertOri = text::VertOrientation::NONE;
514cdf0e10cSrcweir 	if( rCells.Count() > 1 )
515cdf0e10cSrcweir 	{
516cdf0e10cSrcweir 		for( sal_uInt16 nCell = 0; nCell<rCells.Count(); nCell++ )
517cdf0e10cSrcweir 		{
518cdf0e10cSrcweir             sal_Int16 eCellVertOri = rCells[nCell]->GetVertOri();
519cdf0e10cSrcweir 			if( 0==nCell )
520cdf0e10cSrcweir 			{
521cdf0e10cSrcweir 				eRowVertOri = eCellVertOri;
522cdf0e10cSrcweir 			}
523cdf0e10cSrcweir 			else if( eRowVertOri != eCellVertOri )
524cdf0e10cSrcweir 			{
525cdf0e10cSrcweir                 eRowVertOri = text::VertOrientation::NONE;
526cdf0e10cSrcweir 				break;
527cdf0e10cSrcweir 			}
528cdf0e10cSrcweir 		}
529cdf0e10cSrcweir 	}
530cdf0e10cSrcweir 
531cdf0e10cSrcweir 	rWrt.OutNewLine();	// <TR> in neuer Zeile
532cdf0e10cSrcweir 	rWrt.Strm() << '<' << OOO_STRING_SVTOOLS_HTML_tablerow;
533cdf0e10cSrcweir 	if( pBrushItem )
534cdf0e10cSrcweir 	{
535cdf0e10cSrcweir 		String aDummy;
536cdf0e10cSrcweir 		rWrt.OutBackground( pBrushItem, aDummy, sal_False );
537cdf0e10cSrcweir 
538cdf0e10cSrcweir 		rWrt.bTxtAttr = sal_False;
539cdf0e10cSrcweir 		rWrt.bOutOpts = sal_True;
540cdf0e10cSrcweir 		if( rWrt.bCfgOutStyles )
541cdf0e10cSrcweir 			OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem );
542cdf0e10cSrcweir 	}
543cdf0e10cSrcweir 
544cdf0e10cSrcweir     if( text::VertOrientation::TOP==eRowVertOri || text::VertOrientation::BOTTOM==eRowVertOri )
545cdf0e10cSrcweir 	{
546cdf0e10cSrcweir 		ByteString sOut( ' ' );
547cdf0e10cSrcweir 		((sOut += OOO_STRING_SVTOOLS_HTML_O_valign) += '=')
548cdf0e10cSrcweir             += (text::VertOrientation::TOP==eRowVertOri ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom);
549cdf0e10cSrcweir 		rWrt.Strm() << sOut.GetBuffer();
550cdf0e10cSrcweir 	}
551cdf0e10cSrcweir 
552cdf0e10cSrcweir 	rWrt.Strm() << '>';
553cdf0e10cSrcweir 
554cdf0e10cSrcweir 	rWrt.IncIndentLevel(); // Inhalt von <TR>...</TR> einruecken
555cdf0e10cSrcweir 
556cdf0e10cSrcweir 	for( sal_uInt16 nCell = 0; nCell<rCells.Count(); nCell++ )
557cdf0e10cSrcweir         OutTableCell( rWrt, rCells[nCell], text::VertOrientation::NONE==eRowVertOri );
558cdf0e10cSrcweir 
559cdf0e10cSrcweir 	rWrt.DecIndentLevel(); // Inhalt von <TR>...</TR> einruecken
560cdf0e10cSrcweir 
561cdf0e10cSrcweir 	rWrt.OutNewLine();	// </TR> in neuer Zeile
562cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow, sal_False );
563cdf0e10cSrcweir }
564cdf0e10cSrcweir 
565cdf0e10cSrcweir 
566cdf0e10cSrcweir 
Write(SwHTMLWriter & rWrt,sal_Int16 eAlign,sal_Bool bTHead,const SwFrmFmt * pFrmFmt,const String * pCaption,sal_Bool bTopCaption,sal_uInt16 nHSpace,sal_uInt16 nVSpace) const567cdf0e10cSrcweir void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
568cdf0e10cSrcweir 							sal_Bool bTHead, const SwFrmFmt *pFrmFmt,
569cdf0e10cSrcweir 							const String *pCaption,	sal_Bool bTopCaption,
570cdf0e10cSrcweir 							sal_uInt16 nHSpace, sal_uInt16 nVSpace ) const
571cdf0e10cSrcweir {
572cdf0e10cSrcweir 	sal_uInt16 nRow;
573cdf0e10cSrcweir 
574cdf0e10cSrcweir 	// Wert fuer FRAME bestimmen
575cdf0e10cSrcweir 	sal_uInt16 nFrameMask = 15;
576cdf0e10cSrcweir 	if( !(aRows[0])->bTopBorder )
577cdf0e10cSrcweir 		nFrameMask &= ~1;
578cdf0e10cSrcweir 	if( !(aRows[aRows.Count()-1])->bBottomBorder )
579cdf0e10cSrcweir 		nFrameMask &= ~2;
580cdf0e10cSrcweir 	if( !(aCols[0])->bLeftBorder )
581cdf0e10cSrcweir 		nFrameMask &= ~4;
582cdf0e10cSrcweir 	if( !(aCols[aCols.Count()-1])->bRightBorder )
583cdf0e10cSrcweir 		nFrameMask &= ~8;
584cdf0e10cSrcweir 
585cdf0e10cSrcweir 	// Wert fur RULES bestimmen
586cdf0e10cSrcweir 	sal_Bool bRowsHaveBorder = sal_False;
587cdf0e10cSrcweir 	sal_Bool bRowsHaveBorderOnly = sal_True;
588cdf0e10cSrcweir 	SwWriteTableRow *pRow = aRows[0];
589cdf0e10cSrcweir 	for( nRow=1; nRow < aRows.Count(); nRow++ )
590cdf0e10cSrcweir 	{
591cdf0e10cSrcweir 		SwWriteTableRow *pNextRow = aRows[nRow];
592cdf0e10cSrcweir 		sal_Bool bBorder = ( pRow->bBottomBorder || pNextRow->bTopBorder );
593cdf0e10cSrcweir 		bRowsHaveBorder |= bBorder;
594cdf0e10cSrcweir 		bRowsHaveBorderOnly &= bBorder;
595cdf0e10cSrcweir 
596cdf0e10cSrcweir 		sal_uInt16 nBorder2 = pRow->bBottomBorder ? pRow->nBottomBorder : USHRT_MAX;
597cdf0e10cSrcweir 		if( pNextRow->bTopBorder && pNextRow->nTopBorder < nBorder2 )
598cdf0e10cSrcweir 			nBorder2 = pNextRow->nTopBorder;
599cdf0e10cSrcweir 
600cdf0e10cSrcweir 		pRow->bBottomBorder = bBorder;
601cdf0e10cSrcweir 		pRow->nBottomBorder = nBorder2;
602cdf0e10cSrcweir 
603cdf0e10cSrcweir 		pNextRow->bTopBorder = bBorder;
604cdf0e10cSrcweir 		pNextRow->nTopBorder = nBorder2;
605cdf0e10cSrcweir 
606cdf0e10cSrcweir 		pRow = pNextRow;
607cdf0e10cSrcweir 	}
608cdf0e10cSrcweir 
609cdf0e10cSrcweir 	sal_Bool bColsHaveBorder = sal_False;
610cdf0e10cSrcweir 	sal_Bool bColsHaveBorderOnly = sal_True;
611cdf0e10cSrcweir 	SwWriteTableCol *pCol = aCols[0];
612cdf0e10cSrcweir 	sal_uInt16 nCol;
613cdf0e10cSrcweir 	for( nCol=1; nCol<aCols.Count(); nCol++ )
614cdf0e10cSrcweir 	{
615cdf0e10cSrcweir 		SwWriteTableCol *pNextCol = aCols[nCol];
616cdf0e10cSrcweir 		sal_Bool bBorder = ( pCol->bRightBorder || pNextCol->bLeftBorder );
617cdf0e10cSrcweir 		bColsHaveBorder |= bBorder;
618cdf0e10cSrcweir 		bColsHaveBorderOnly &= bBorder;
619cdf0e10cSrcweir 		pCol->bRightBorder = bBorder;
620cdf0e10cSrcweir 		pNextCol->bLeftBorder = bBorder;
621cdf0e10cSrcweir 		pCol = pNextCol;
622cdf0e10cSrcweir 	}
623cdf0e10cSrcweir 
624cdf0e10cSrcweir 
625cdf0e10cSrcweir 	// vorhergende Aufzaehlung etc. beenden
626cdf0e10cSrcweir 	rWrt.ChangeParaToken( 0 );
627cdf0e10cSrcweir 
628cdf0e10cSrcweir 	if( rWrt.bLFPossible )
629cdf0e10cSrcweir 		rWrt.OutNewLine();	// <TABLE> in neue Zeile
630cdf0e10cSrcweir 	ByteString sOut( '<' );
631cdf0e10cSrcweir 	sOut += OOO_STRING_SVTOOLS_HTML_table;
632cdf0e10cSrcweir 
633cdf0e10cSrcweir 	sal_uInt16 nOldDirection = rWrt.nDirection;
634cdf0e10cSrcweir 	if( pFrmFmt )
635cdf0e10cSrcweir 		rWrt.nDirection = rWrt.GetHTMLDirection( pFrmFmt->GetAttrSet() );
636cdf0e10cSrcweir 	if( rWrt.bOutFlyFrame || nOldDirection != rWrt.nDirection )
637cdf0e10cSrcweir 	{
638cdf0e10cSrcweir 		rWrt.Strm() << sOut.GetBuffer();
639cdf0e10cSrcweir 		sOut.Erase();
640cdf0e10cSrcweir 		rWrt.OutDirection( rWrt.nDirection );
641cdf0e10cSrcweir 	}
642cdf0e10cSrcweir 
643cdf0e10cSrcweir 	// COLS ausgeben: Nur bei Export ueber Layout, wenn es beim Import
644cdf0e10cSrcweir 	// vorhanden war.
645cdf0e10cSrcweir 	if( bColsOption )
646cdf0e10cSrcweir 		(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_cols) += '=')
647cdf0e10cSrcweir 			+= ByteString::CreateFromInt32( aCols.Count() );
648cdf0e10cSrcweir 
649cdf0e10cSrcweir 	// ALIGN= ausgeben
650cdf0e10cSrcweir     if( text::HoriOrientation::RIGHT == eAlign )
651cdf0e10cSrcweir 		(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_right;
652cdf0e10cSrcweir     else if( text::HoriOrientation::CENTER == eAlign )
653cdf0e10cSrcweir 		(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_center;
654cdf0e10cSrcweir     else if( text::HoriOrientation::LEFT == eAlign )
655cdf0e10cSrcweir 		(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align ) += '=') += OOO_STRING_SVTOOLS_HTML_AL_left;
656cdf0e10cSrcweir 
657cdf0e10cSrcweir 	// WIDTH ausgeben: Stammt aus Layout oder ist berechnet
658cdf0e10cSrcweir 	if( nTabWidth )
659cdf0e10cSrcweir 	{
660cdf0e10cSrcweir 		((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_width ) += '=';
661cdf0e10cSrcweir 		if( HasRelWidths() )
662cdf0e10cSrcweir 			(sOut += ByteString::CreateFromInt32( nTabWidth )) += '%';
663cdf0e10cSrcweir 		else if( Application::GetDefaultDevice() )
664cdf0e10cSrcweir 		{
665cdf0e10cSrcweir 			long nPixWidth = Application::GetDefaultDevice()->LogicToPixel(
666cdf0e10cSrcweir 						Size(nTabWidth,0), MapMode(MAP_TWIP) ).Width();
667cdf0e10cSrcweir 			if( !nPixWidth )
668cdf0e10cSrcweir 				nPixWidth = 1;
669cdf0e10cSrcweir 
670cdf0e10cSrcweir 			sOut += ByteString::CreateFromInt32( nPixWidth );
671cdf0e10cSrcweir 		}
672cdf0e10cSrcweir 		else
673cdf0e10cSrcweir 		{
674cdf0e10cSrcweir 			ASSERT( Application::GetDefaultDevice(), "kein Application-Window!?" );
675cdf0e10cSrcweir 			sOut += "100%";
676cdf0e10cSrcweir 		}
677cdf0e10cSrcweir 	}
678cdf0e10cSrcweir 
679cdf0e10cSrcweir 	if( (nHSpace || nVSpace) && Application::GetDefaultDevice())
680cdf0e10cSrcweir 	{
681cdf0e10cSrcweir 		Size aPixelSpc =
682cdf0e10cSrcweir 			Application::GetDefaultDevice()->LogicToPixel( Size(nHSpace,nVSpace),
683cdf0e10cSrcweir 												   MapMode(MAP_TWIP) );
684cdf0e10cSrcweir 		if( !aPixelSpc.Width() && nHSpace )
685cdf0e10cSrcweir 			aPixelSpc.Width() = 1;
686cdf0e10cSrcweir 		if( !aPixelSpc.Height() && nVSpace )
687cdf0e10cSrcweir 			aPixelSpc.Height() = 1;
688cdf0e10cSrcweir 
689cdf0e10cSrcweir 		if( aPixelSpc.Width() )
690cdf0e10cSrcweir 		{
691cdf0e10cSrcweir 			(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_hspace) += '=')
692cdf0e10cSrcweir 				+= ByteString::CreateFromInt32( aPixelSpc.Width() );
693cdf0e10cSrcweir 		}
694cdf0e10cSrcweir 
695cdf0e10cSrcweir 		if( aPixelSpc.Height() )
696cdf0e10cSrcweir 		{
697cdf0e10cSrcweir 			(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_vspace) += '=')
698cdf0e10cSrcweir 				+= ByteString::CreateFromInt32( aPixelSpc.Height() );
699cdf0e10cSrcweir 		}
700cdf0e10cSrcweir 	}
701cdf0e10cSrcweir 
702cdf0e10cSrcweir 	// BORDER ausgeben, aber nur wenn wir die Umrandung selbst berechnet
703cdf0e10cSrcweir 	// haben oder die Umrandung 0 ist oder es irgendwelche Umrandungen gibt.
704cdf0e10cSrcweir 	// Anderenfalls enthaelt nBorder naemlich nur die Breite der Umrandung,
705cdf0e10cSrcweir     // die genutzt wird, wenn gar kein sheet::Border angegeben ist.
706cdf0e10cSrcweir 	sal_Bool bHasAnyBorders = nFrameMask || bColsHaveBorder || bRowsHaveBorder;
707cdf0e10cSrcweir 	if( bCollectBorderWidth || nBorder==0 || bHasAnyBorders )
708cdf0e10cSrcweir 		(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_border ) += '=')
709cdf0e10cSrcweir 			+= ByteString::CreateFromInt32( rWrt.ToPixel( nBorder ) );
710cdf0e10cSrcweir 
711cdf0e10cSrcweir 	// BORDERCOLOR ausgeben
712cdf0e10cSrcweir 
713cdf0e10cSrcweir 	if( (sal_uInt32)-1 != nBorderColor && rWrt.bCfgOutStyles && bHasAnyBorders )
714cdf0e10cSrcweir 	{
715cdf0e10cSrcweir 		((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_bordercolor ) += '=';
716cdf0e10cSrcweir 		rWrt.Strm() << sOut.GetBuffer();
717cdf0e10cSrcweir 		HTMLOutFuncs::Out_Color( rWrt.Strm(), nBorderColor, rWrt.eDestEnc );
718cdf0e10cSrcweir 		sOut.Erase();
719cdf0e10cSrcweir 	}
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 	// CELLPADDING ausgeben: Stammt aus Layout oder ist berechnet
722cdf0e10cSrcweir 	(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cellpadding ) += '=')
723cdf0e10cSrcweir 		+= ByteString::CreateFromInt32( rWrt.ToPixel( nCellPadding ) );
724cdf0e10cSrcweir 
725cdf0e10cSrcweir 	// CELLSPACING ausgeben: Stammt aus Layout oder ist berechnet
726cdf0e10cSrcweir 	(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_cellspacing ) += '=')
727cdf0e10cSrcweir 		+= ByteString::CreateFromInt32( rWrt.ToPixel( nCellSpacing ) );
728cdf0e10cSrcweir 
729cdf0e10cSrcweir 	// FRAME/RULES ausgeben (nur sinnvoll, wenn border!=0)
730cdf0e10cSrcweir 	if( nBorder!=0 && (bCollectBorderWidth || bHasAnyBorders) )
731cdf0e10cSrcweir 	{
732cdf0e10cSrcweir 		const sal_Char *pFrame = 0;
733cdf0e10cSrcweir 		switch( nFrameMask )
734cdf0e10cSrcweir 		{
735cdf0e10cSrcweir 			case 0:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_void		;break;
736cdf0e10cSrcweir 			case 1:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_above	;break;
737cdf0e10cSrcweir 			case 2:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_below	;break;
738cdf0e10cSrcweir 			case 3:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_hsides	;break;
739cdf0e10cSrcweir 			case 4:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_lhs		;break;
740cdf0e10cSrcweir 			case 8:  pFrame = OOO_STRING_SVTOOLS_HTML_TF_rhs		;break;
741cdf0e10cSrcweir 			case 12: pFrame = OOO_STRING_SVTOOLS_HTML_TF_vsides	;break;
742cdf0e10cSrcweir 			//FRAME=BOX ist der default wenn BORDER>0
743cdf0e10cSrcweir 			//case 15:
744cdf0e10cSrcweir 			//default: pFrame = OOO_STRING_SVTOOLS_HTML_TF_box		;break; // geht nicht
745cdf0e10cSrcweir 		};
746cdf0e10cSrcweir 		if( pFrame )
747cdf0e10cSrcweir 			(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_frame ) += '=') += pFrame;
748cdf0e10cSrcweir 
749cdf0e10cSrcweir 		const sal_Char *pRules = 0;
750cdf0e10cSrcweir 		if( aCols.Count() > 1 && aRows.Count() > 1 )
751cdf0e10cSrcweir 		{
752cdf0e10cSrcweir 			if( !bColsHaveBorder )
753cdf0e10cSrcweir 			{
754cdf0e10cSrcweir 				if( !bRowsHaveBorder )
755cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_none;
756cdf0e10cSrcweir 				else if( bRowsHaveBorderOnly )
757cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_rows;
758cdf0e10cSrcweir 				else
759cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_groups;
760cdf0e10cSrcweir 			}
761cdf0e10cSrcweir 			else if( bColsHaveBorderOnly )
762cdf0e10cSrcweir 			{
763cdf0e10cSrcweir 				if( !bRowsHaveBorder || !bRowsHaveBorderOnly )
764cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_cols;
765cdf0e10cSrcweir 			}
766cdf0e10cSrcweir 			else
767cdf0e10cSrcweir 			{
768cdf0e10cSrcweir 				if( !bRowsHaveBorder )
769cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_groups;
770cdf0e10cSrcweir 				else if( bRowsHaveBorderOnly )
771cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_rows;
772cdf0e10cSrcweir 				else
773cdf0e10cSrcweir 					pRules = OOO_STRING_SVTOOLS_HTML_TR_groups;
774cdf0e10cSrcweir 			}
775cdf0e10cSrcweir 		}
776cdf0e10cSrcweir 		else if( aRows.Count() > 1 )
777cdf0e10cSrcweir 		{
778cdf0e10cSrcweir 			if( !bRowsHaveBorder )
779cdf0e10cSrcweir 				pRules = OOO_STRING_SVTOOLS_HTML_TR_none;
780cdf0e10cSrcweir 			else if( !bRowsHaveBorderOnly )
781cdf0e10cSrcweir 				pRules = OOO_STRING_SVTOOLS_HTML_TR_groups;
782cdf0e10cSrcweir 		}
783cdf0e10cSrcweir 		else if( aCols.Count() > 1 )
784cdf0e10cSrcweir 		{
785cdf0e10cSrcweir 			if( !bColsHaveBorder )
786cdf0e10cSrcweir 				pRules = OOO_STRING_SVTOOLS_HTML_TR_none;
787cdf0e10cSrcweir 			else if( !bColsHaveBorderOnly )
788cdf0e10cSrcweir 				pRules = OOO_STRING_SVTOOLS_HTML_TR_groups;
789cdf0e10cSrcweir 		}
790cdf0e10cSrcweir 
791cdf0e10cSrcweir 		if( pRules )
792cdf0e10cSrcweir 			(((sOut += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_rules ) += '=') += pRules;
793cdf0e10cSrcweir 	}
794cdf0e10cSrcweir 	rWrt.Strm() << sOut.GetBuffer();
795cdf0e10cSrcweir 
796cdf0e10cSrcweir 	// Hintergrund ausgeben
797cdf0e10cSrcweir 	if( pFrmFmt )
798cdf0e10cSrcweir 	{
799cdf0e10cSrcweir 		String aDummy;
800cdf0e10cSrcweir 		rWrt.OutBackground( pFrmFmt->GetAttrSet(), aDummy, sal_False );
801cdf0e10cSrcweir 
802cdf0e10cSrcweir 		if( rWrt.bCfgOutStyles && pFrmFmt )
803cdf0e10cSrcweir 			rWrt.OutCSS1_TableFrmFmtOptions( *pFrmFmt );
804cdf0e10cSrcweir 	}
805cdf0e10cSrcweir 
806cdf0e10cSrcweir 	sOut = '>';
807cdf0e10cSrcweir 	rWrt.Strm() << sOut.GetBuffer();
808cdf0e10cSrcweir 
809cdf0e10cSrcweir 	rWrt.IncIndentLevel(); // Inhalte von Table einruecken
810cdf0e10cSrcweir 
811cdf0e10cSrcweir 	// Ueberschrift ausgeben
812cdf0e10cSrcweir 	if( pCaption && pCaption->Len() )
813cdf0e10cSrcweir 	{
814cdf0e10cSrcweir 		rWrt.OutNewLine(); // <CAPTION> in neue Zeile
815cdf0e10cSrcweir 		ByteString sOutStr( OOO_STRING_SVTOOLS_HTML_caption );
816cdf0e10cSrcweir 		(((sOutStr += ' ') += OOO_STRING_SVTOOLS_HTML_O_align) += '=')
817cdf0e10cSrcweir 			+= (bTopCaption ? OOO_STRING_SVTOOLS_HTML_VA_top : OOO_STRING_SVTOOLS_HTML_VA_bottom);
818cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOutStr.GetBuffer(), sal_True );
819cdf0e10cSrcweir 		HTMLOutFuncs::Out_String( rWrt.Strm(), *pCaption, rWrt.eDestEnc, &rWrt.aNonConvertableCharacters	);
820cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_caption, sal_False );
821cdf0e10cSrcweir 	}
822cdf0e10cSrcweir 
823cdf0e10cSrcweir 	sal_uInt16 nCols = aCols.Count();
824cdf0e10cSrcweir 
825cdf0e10cSrcweir 	// <COLGRP>/<COL> ausgeben: Bei Export ueber Layout nur wenn beim
826cdf0e10cSrcweir 	// Import welche da waren, sonst immer.
827cdf0e10cSrcweir 	sal_Bool bColGroups = (bColsHaveBorder && !bColsHaveBorderOnly);
828cdf0e10cSrcweir 	if( bColTags )
829cdf0e10cSrcweir 	{
830cdf0e10cSrcweir 		if( bColGroups )
831cdf0e10cSrcweir 		{
832cdf0e10cSrcweir 			rWrt.OutNewLine(); // <COLGRP> in neue Zeile
833cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup, sal_True );
834cdf0e10cSrcweir 
835cdf0e10cSrcweir 			rWrt.IncIndentLevel(); // Inhalt von <COLGRP> einruecken
836cdf0e10cSrcweir 		}
837cdf0e10cSrcweir 
838cdf0e10cSrcweir 		for( nCol=0; nCol<nCols; nCol++ )
839cdf0e10cSrcweir 		{
840cdf0e10cSrcweir 			rWrt.OutNewLine(); // <COL> in neue Zeile
841cdf0e10cSrcweir 
842cdf0e10cSrcweir 			const SwWriteTableCol *pColumn = aCols[nCol];
843cdf0e10cSrcweir 
844cdf0e10cSrcweir 			ByteString sOutStr( '<' );
845cdf0e10cSrcweir 			sOutStr += OOO_STRING_SVTOOLS_HTML_col;
846cdf0e10cSrcweir 
847cdf0e10cSrcweir             sal_uInt32 nWidth;
848cdf0e10cSrcweir 			sal_Bool bRel;
849cdf0e10cSrcweir 			if( bLayoutExport )
850cdf0e10cSrcweir 			{
851cdf0e10cSrcweir 				bRel = pColumn->HasRelWidthOpt();
852cdf0e10cSrcweir 				nWidth = pColumn->GetWidthOpt();
853cdf0e10cSrcweir 			}
854cdf0e10cSrcweir 			else
855cdf0e10cSrcweir 			{
856cdf0e10cSrcweir 				bRel = HasRelWidths();
857cdf0e10cSrcweir 				nWidth = bRel ? GetRelWidth(nCol,1) : GetAbsWidth(nCol,1);
858cdf0e10cSrcweir 			}
859cdf0e10cSrcweir 
860cdf0e10cSrcweir 			((sOutStr += ' ' ) += OOO_STRING_SVTOOLS_HTML_O_width ) += '=';
861cdf0e10cSrcweir 			if( bRel )
862cdf0e10cSrcweir 			{
863cdf0e10cSrcweir 				(sOutStr += ByteString::CreateFromInt32( nWidth ) ) += '*';
864cdf0e10cSrcweir 			}
865cdf0e10cSrcweir 			else
866cdf0e10cSrcweir 			{
867cdf0e10cSrcweir 				sOutStr += ByteString::CreateFromInt32( rWrt.ToPixel( nWidth ) );
868cdf0e10cSrcweir 			}
869cdf0e10cSrcweir 			sOutStr += '>';
870cdf0e10cSrcweir 			rWrt.Strm() << sOutStr.GetBuffer();
871cdf0e10cSrcweir 
872cdf0e10cSrcweir 			if( bColGroups && pColumn->bRightBorder && nCol<nCols-1 )
873cdf0e10cSrcweir 			{
874cdf0e10cSrcweir 				rWrt.DecIndentLevel(); // Inhalt von <COLGRP> einruecken
875cdf0e10cSrcweir 				rWrt.OutNewLine(); // </COLGRP> in neue Zeile
876cdf0e10cSrcweir 				HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup,
877cdf0e10cSrcweir 											sal_False );
878cdf0e10cSrcweir 				rWrt.OutNewLine(); // <COLGRP> in neue Zeile
879cdf0e10cSrcweir 				HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup,
880cdf0e10cSrcweir 											sal_True );
881cdf0e10cSrcweir 				rWrt.IncIndentLevel(); // Inhalt von <COLGRP> einruecken
882cdf0e10cSrcweir 			}
883cdf0e10cSrcweir 		}
884cdf0e10cSrcweir 		if( bColGroups )
885cdf0e10cSrcweir 		{
886cdf0e10cSrcweir 			rWrt.DecIndentLevel(); // Inhalt von <COLGRP> einruecken
887cdf0e10cSrcweir 
888cdf0e10cSrcweir 			rWrt.OutNewLine(); // </COLGRP> in neue Zeile
889cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_colgroup,
890cdf0e10cSrcweir 										sal_False );
891cdf0e10cSrcweir 		}
892cdf0e10cSrcweir 	}
893cdf0e10cSrcweir 
894cdf0e10cSrcweir 	// die Lines als Tabellenzeilen rausschreiben
895cdf0e10cSrcweir 
896cdf0e10cSrcweir 	// <TBODY> ausgeben?
897cdf0e10cSrcweir 	sal_Bool bTSections = (bRowsHaveBorder && !bRowsHaveBorderOnly);
898cdf0e10cSrcweir 	sal_Bool bTBody = bTSections;
899cdf0e10cSrcweir 
900cdf0e10cSrcweir 	// Wenn Sections ausgegeben werden muessen darf ein THEAD um die erste
901cdf0e10cSrcweir 	// Zeile nur ausgegeben werden, wenn unter der Zeile eine Linie ist
902cdf0e10cSrcweir 	if( bTHead &&
903cdf0e10cSrcweir 		(bTSections || bColGroups) &&
904cdf0e10cSrcweir 		nHeadEndRow<aRows.Count()-1 && !aRows[nHeadEndRow]->bBottomBorder )
905cdf0e10cSrcweir 		bTHead = sal_False;
906cdf0e10cSrcweir 
907cdf0e10cSrcweir 	// <TBODY> aus ausgeben, wenn <THEAD> ausgegeben wird.
908cdf0e10cSrcweir 	bTSections |= bTHead;
909cdf0e10cSrcweir 
910cdf0e10cSrcweir 	if( bTSections )
911cdf0e10cSrcweir 	{
912cdf0e10cSrcweir 		rWrt.OutNewLine(); // <THEAD>/<TDATA> in neue Zeile
913cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(),
914cdf0e10cSrcweir 							bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, sal_True );
915cdf0e10cSrcweir 
916cdf0e10cSrcweir 		rWrt.IncIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
917cdf0e10cSrcweir 	}
918cdf0e10cSrcweir 
919cdf0e10cSrcweir 	for( nRow = 0; nRow < aRows.Count(); nRow++ )
920cdf0e10cSrcweir 	{
921cdf0e10cSrcweir 		const SwWriteTableRow *pRow2 = aRows[nRow];
922cdf0e10cSrcweir 
923cdf0e10cSrcweir 		OutTableCells( rWrt, pRow2->GetCells(), pRow2->GetBackground() );
924cdf0e10cSrcweir 		if( !nCellSpacing && nRow < aRows.Count()-1 && pRow2->bBottomBorder &&
925cdf0e10cSrcweir 			pRow2->nBottomBorder > DEF_LINE_WIDTH_1 )
926cdf0e10cSrcweir 		{
927cdf0e10cSrcweir 			sal_uInt16 nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1;
928cdf0e10cSrcweir 			for( ; nCnt; nCnt-- )
929cdf0e10cSrcweir 			{
930cdf0e10cSrcweir 				rWrt.OutNewLine();
931cdf0e10cSrcweir 				HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow,
932cdf0e10cSrcweir 											sal_True );
933cdf0e10cSrcweir 				HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_tablerow,
934cdf0e10cSrcweir 											sal_False );
935cdf0e10cSrcweir 			}
936cdf0e10cSrcweir 		}
937cdf0e10cSrcweir 		if( ( (bTHead && nRow==nHeadEndRow) ||
938cdf0e10cSrcweir 			  (bTBody && pRow2->bBottomBorder) ) &&
939cdf0e10cSrcweir 			nRow < aRows.Count()-1 )
940cdf0e10cSrcweir 		{
941cdf0e10cSrcweir 			rWrt.DecIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
942cdf0e10cSrcweir 			rWrt.OutNewLine(); // </THEAD>/</TDATA> in neue Zeile
943cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(),
944cdf0e10cSrcweir 							bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, sal_False );
945cdf0e10cSrcweir 			rWrt.OutNewLine(); // <THEAD>/<TDATA> in neue Zeile
946cdf0e10cSrcweir 
947cdf0e10cSrcweir 			if( bTHead && nRow==nHeadEndRow )
948cdf0e10cSrcweir 				bTHead = sal_False;
949cdf0e10cSrcweir 
950cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(),
951cdf0e10cSrcweir 							bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, sal_True );
952cdf0e10cSrcweir 			rWrt.IncIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
953cdf0e10cSrcweir 		}
954cdf0e10cSrcweir 	}
955cdf0e10cSrcweir 
956cdf0e10cSrcweir 	if( bTSections )
957cdf0e10cSrcweir 	{
958cdf0e10cSrcweir 		rWrt.DecIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
959cdf0e10cSrcweir 
960cdf0e10cSrcweir 		rWrt.OutNewLine(); // </THEAD>/</TDATA> in neue Zeile
961cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(),
962cdf0e10cSrcweir 							bTHead ? OOO_STRING_SVTOOLS_HTML_thead : OOO_STRING_SVTOOLS_HTML_tbody, sal_False );
963cdf0e10cSrcweir 	}
964cdf0e10cSrcweir 
965cdf0e10cSrcweir 	rWrt.DecIndentLevel(); // Inhalt von <TABLE> einr.
966cdf0e10cSrcweir 
967cdf0e10cSrcweir 	rWrt.OutNewLine(); // </TABLE> in neue Zeile
968cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_table, sal_False );
969cdf0e10cSrcweir 
970cdf0e10cSrcweir 	rWrt.nDirection = nOldDirection;
971cdf0e10cSrcweir }
972cdf0e10cSrcweir 
OutHTML_SwTblNode(Writer & rWrt,SwTableNode & rNode,const SwFrmFmt * pFlyFrmFmt,const String * pCaption,sal_Bool bTopCaption)973cdf0e10cSrcweir Writer& OutHTML_SwTblNode( Writer& rWrt, SwTableNode & rNode,
974cdf0e10cSrcweir 						   const SwFrmFmt *pFlyFrmFmt,
975cdf0e10cSrcweir 						   const String *pCaption, sal_Bool bTopCaption )
976cdf0e10cSrcweir {
977cdf0e10cSrcweir 
978cdf0e10cSrcweir 	SwTable& rTbl = rNode.GetTable();
979cdf0e10cSrcweir 
980cdf0e10cSrcweir 	SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
981cdf0e10cSrcweir 	rHTMLWrt.bOutTable = sal_True;
982cdf0e10cSrcweir 
983cdf0e10cSrcweir 	// die horizontale Ausrichtung des Rahmens hat (falls vorhanden)
984cdf0e10cSrcweir 	// Prioritaet. NONE bedeutet, dass keine horizontale
985cdf0e10cSrcweir 	// Ausrichtung geschrieben wird.
986cdf0e10cSrcweir     sal_Int16 eFlyHoriOri = text::HoriOrientation::NONE;
987cdf0e10cSrcweir 	SwSurround eSurround = SURROUND_NONE;
988cdf0e10cSrcweir 	sal_uInt8 nFlyPrcWidth = 0;
989cdf0e10cSrcweir 	long nFlyWidth = 0;
990cdf0e10cSrcweir 	sal_uInt16 nFlyHSpace = 0;
991cdf0e10cSrcweir 	sal_uInt16 nFlyVSpace = 0;
992cdf0e10cSrcweir 	if( pFlyFrmFmt )
993cdf0e10cSrcweir 	{
994cdf0e10cSrcweir 		eSurround = pFlyFrmFmt->GetSurround().GetSurround();
995cdf0e10cSrcweir 		const SwFmtFrmSize& rFrmSize = pFlyFrmFmt->GetFrmSize();
996cdf0e10cSrcweir 		nFlyPrcWidth = rFrmSize.GetWidthPercent();
997cdf0e10cSrcweir 		nFlyWidth = rFrmSize.GetSize().Width();
998cdf0e10cSrcweir 
999cdf0e10cSrcweir 		eFlyHoriOri = pFlyFrmFmt->GetHoriOrient().GetHoriOrient();
1000cdf0e10cSrcweir         if( text::HoriOrientation::NONE == eFlyHoriOri )
1001cdf0e10cSrcweir             eFlyHoriOri = text::HoriOrientation::LEFT;
1002cdf0e10cSrcweir 
1003cdf0e10cSrcweir 		const SvxLRSpaceItem& rLRSpace = pFlyFrmFmt->GetLRSpace();
1004cdf0e10cSrcweir         nFlyHSpace = static_cast< sal_uInt16 >((rLRSpace.GetLeft() + rLRSpace.GetRight()) / 2);
1005cdf0e10cSrcweir 
1006cdf0e10cSrcweir 		const SvxULSpaceItem& rULSpace = pFlyFrmFmt->GetULSpace();
1007cdf0e10cSrcweir 		nFlyVSpace = (rULSpace.GetUpper() + rULSpace.GetLower()) / 2;
1008cdf0e10cSrcweir 	}
1009cdf0e10cSrcweir 
1010cdf0e10cSrcweir 	// ggf. eine FORM oeffnen
1011cdf0e10cSrcweir 	sal_Bool bPreserveForm = sal_False;
1012cdf0e10cSrcweir 	if( !rHTMLWrt.bPreserveForm )
1013cdf0e10cSrcweir 	{
1014cdf0e10cSrcweir 		rHTMLWrt.OutForm( sal_True, &rNode );
1015cdf0e10cSrcweir 		bPreserveForm = (rHTMLWrt.pxFormComps && rHTMLWrt.pxFormComps->is() );
1016cdf0e10cSrcweir 		rHTMLWrt.bPreserveForm = bPreserveForm;
1017cdf0e10cSrcweir 	}
1018cdf0e10cSrcweir 
1019cdf0e10cSrcweir 	SwFrmFmt *pFmt = rTbl.GetFrmFmt();
1020cdf0e10cSrcweir 
1021cdf0e10cSrcweir 	const SwFmtFrmSize& rFrmSize = pFmt->GetFrmSize();
1022cdf0e10cSrcweir 	long nWidth = rFrmSize.GetSize().Width();
1023cdf0e10cSrcweir 	sal_uInt8 nPrcWidth = rFrmSize.GetWidthPercent();
1024cdf0e10cSrcweir 	sal_uInt16 nBaseWidth = (sal_uInt16)nWidth;
1025cdf0e10cSrcweir 
1026cdf0e10cSrcweir     sal_Int16 eTabHoriOri = pFmt->GetHoriOrient().GetHoriOrient();
1027cdf0e10cSrcweir 
1028cdf0e10cSrcweir     // text::HoriOrientation::NONE und text::HoriOrientation::FULL Tabellen benoetigen relative Breiten
1029cdf0e10cSrcweir 	sal_uInt16 nNewDefListLvl = 0;
1030cdf0e10cSrcweir 	sal_Bool bRelWidths = sal_False;
1031cdf0e10cSrcweir 	sal_Bool bCheckDefList = sal_False;
1032cdf0e10cSrcweir 	switch( eTabHoriOri )
1033cdf0e10cSrcweir 	{
1034cdf0e10cSrcweir     case text::HoriOrientation::FULL:
1035cdf0e10cSrcweir 		// Tabellen mit automatischer Ausrichtung werden zu Tabellen
1036cdf0e10cSrcweir 		// mit 100%-Breite
1037cdf0e10cSrcweir 		bRelWidths = sal_True;
1038cdf0e10cSrcweir 		nWidth = 100;
1039cdf0e10cSrcweir         eTabHoriOri = text::HoriOrientation::LEFT;
1040cdf0e10cSrcweir 		break;
1041cdf0e10cSrcweir     case text::HoriOrientation::NONE:
1042cdf0e10cSrcweir 		{
1043cdf0e10cSrcweir 			const SvxLRSpaceItem& aLRItem = pFmt->GetLRSpace();
1044cdf0e10cSrcweir 			if( aLRItem.GetRight() )
1045cdf0e10cSrcweir 			{
1046cdf0e10cSrcweir 				// Die Tabellenbreite wird anhand des linken und rechten
1047cdf0e10cSrcweir 				// Abstandes bestimmt. Deshalb versuchen wir die
1048cdf0e10cSrcweir 				// tatsaechliche Breite der Tabelle zu bestimmen. Wenn
1049cdf0e10cSrcweir 				// das nicht geht, machen wir eine 100% breite Tabelle
1050cdf0e10cSrcweir 				// draus.
1051cdf0e10cSrcweir 				nWidth = pFmt->FindLayoutRect(sal_True).Width();
1052cdf0e10cSrcweir 				if( !nWidth )
1053cdf0e10cSrcweir 				{
1054cdf0e10cSrcweir 					bRelWidths = sal_True;
1055cdf0e10cSrcweir 					nWidth = 100;
1056cdf0e10cSrcweir 				}
1057cdf0e10cSrcweir 
1058cdf0e10cSrcweir 			}
1059cdf0e10cSrcweir 			else if( nPrcWidth  )
1060cdf0e10cSrcweir 			{
1061cdf0e10cSrcweir 				// Ohne rechten Rand bleibt die %-Breite erhalten
1062cdf0e10cSrcweir 				nWidth = nPrcWidth;
1063cdf0e10cSrcweir 				bRelWidths = sal_True;
1064cdf0e10cSrcweir 			}
1065cdf0e10cSrcweir 			else
1066cdf0e10cSrcweir 			{
1067cdf0e10cSrcweir 				// Ohne rechten Rand bleibt auch eine absolute Breite erhalten
1068cdf0e10cSrcweir 				// Wir versuchen aber trotzdem ueber das Layout die
1069cdf0e10cSrcweir 				// tatsachliche Breite zu ermitteln.
1070cdf0e10cSrcweir 				long nRealWidth = pFmt->FindLayoutRect(sal_True).Width();
1071cdf0e10cSrcweir 				if( nRealWidth )
1072cdf0e10cSrcweir 					nWidth = nRealWidth;
1073cdf0e10cSrcweir 			}
1074cdf0e10cSrcweir 			bCheckDefList = sal_True;
1075cdf0e10cSrcweir 		}
1076cdf0e10cSrcweir 		break;
1077cdf0e10cSrcweir     case text::HoriOrientation::LEFT_AND_WIDTH:
1078cdf0e10cSrcweir         eTabHoriOri = text::HoriOrientation::LEFT;
1079cdf0e10cSrcweir 		bCheckDefList = sal_True;
1080cdf0e10cSrcweir 		// no break
1081cdf0e10cSrcweir 	default:
1082cdf0e10cSrcweir 		// In allen anderen Faellen kann eine absolute oder relative
1083cdf0e10cSrcweir 		// Breite direkt uebernommen werden.
1084cdf0e10cSrcweir 		if( nPrcWidth )
1085cdf0e10cSrcweir 		{
1086cdf0e10cSrcweir 			bRelWidths = sal_True;
1087cdf0e10cSrcweir 			nWidth = nPrcWidth;
1088cdf0e10cSrcweir 		}
1089cdf0e10cSrcweir 		break;
1090cdf0e10cSrcweir 	}
1091cdf0e10cSrcweir 
1092cdf0e10cSrcweir 	if( bCheckDefList )
1093cdf0e10cSrcweir 	{
1094cdf0e10cSrcweir 		ASSERT( !rHTMLWrt.GetNumInfo().GetNumRule() ||
1095cdf0e10cSrcweir 				rHTMLWrt.GetNextNumInfo(),
1096cdf0e10cSrcweir 				"NumInfo fuer naechsten Absatz fehlt!" );
1097cdf0e10cSrcweir 		const SvxLRSpaceItem& aLRItem = pFmt->GetLRSpace();
1098cdf0e10cSrcweir 		if( aLRItem.GetLeft() > 0 && rHTMLWrt.nDefListMargin > 0 &&
1099cdf0e10cSrcweir 			( !rHTMLWrt.GetNumInfo().GetNumRule() ||
1100cdf0e10cSrcweir 			  ( rHTMLWrt.GetNextNumInfo() &&
1101cdf0e10cSrcweir 				(rHTMLWrt.GetNextNumInfo()->IsRestart() ||
1102cdf0e10cSrcweir 				 rHTMLWrt.GetNumInfo().GetNumRule() !=
1103cdf0e10cSrcweir 					rHTMLWrt.GetNextNumInfo()->GetNumRule()) ) ) )
1104cdf0e10cSrcweir 		{
1105cdf0e10cSrcweir 			// Wenn der Absatz vor der Tabelle nicht numeriert ist oder
1106cdf0e10cSrcweir 			// der Absatz nach der Tabelle mit einer anderen oder
1107cdf0e10cSrcweir 			// (gar keiner) Regel numeriert ist, koennen wir
1108cdf0e10cSrcweir 			// die Einrueckung ueber eine DL regeln. Sonst behalten wir
1109cdf0e10cSrcweir 			// die Einrueckung der Numerierung bei.
1110cdf0e10cSrcweir             nNewDefListLvl = static_cast< sal_uInt16 >(
1111cdf0e10cSrcweir 				(aLRItem.GetLeft() + (rHTMLWrt.nDefListMargin/2)) /
1112cdf0e10cSrcweir                 rHTMLWrt.nDefListMargin );
1113cdf0e10cSrcweir 		}
1114cdf0e10cSrcweir 	}
1115cdf0e10cSrcweir 
1116cdf0e10cSrcweir 	if( !pFlyFrmFmt && nNewDefListLvl != rHTMLWrt.nDefListLvl )
1117cdf0e10cSrcweir 		rHTMLWrt.OutAndSetDefList( nNewDefListLvl );
1118cdf0e10cSrcweir 
1119cdf0e10cSrcweir 	if( nNewDefListLvl )
1120cdf0e10cSrcweir 	{
1121cdf0e10cSrcweir 		if( rHTMLWrt.bLFPossible )
1122cdf0e10cSrcweir 			rHTMLWrt.OutNewLine();
1123cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_dd );
1124cdf0e10cSrcweir 	}
1125cdf0e10cSrcweir 
1126cdf0e10cSrcweir 	// eFlyHoriOri und eTabHoriOri besitzen nun nur noch die Werte
1127cdf0e10cSrcweir 	// LEFT/CENTER und RIGHT!
1128cdf0e10cSrcweir     if( eFlyHoriOri!=text::HoriOrientation::NONE )
1129cdf0e10cSrcweir 	{
1130cdf0e10cSrcweir 		eTabHoriOri = eFlyHoriOri;
1131cdf0e10cSrcweir 		// MIB 4.7.97: Wenn die Tabelle eine relative Breite besitzt,
1132cdf0e10cSrcweir 		// dann richtet sich ihre Breite nach der des Rahmens, also
1133cdf0e10cSrcweir 		// exportieren wir dessen Breite. Bei fixer Breite ist die Breite
1134cdf0e10cSrcweir 		// der Tabelle massgeblich. Wer Tabellen mit relativer Breite <100%
1135cdf0e10cSrcweir 		// in Rahmen steckt, ist selber schuld wenn nix Gutes bei rauskommt.
1136cdf0e10cSrcweir 		if( bRelWidths )
1137cdf0e10cSrcweir 		{
1138cdf0e10cSrcweir 			nWidth = nFlyPrcWidth ? nFlyPrcWidth : nFlyWidth;
1139cdf0e10cSrcweir 			bRelWidths = nFlyPrcWidth > 0;
1140cdf0e10cSrcweir 		}
1141cdf0e10cSrcweir 	}
1142cdf0e10cSrcweir 
1143cdf0e10cSrcweir     sal_Int16 eDivHoriOri = text::HoriOrientation::NONE;
1144cdf0e10cSrcweir 	switch( eTabHoriOri )
1145cdf0e10cSrcweir 	{
1146cdf0e10cSrcweir     case text::HoriOrientation::LEFT:
1147cdf0e10cSrcweir 		// Wenn eine linksbuendigeTabelle keinen rechtsseiigen Durchlauf
1148cdf0e10cSrcweir 		// hat, brauchen wir auch kein ALIGN=LEFT in der Tabelle.
1149cdf0e10cSrcweir 		if( eSurround==SURROUND_NONE || eSurround==SURROUND_LEFT )
1150cdf0e10cSrcweir             eTabHoriOri = text::HoriOrientation::NONE;
1151cdf0e10cSrcweir 		break;
1152cdf0e10cSrcweir     case text::HoriOrientation::RIGHT:
1153cdf0e10cSrcweir 		// Aehnliches gilt fuer rechtsbuendigeTabelle, hier nehmen wir
1154cdf0e10cSrcweir 		// stattdessen ein <DIV ALIGN=RIGHT>.
1155cdf0e10cSrcweir 		if( eSurround==SURROUND_NONE || eSurround==SURROUND_RIGHT )
1156cdf0e10cSrcweir 		{
1157cdf0e10cSrcweir             eDivHoriOri = text::HoriOrientation::RIGHT;
1158cdf0e10cSrcweir             eTabHoriOri = text::HoriOrientation::NONE;
1159cdf0e10cSrcweir 		}
1160cdf0e10cSrcweir 		break;
1161cdf0e10cSrcweir     case text::HoriOrientation::CENTER:
1162cdf0e10cSrcweir 		// ALIGN=CENTER versteht so gut wie keiner, deshalb verzichten wir
1163cdf0e10cSrcweir 		// daruf und nehmen ein <CENTER>.
1164cdf0e10cSrcweir         eDivHoriOri = text::HoriOrientation::CENTER;
1165cdf0e10cSrcweir         eTabHoriOri = text::HoriOrientation::NONE;
1166cdf0e10cSrcweir 		break;
1167cdf0e10cSrcweir 	default:
1168cdf0e10cSrcweir 		;
1169cdf0e10cSrcweir 	}
1170cdf0e10cSrcweir     if( text::HoriOrientation::NONE==eTabHoriOri )
1171cdf0e10cSrcweir 		nFlyHSpace = nFlyVSpace = 0;
1172cdf0e10cSrcweir 
1173cdf0e10cSrcweir 	if( pFmt->GetName().Len() )
1174cdf0e10cSrcweir 		rHTMLWrt.OutImplicitMark( pFmt->GetName(), pMarkToTable );
1175cdf0e10cSrcweir 
1176cdf0e10cSrcweir     if( text::HoriOrientation::NONE!=eDivHoriOri )
1177cdf0e10cSrcweir 	{
1178cdf0e10cSrcweir 		if( rHTMLWrt.bLFPossible )
1179cdf0e10cSrcweir 			rHTMLWrt.OutNewLine();	// <CENTER> in neuer Zeile
1180cdf0e10cSrcweir         if( text::HoriOrientation::CENTER==eDivHoriOri )
1181cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_center, sal_True );
1182cdf0e10cSrcweir 		else
1183cdf0e10cSrcweir 		{
1184cdf0e10cSrcweir 			ByteString sOut( OOO_STRING_SVTOOLS_HTML_division );
1185cdf0e10cSrcweir 			(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_align) += '=') += OOO_STRING_SVTOOLS_HTML_AL_right;
1186cdf0e10cSrcweir 			HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), sOut.GetBuffer(),
1187cdf0e10cSrcweir 										sal_True );
1188cdf0e10cSrcweir 		}
1189cdf0e10cSrcweir 		rHTMLWrt.IncIndentLevel();	// Inhalt von <CENTER> einruecken
1190cdf0e10cSrcweir 		rHTMLWrt.bLFPossible = sal_True;
1191cdf0e10cSrcweir 	}
1192cdf0e10cSrcweir 
1193cdf0e10cSrcweir 	// Wenn die Tabelle in keinem Rahmen ist kann man immer ein LF ausgeben.
1194cdf0e10cSrcweir     if( text::HoriOrientation::NONE==eTabHoriOri )
1195cdf0e10cSrcweir 		rHTMLWrt.bLFPossible = sal_True;
1196cdf0e10cSrcweir 
1197cdf0e10cSrcweir 	const SwHTMLTableLayout *pLayout = rTbl.GetHTMLTableLayout();
1198cdf0e10cSrcweir 
1199cdf0e10cSrcweir #ifdef DBG_UTIL
1200cdf0e10cSrcweir 	ViewShell *pSh;
1201cdf0e10cSrcweir 	rWrt.pDoc->GetEditShell( &pSh );
1202cdf0e10cSrcweir 	if ( pSh && pSh->GetViewOptions()->IsTest1() )
1203cdf0e10cSrcweir 		pLayout = 0;
1204cdf0e10cSrcweir #endif
1205cdf0e10cSrcweir 
1206cdf0e10cSrcweir 	if( pLayout && pLayout->IsExportable() )
1207cdf0e10cSrcweir 	{
1208cdf0e10cSrcweir 		SwHTMLWrtTable aTableWrt( pLayout );
1209cdf0e10cSrcweir         aTableWrt.Write( rHTMLWrt, eTabHoriOri, rTbl.GetRowsToRepeat() > 0,
1210cdf0e10cSrcweir 						 pFmt, pCaption, bTopCaption,
1211cdf0e10cSrcweir 						 nFlyHSpace, nFlyVSpace );
1212cdf0e10cSrcweir 	}
1213cdf0e10cSrcweir 	else
1214cdf0e10cSrcweir 	{
1215cdf0e10cSrcweir 		SwHTMLWrtTable aTableWrt( rTbl.GetTabLines(), nWidth,
1216cdf0e10cSrcweir                                   nBaseWidth, bRelWidths, rTbl.GetRowsToRepeat() );
1217cdf0e10cSrcweir         aTableWrt.Write( rHTMLWrt, eTabHoriOri, rTbl.GetRowsToRepeat() > 0,
1218cdf0e10cSrcweir 						 pFmt, pCaption, bTopCaption,
1219cdf0e10cSrcweir 						 nFlyHSpace, nFlyVSpace );
1220cdf0e10cSrcweir 	}
1221cdf0e10cSrcweir 
1222cdf0e10cSrcweir 	// Wenn die Tabelle in keinem Rahmen war kann man immer ein LF ausgeben.
1223cdf0e10cSrcweir     if( text::HoriOrientation::NONE==eTabHoriOri )
1224cdf0e10cSrcweir 		rHTMLWrt.bLFPossible = sal_True;
1225cdf0e10cSrcweir 
1226cdf0e10cSrcweir     if( text::HoriOrientation::NONE!=eDivHoriOri )
1227cdf0e10cSrcweir 	{
1228cdf0e10cSrcweir 		rHTMLWrt.DecIndentLevel();	// Inhalt von <CENTER> einruecken
1229cdf0e10cSrcweir 		rHTMLWrt.OutNewLine();		// </CENTER> in neue Teile
1230cdf0e10cSrcweir 		HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(),
1231cdf0e10cSrcweir                                text::HoriOrientation::CENTER==eDivHoriOri ? OOO_STRING_SVTOOLS_HTML_center
1232cdf0e10cSrcweir 														: OOO_STRING_SVTOOLS_HTML_division, sal_False );
1233cdf0e10cSrcweir 		rHTMLWrt.bLFPossible = sal_True;
1234cdf0e10cSrcweir 	}
1235cdf0e10cSrcweir 
1236cdf0e10cSrcweir 	// Pam hinter die Tabelle verschieben
1237cdf0e10cSrcweir 	rHTMLWrt.pCurPam->GetPoint()->nNode = *rNode.EndOfSectionNode();
1238cdf0e10cSrcweir 
1239cdf0e10cSrcweir 	if( bPreserveForm )
1240cdf0e10cSrcweir 	{
1241cdf0e10cSrcweir 		rHTMLWrt.bPreserveForm = sal_False;
1242cdf0e10cSrcweir 		rHTMLWrt.OutForm( sal_False );
1243cdf0e10cSrcweir 	}
1244cdf0e10cSrcweir 
1245cdf0e10cSrcweir 	rHTMLWrt.bOutTable = sal_False;
1246cdf0e10cSrcweir 
1247cdf0e10cSrcweir 	if( rHTMLWrt.GetNextNumInfo() &&
1248cdf0e10cSrcweir 		!rHTMLWrt.GetNextNumInfo()->IsRestart() &&
1249cdf0e10cSrcweir 		rHTMLWrt.GetNextNumInfo()->GetNumRule() ==
1250cdf0e10cSrcweir 			rHTMLWrt.GetNumInfo().GetNumRule() )
1251cdf0e10cSrcweir 	{
1252cdf0e10cSrcweir 		// Wenn der Absatz hinter der Tabelle mit der gleichen Regel
1253cdf0e10cSrcweir 		// numeriert ist wie der Absatz vor der Tabelle, dann steht in
1254cdf0e10cSrcweir 		// der NumInfo des naechsten Absatzes noch die Ebene des Absatzes
1255cdf0e10cSrcweir 		// vor der Tabelle. Es muss deshalb die NumInfo noch einmal geholt
1256cdf0e10cSrcweir 		// werden um ggf. die Num-Liste noch zu beenden.
1257cdf0e10cSrcweir 		rHTMLWrt.ClearNextNumInfo();
1258cdf0e10cSrcweir 		rHTMLWrt.FillNextNumInfo();
1259cdf0e10cSrcweir 		OutHTML_NumBulListEnd( rHTMLWrt, *rHTMLWrt.GetNextNumInfo() );
1260cdf0e10cSrcweir 	}
1261cdf0e10cSrcweir 	return rWrt;
1262cdf0e10cSrcweir }
1263cdf0e10cSrcweir 
1264cdf0e10cSrcweir 
1265