summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/uiwriter/data2/tdf124261.docxbin0 -> 22327 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf124261.docx b/sw/qa/extras/uiwriter/data2/tdf124261.docx
new file mode 100644
index 000000000000..1d3efa5276f4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data2/tdf124261.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 27b4a4716586..9655d1e9b80c 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -32,6 +32,7 @@
#include <swtypes.hxx>
#include <fmtornt.hxx>
#include <xmloff/odffields.hxx>
+#include <txtfrm.hxx>
namespace
{
@@ -69,6 +70,7 @@ public:
void testCheckboxFormFieldInsertion();
void testDropDownFormFieldInsertion();
void testMixedFormFieldInsertion();
+ void testTdf124261();
CPPUNIT_TEST_SUITE(SwUiWriterTest2);
CPPUNIT_TEST(testRedlineMoveInsertInDelete);
@@ -97,6 +99,7 @@ public:
CPPUNIT_TEST(testCheckboxFormFieldInsertion);
CPPUNIT_TEST(testDropDownFormFieldInsertion);
CPPUNIT_TEST(testMixedFormFieldInsertion);
+ CPPUNIT_TEST(testTdf124261);
CPPUNIT_TEST_SUITE_END();
virtual std::unique_ptr<Resetter> preTest(const char* filename) override
@@ -1121,6 +1124,40 @@ void SwUiWriterTest2::testMixedFormFieldInsertion()
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pMarkAccess->getAllMarksCount());
}
+void SwUiWriterTest2::testTdf124261()
+{
+#if !defined(WNT)
+ // Make sure that pressing a key in a btlr cell frame causes an immediate, correct repaint.
+ SwDoc* pDoc = createDoc("tdf124261.docx");
+ SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+ SwFrame* pPageFrame = pLayout->GetLower();
+ CPPUNIT_ASSERT(pPageFrame->IsPageFrame());
+
+ SwFrame* pBodyFrame = pPageFrame->GetLower();
+ CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame());
+
+ SwFrame* pTabFrame = pBodyFrame->GetLower();
+ CPPUNIT_ASSERT(pTabFrame->IsTabFrame());
+
+ SwFrame* pRowFrame = pTabFrame->GetLower();
+ CPPUNIT_ASSERT(pRowFrame->IsRowFrame());
+
+ SwFrame* pCellFrame = pRowFrame->GetLower();
+ CPPUNIT_ASSERT(pCellFrame->IsCellFrame());
+
+ SwFrame* pFrame = pCellFrame->GetLower();
+ CPPUNIT_ASSERT(pFrame->IsTextFrame());
+
+ // Make sure that the text frame's area and the paint rectangle match.
+ // Without the accompanying fix in place, this test would have failed with 'Expected: 1721;
+ // Actual: 1547', i.e. an area other than the text frame was invalidated for a single-line
+ // paragraph.
+ SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pFrame);
+ SwRect aRect = pTextFrame->GetPaintSwRect();
+ CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top());
+#endif
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest2);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */