View | Details | Raw Unified | Return to issue 97591
Collapse All | Expand All

(-)sw/source/filter/xml/xmltble.cxx (-17 / +17 lines)
Lines 88-94 Link Here
88
public:
88
public:
89
89
90
90
91
	SwXMLTableColumn_Impl( sal_uInt16 nPosition ) :
91
	SwXMLTableColumn_Impl( sal_uInt32 nPosition ) :
92
		SwWriteTableCol( nPosition ),
92
		SwWriteTableCol( nPosition ),
93
		nRelWidth( 0UL )
93
		nRelWidth( 0UL )
94
	{};
94
	{};
Lines 143-149 Link Here
143
	nWidth( 0UL )
143
	nWidth( 0UL )
144
{
144
{
145
#ifndef PRODUCT
145
#ifndef PRODUCT
146
	sal_uInt16 nEndCPos = 0U;
146
	sal_uInt32 nEndCPos = 0U;
147
#endif
147
#endif
148
	sal_uInt16 nLines = rLines.Count();
148
	sal_uInt16 nLines = rLines.Count();
149
	sal_uInt16 nLine;
149
	sal_uInt16 nLine;
Lines 153-166 Link Here
153
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
153
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
154
		sal_uInt16 nBoxes = rBoxes.Count();
154
		sal_uInt16 nBoxes = rBoxes.Count();
155
155
156
		sal_uInt16 nCPos = 0U;
156
		sal_uInt32 nCPos = 0U;
157
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
157
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
158
		{
158
		{
159
			const SwTableBox *pBox = rBoxes[nBox];
159
			const SwTableBox *pBox = rBoxes[nBox];
160
160
161
			if( nBox < nBoxes-1U || nWidth==0UL )
161
			if( nBox < nBoxes-1U || nWidth==0UL )
162
			{
162
			{
163
                nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
163
                nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
164
				SwXMLTableColumn_Impl *pCol =
164
				SwXMLTableColumn_Impl *pCol =
165
					new SwXMLTableColumn_Impl( nCPos );
165
					new SwXMLTableColumn_Impl( nCPos );
166
166
Lines 177-184 Link Here
177
			else
177
			else
178
			{
178
			{
179
#ifndef PRODUCT
179
#ifndef PRODUCT
180
				sal_uInt16 nCheckPos =
180
				sal_uInt32 nCheckPos =
181
					nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
181
					nCPos + SwWriteTable::GetBoxWidth( pBox );
182
				if( !nEndCPos )
182
				if( !nEndCPos )
183
				{
183
				{
184
					nEndCPos = nCheckPos;
184
					nEndCPos = nCheckPos;
Lines 192-200 Link Here
192
					*/
192
					*/
193
				}
193
				}
194
#endif
194
#endif
195
				nCPos = (sal_uInt16)nWidth;
195
				nCPos = nWidth;
196
#ifndef PRODUCT
196
#ifndef PRODUCT
197
				SwXMLTableColumn_Impl aCol( (sal_uInt16)nWidth );
197
				SwXMLTableColumn_Impl aCol( nWidth );
198
				ASSERT( aCols.Seek_Entry(&aCol), "couldn't find last column" );
198
				ASSERT( aCols.Seek_Entry(&aCol), "couldn't find last column" );
199
				ASSERT( SwXMLTableColumn_Impl(nCheckPos) ==
199
				ASSERT( SwXMLTableColumn_Impl(nCheckPos) ==
200
											SwXMLTableColumn_Impl(nCPos),
200
											SwXMLTableColumn_Impl(nCPos),
Lines 608-620 Link Here
608
	// pass 2: export column styles
608
	// pass 2: export column styles
609
	{
609
	{
610
		const SwXMLTableColumns_Impl& rCols = pLines->GetColumns();
610
		const SwXMLTableColumns_Impl& rCols = pLines->GetColumns();
611
		sal_uInt16 nCPos = 0U;
611
		sal_uInt32 nCPos = 0U;
612
		sal_uInt16 nColumns = rCols.Count();
612
		sal_uInt16 nColumns = rCols.Count();
613
		for( sal_uInt16	nColumn=0U; nColumn<nColumns; nColumn++ )
613
		for( sal_uInt16	nColumn=0U; nColumn<nColumns; nColumn++ )
614
		{
614
		{
615
			SwXMLTableColumn_Impl *pColumn = rCols[nColumn];
615
			SwXMLTableColumn_Impl *pColumn = rCols[nColumn];
616
616
617
			sal_uInt16 nOldCPos = nCPos;
617
			sal_uInt32 nOldCPos = nCPos;
618
			nCPos = pColumn->GetPos();
618
			nCPos = pColumn->GetPos();
619
619
620
			sal_uInt32 nWidth = nCPos - nOldCPos;
620
			sal_uInt32 nWidth = nCPos - nOldCPos;
Lines 640-646 Link Here
640
					nColAbsWidth += (nBaseWidth/2UL);
640
					nColAbsWidth += (nBaseWidth/2UL);
641
					nColAbsWidth /= nBaseWidth;
641
					nColAbsWidth /= nBaseWidth;
642
				}
642
				}
643
				pColumn->SetWidthOpt( (sal_uInt16)nColAbsWidth, sal_False );
643
				pColumn->SetWidthOpt( nColAbsWidth, sal_False );
644
			}
644
			}
645
645
646
			ULONG nExpPos = 0;
646
			ULONG nExpPos = 0;
Lines 684-699 Link Here
684
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
684
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
685
		sal_uInt16 nBoxes = rBoxes.Count();
685
		sal_uInt16 nBoxes = rBoxes.Count();
686
686
687
		sal_uInt16 nCPos = 0U;
687
		sal_uInt32 nCPos = 0U;
688
		sal_uInt16 nCol = 0U;
688
		sal_uInt16 nCol = 0U;
689
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
689
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
690
		{
690
		{
691
			SwTableBox *pBox = rBoxes[nBox];
691
			SwTableBox *pBox = rBoxes[nBox];
692
692
693
			if( nBox < nBoxes-1U )
693
			if( nBox < nBoxes-1U )
694
                nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
694
                nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
695
			else
695
			else
696
				nCPos = (sal_uInt16)pLines->GetWidth();
696
				nCPos = pLines->GetWidth();
697
697
698
698
699
			// Und ihren Index
699
			// Und ihren Index
Lines 965-971 Link Here
965
		const SwTableBoxes& rBoxes = rLine.GetTabBoxes();
965
		const SwTableBoxes& rBoxes = rLine.GetTabBoxes();
966
		sal_uInt16 nBoxes = rBoxes.Count();
966
		sal_uInt16 nBoxes = rBoxes.Count();
967
967
968
		sal_uInt16 nCPos = 0U;
968
		sal_uInt32 nCPos = 0U;
969
		sal_uInt16 nCol = 0U;
969
		sal_uInt16 nCol = 0U;
970
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
970
		for( sal_uInt16 nBox=0U; nBox<nBoxes; nBox++ )
971
		{
971
		{
Lines 981-989 Link Here
981
	        }
981
	        }
982
982
983
			if( nBox < nBoxes-1U )
983
			if( nBox < nBoxes-1U )
984
                nCPos = nCPos + (sal_uInt16)SwWriteTable::GetBoxWidth( pBox );
984
                nCPos = nCPos + SwWriteTable::GetBoxWidth( pBox );
985
			else
985
			else
986
				nCPos = (sal_uInt16)rLines.GetWidth();
986
				nCPos = rLines.GetWidth();
987
987
988
			// Und ihren Index
988
			// Und ihren Index
989
            const sal_uInt16 nOldCol = nCol;
989
            const sal_uInt16 nOldCol = nCol;
(-)sw/source/filter/inc/wrtswtbl.hxx (-9 / +9 lines)
Lines 181-187 Link Here
181
181
182
class SwWriteTableCol
182
class SwWriteTableCol
183
{
183
{
184
	USHORT nPos;						// End Position der Spalte
184
	sal_uInt32 nPos;						// End Position der Spalte
185
185
186
	USHORT nWidthOpt;
186
	USHORT nWidthOpt;
187
187
Lines 192-200 Link Here
192
	BOOL bLeftBorder : 1;				// Welche Umrandungen sind da?
192
	BOOL bLeftBorder : 1;				// Welche Umrandungen sind da?
193
	BOOL bRightBorder : 1;
193
	BOOL bRightBorder : 1;
194
194
195
	SwWriteTableCol( USHORT nPosition );
195
	SwWriteTableCol( sal_uInt32 nPosition );
196
196
197
	USHORT GetPos() const 						{ return nPos; }
197
	sal_uInt32 GetPos() const 						{ return nPos; }
198
198
199
	void SetLeftBorder( BOOL bBorder ) 			{ bLeftBorder = bBorder; }
199
	void SetLeftBorder( BOOL bBorder ) 			{ bLeftBorder = bBorder; }
200
	BOOL HasLeftBorder() const 					{ return bLeftBorder; }
200
	BOOL HasLeftBorder() const 					{ return bLeftBorder; }
Lines 208-214 Link Here
208
	inline int operator==( const SwWriteTableCol& rCol ) const;
208
	inline int operator==( const SwWriteTableCol& rCol ) const;
209
	inline int operator<( const SwWriteTableCol& rCol ) const;
209
	inline int operator<( const SwWriteTableCol& rCol ) const;
210
210
211
	void SetWidthOpt( USHORT nWidth, BOOL bRel )
211
	void SetWidthOpt( sal_uInt32 nWidth, BOOL bRel )
212
	{
212
	{
213
		nWidthOpt = nWidth; bRelWidthOpt = bRel;
213
		nWidthOpt = nWidth; bRelWidthOpt = bRel;
214
	}
214
	}
Lines 272-287 Link Here
272
	virtual BOOL ShouldExpandSub( const SwTableBox *pBox,
272
	virtual BOOL ShouldExpandSub( const SwTableBox *pBox,
273
								BOOL bExpandedBefore, USHORT nDepth ) const;
273
								BOOL bExpandedBefore, USHORT nDepth ) const;
274
274
275
	void CollectTableRowsCols( long nStartRPos, USHORT nStartCPos,
275
	void CollectTableRowsCols( long nStartRPos, sal_uInt32 nStartCPos,
276
							   long nParentLineHeight,
276
							   long nParentLineHeight,
277
							   USHORT nParentLineWidth,
277
							   sal_uInt32 nParentLineWidth,
278
							   const SwTableLines& rLines,
278
							   const SwTableLines& rLines,
279
							   USHORT nDepth );
279
							   USHORT nDepth );
280
280
281
	void FillTableRowsCols( long nStartRPos, USHORT nStartRow,
281
	void FillTableRowsCols( long nStartRPos, USHORT nStartRow,
282
							USHORT nStartCPos, USHORT nStartCol,
282
							sal_uInt32 nStartCPos, USHORT nStartCol,
283
							long nParentLineHeight,
283
							long nParentLineHeight,
284
							USHORT nParentLineWidth,
284
							sal_uInt32 nParentLineWidth,
285
							const SwTableLines& rLines,
285
							const SwTableLines& rLines,
286
							const SvxBrushItem* pLineBrush,
286
							const SvxBrushItem* pLineBrush,
287
							USHORT nDepth,
287
							USHORT nDepth,
Lines 298-304 Link Here
298
	BOOL HasRelWidths() const { return bRelWidths; }
298
	BOOL HasRelWidths() const { return bRelWidths; }
299
299
300
public:
300
public:
301
	static long GetBoxWidth( const SwTableBox *pBox );
301
	static sal_uInt32 GetBoxWidth( const SwTableBox *pBox );
302
protected:
302
protected:
303
303
304
	long GetLineHeight( const SwTableLine *pLine );
304
	long GetLineHeight( const SwTableLine *pLine );
(-)sw/source/filter/writer/wrtswtbl.cxx (-15 / +15 lines)
Lines 95-101 Link Here
95
95
96
//-----------------------------------------------------------------------
96
//-----------------------------------------------------------------------
97
97
98
SwWriteTableCol::SwWriteTableCol(USHORT nPosition)
98
SwWriteTableCol::SwWriteTableCol(sal_uInt32 nPosition)
99
	: nPos(nPosition), nWidthOpt(0), bRelWidthOpt(false), bOutWidth(true),
99
	: nPos(nPosition), nWidthOpt(0), bRelWidthOpt(false), bOutWidth(true),
100
	bLeftBorder(true), bRightBorder(true)
100
	bLeftBorder(true), bRightBorder(true)
101
{
101
{
Lines 103-115 Link Here
103
103
104
//-----------------------------------------------------------------------
104
//-----------------------------------------------------------------------
105
105
106
long SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
106
sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
107
{
107
{
108
	const SwFrmFmt *pFmt = pBox->GetFrmFmt();
108
	const SwFrmFmt *pFmt = pBox->GetFrmFmt();
109
	const SwFmtFrmSize& aFrmSize=
109
	const SwFmtFrmSize& aFrmSize=
110
        (const SwFmtFrmSize&)pFmt->GetFmtAttr( RES_FRM_SIZE );
110
        (const SwFmtFrmSize&)pFmt->GetFmtAttr( RES_FRM_SIZE );
111
111
112
	return aFrmSize.GetSize().Width();
112
	return sal::static_int_cast<sal_uInt32>(aFrmSize.GetSize().Width());
113
}
113
}
114
114
115
long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
115
long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
Lines 422-430 Link Here
422
}
422
}
423
423
424
void SwWriteTable::CollectTableRowsCols( long nStartRPos,
424
void SwWriteTable::CollectTableRowsCols( long nStartRPos,
425
										   USHORT nStartCPos,
425
										   sal_uInt32 nStartCPos,
426
										   long nParentLineHeight,
426
										   long nParentLineHeight,
427
										   USHORT nParentLineWidth,
427
										   sal_uInt32 nParentLineWidth,
428
										   const SwTableLines& rLines,
428
										   const SwTableLines& rLines,
429
										   USHORT nDepth )
429
										   USHORT nDepth )
430
{
430
{
Lines 432-438 Link Here
432
	USHORT nLines = rLines.Count();
432
	USHORT nLines = rLines.Count();
433
433
434
#ifndef PRODUCT
434
#ifndef PRODUCT
435
	USHORT nEndCPos = 0;
435
	sal_uInt32 nEndCPos = 0;
436
#endif
436
#endif
437
437
438
	long nRPos = nStartRPos;
438
	long nRPos = nStartRPos;
Lines 487-502 Link Here
487
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
487
		const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
488
		USHORT nBoxes = rBoxes.Count();
488
		USHORT nBoxes = rBoxes.Count();
489
489
490
		USHORT nCPos = nStartCPos;
490
		sal_uInt32 nCPos = nStartCPos;
491
		for( USHORT nBox=0; nBox<nBoxes; nBox++ )
491
		for( USHORT nBox=0; nBox<nBoxes; nBox++ )
492
		{
492
		{
493
			const SwTableBox *pBox = rBoxes[nBox];
493
			const SwTableBox *pBox = rBoxes[nBox];
494
494
495
			USHORT nOldCPos = nCPos;
495
			sal_uInt32 nOldCPos = nCPos;
496
496
497
			if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0)  )
497
			if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0)  )
498
			{
498
			{
499
                nCPos = nCPos + (USHORT)GetBoxWidth( pBox );
499
                nCPos = nCPos + GetBoxWidth( pBox );
500
				SwWriteTableCol *pCol = new SwWriteTableCol( nCPos );
500
				SwWriteTableCol *pCol = new SwWriteTableCol( nCPos );
501
501
502
				USHORT nCol;
502
				USHORT nCol;
Lines 515-521 Link Here
515
			else
515
			else
516
			{
516
			{
517
#ifndef PRODUCT
517
#ifndef PRODUCT
518
				USHORT nCheckPos = nCPos + (USHORT)GetBoxWidth( pBox );
518
				sal_uInt32 nCheckPos = nCPos + GetBoxWidth( pBox );
519
				if( !nEndCPos )
519
				if( !nEndCPos )
520
				{
520
				{
521
					nEndCPos = nCheckPos;
521
					nEndCPos = nCheckPos;
Lines 553-561 Link Here
553
553
554
554
555
void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
555
void SwWriteTable::FillTableRowsCols( long nStartRPos, USHORT nStartRow,
556
										USHORT nStartCPos, USHORT nStartCol,
556
										sal_uInt32 nStartCPos, USHORT nStartCol,
557
										long nParentLineHeight,
557
										long nParentLineHeight,
558
										USHORT nParentLineWidth,
558
										sal_uInt32 nParentLineWidth,
559
										const SwTableLines& rLines,
559
										const SwTableLines& rLines,
560
										const SvxBrushItem* pParentBrush,
560
										const SvxBrushItem* pParentBrush,
561
										USHORT nDepth,
561
										USHORT nDepth,
Lines 658-664 Link Here
658
		}
658
		}
659
659
660
		USHORT nBoxes = rBoxes.Count();
660
		USHORT nBoxes = rBoxes.Count();
661
		USHORT nCPos = nStartCPos;
661
		sal_uInt32 nCPos = nStartCPos;
662
		USHORT nCol = nStartCol;
662
		USHORT nCol = nStartCol;
663
663
664
		for( USHORT nBox=0; nBox<nBoxes; nBox++ )
664
		for( USHORT nBox=0; nBox<nBoxes; nBox++ )
Lines 666-675 Link Here
666
			const SwTableBox *pBox = rBoxes[nBox];
666
			const SwTableBox *pBox = rBoxes[nBox];
667
667
668
			// Position der letzten ueberdeckten Spalte ermitteln
668
			// Position der letzten ueberdeckten Spalte ermitteln
669
			USHORT nOldCPos = nCPos;
669
			sal_uInt32 nOldCPos = nCPos;
670
			if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0) )
670
			if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0) )
671
			{
671
			{
672
                nCPos = nCPos + (USHORT)GetBoxWidth( pBox );
672
                nCPos = nCPos + GetBoxWidth( pBox );
673
				if( nBox==nBoxes-1 )
673
				if( nBox==nBoxes-1 )
674
					nParentLineWidth = nCPos - nStartCPos;
674
					nParentLineWidth = nCPos - nStartCPos;
675
			}
675
			}

Return to issue 97591