summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/layout/data/tdf134685.docxbin0 -> 23322 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx10
-rw-r--r--writerfilter/source/dmapper/TableData.hxx9
-rw-r--r--writerfilter/source/dmapper/TableManager.cxx6
-rw-r--r--writerfilter/source/dmapper/TableManager.hxx2
5 files changed, 22 insertions, 5 deletions
diff --git a/sw/qa/extras/layout/data/tdf134685.docx b/sw/qa/extras/layout/data/tdf134685.docx
new file mode 100644
index 000000000000..86b59fa982f3
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf134685.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index eee85f5b9b72..5d70eec259b2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3121,6 +3121,16 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127606)
assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "260");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134685)
+{
+ createDoc("tdf134685.docx");
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ sal_Int32 nWidth
+ = getXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/infos/bounds", "width").toInt32();
+ // This was 2223: the content was only partially visible according to the lost cell width
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(14000), nWidth);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109077)
{
createDoc("tdf109077.docx");
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 9da80a620481..a88c6a477430 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -248,10 +248,15 @@ public:
nRet.push_back(aCell->getGridSpan());
return nRet;
}
- void setCurrentGridSpan(sal_uInt32 nSpan)
+ void setCurrentGridSpan(sal_uInt32 nSpan, bool bFirstCell = false)
{
if ( mCells.size() )
- mCells.back()->setGridSpan(nSpan);
+ {
+ if ( bFirstCell )
+ mCells.front()->setGridSpan(nSpan);
+ else
+ mCells.back()->setGridSpan(nSpan);
+ }
}
};
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index 9f29b2b437bf..8b49fbe509e0 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -72,9 +72,9 @@ std::vector<sal_uInt32> TableManager::getCurrentGridSpans()
return mTableDataStack.top()->getCurrentRow()->getGridSpans();
}
-void TableManager::setCurrentGridSpan(sal_uInt32 nGridSpan)
+void TableManager::setCurrentGridSpan(sal_uInt32 nGridSpan, bool bFirstCell)
{
- mTableDataStack.top()->getCurrentRow()->setCurrentGridSpan(nGridSpan);
+ mTableDataStack.top()->getCurrentRow()->setCurrentGridSpan(nGridSpan, bFirstCell);
}
sal_uInt32 TableManager::findColumn(const sal_uInt32 nRow, const sal_uInt32 nCell)
@@ -514,6 +514,8 @@ void TableManager::endRow()
{
// don't add gridBefore cells in not valid TextRange
setCurrentGridBefore(0);
+ setCurrentGridSpan(getCurrentGridSpans().front() + nGridBefore,
+ /*bFirstCell=*/true);
}
}
}
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index ba1b225b0cd9..234ba63f86bd 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -502,7 +502,7 @@ public:
sal_uInt32 getCurrentGridBefore();
void setCurrentGridBefore( sal_uInt32 nSkipGrids );
std::vector<sal_uInt32> getCurrentGridSpans();
- void setCurrentGridSpan( sal_uInt32 nGridSpan );
+ void setCurrentGridSpan( sal_uInt32 nGridSpan, bool bFirstCell = false );
/// Given a zero-based row/cell, return the zero-based grid it belongs to, or SAL_MAX_UINT16 for invalid.
sal_uInt32 findColumn( const sal_uInt32 nRow, const sal_uInt32 nCell );
/// Given a zero-based row/col, return the zero-based cell describing that grid, or SAL_MAX_UINT16 for invalid.