Update to m13
[ooovba.git] / applied_patches / 0826-cws-ooxml03-docx-sw-fix-table-width-height.diff
blob396a528924f0db8c72fbaef465a0b0c565090086
1 Index: wrtww8.cxx
2 ===================================================================
3 --- sw/source/filter/docx/docx-wrtww8.cxx (revision 270990)
4 +++ sw/source/filter/docx/docx-wrtww8.cxx (working copy)
5 @@ -2146,9 +2146,11 @@
6 m_rWW8Export.InsUInt16( nTblOffset );
8 std::vector<SwTwips> gridCols = GetGridCols( pTableTextNodeInfoInner );
9 + SwTwips nSum = 0;
10 for ( std::vector<SwTwips>::const_iterator it = gridCols.begin(); it != gridCols.end(); ++it )
12 - m_rWW8Export.InsUInt16( static_cast<USHORT>( *it ) + nTblOffset );
13 + nSum += *it;
14 + m_rWW8Export.InsUInt16( static_cast<USHORT>( nSum ) + nTblOffset );
17 /* TCs */
18 @@ -2206,14 +2208,11 @@
20 GetTablePageSize( pTableTextNodeInfoInner, nPageSize, bRelBoxSize );
22 - SwTwips nSz = 0;
24 for ( sal_uInt32 n = 0; n < nBoxes; n++ )
26 const SwFrmFmt* pBoxFmt = rTabBoxes[ n ]->GetFrmFmt();
27 const SwFmtFrmSize& rLSz = pBoxFmt->GetFrmSize();
28 - nSz += rLSz.GetWidth();
29 - SwTwips nCalc = nSz;
30 + SwTwips nCalc = rLSz.GetWidth();
31 if (bRelBoxSize)
32 nCalc = (nCalc * nPageSize) / nTblSz;
34 Index: docxattributeoutput.cxx
35 ===================================================================
36 --- sw/source/filter/docx/docx-docxattributeoutput.cxx (revision 271264)
37 +++ sw/source/filter/docx/docx-docxattributeoutput.cxx (working copy)
38 @@ -1145,7 +1145,7 @@
39 TableBackgrounds( pTableTextNodeInfoInner );
41 // Cell prefered width
42 - USHORT nWidth = m_pTableWrt->GetAbsWidth( pTableTextNodeInfoInner->getCell( ), 1 );
43 + SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )[ pTableTextNodeInfoInner->getCell() ];
44 m_pSerializer->singleElementNS( XML_w, XML_tcW,
45 FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ),
46 FSNS( XML_w, XML_type ), "dxa",
47 @@ -1382,21 +1382,25 @@
48 const SwTableLine * pTabLine = pTabBox->GetUpper();
49 const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
51 - long nHeight = 0;
52 const SwFmtFrmSize& rLSz = pLineFmt->GetFrmSize();
53 if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
55 - if ( ATT_MIN_SIZE == rLSz.GetHeightSizeType() )
56 - nHeight = rLSz.GetHeight();
57 - else
58 - nHeight = -rLSz.GetHeight();
59 + sal_Int32 nHeight = rLSz.GetHeight();
60 + const char *pRule = NULL;
62 + switch ( rLSz.GetHeightSizeType() )
63 + {
64 + case ATT_FIX_SIZE: pRule = "exact"; break;
65 + case ATT_MIN_SIZE: pRule = "atLeast"; break;
66 + default: break;
67 + }
69 + if ( pRule )
70 + m_pSerializer->singleElementNS( XML_w, XML_trHeight,
71 + FSNS( XML_w, XML_val ), OString::valueOf( nHeight ).getStr( ),
72 + FSNS( XML_w, XML_hRule ), pRule,
73 + FSEND );
76 - if ( nHeight )
77 - m_pSerializer->singleElementNS( XML_w, XML_trHeight,
78 - FSNS( XML_w, XML_val ), OString::valueOf( sal_Int32( nHeight ) ).getStr( ),
79 - FSNS( XML_w, XML_hRule ), "exact",
80 - FSEND );
83 void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )