Kaydet (Commit) d8bb2a97 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#90003 Revert "SwTxtFormatter::NewPortion: fix lost SwFlyPortion"

This reverts commit 25c50ff9. The
original commit fixed a corner-case, but also broke a much more frequent
use case. Revert till we have a better solution for the corner-case.

Conflicts:
	sw/qa/extras/inc/swmodeltestbase.hxx
	sw/qa/extras/uiwriter/uiwriter.cxx

Change-Id: I0f90459e9bc372eeba18bf81c5d1dfcccbe21753
üst 9107771a
...@@ -72,7 +72,6 @@ public: ...@@ -72,7 +72,6 @@ public:
void testChineseConversionSimplifiedToTraditional(); void testChineseConversionSimplifiedToTraditional();
void testFdo85554(); void testFdo85554();
void testAutoCorr(); void testAutoCorr();
void testFdo87005();
void testMergeDoc(); void testMergeDoc();
void testCreatePortions(); void testCreatePortions();
void testBookmarkUndo(); void testBookmarkUndo();
...@@ -80,6 +79,7 @@ public: ...@@ -80,6 +79,7 @@ public:
void testFdo87448(); void testFdo87448();
void testTdf68183(); void testTdf68183();
void testCp1000115(); void testCp1000115();
void testTdf90003();
CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward); CPPUNIT_TEST(testReplaceForward);
...@@ -104,7 +104,6 @@ public: ...@@ -104,7 +104,6 @@ public:
CPPUNIT_TEST(testChineseConversionSimplifiedToTraditional); CPPUNIT_TEST(testChineseConversionSimplifiedToTraditional);
CPPUNIT_TEST(testFdo85554); CPPUNIT_TEST(testFdo85554);
CPPUNIT_TEST(testAutoCorr); CPPUNIT_TEST(testAutoCorr);
CPPUNIT_TEST(testFdo87005);
CPPUNIT_TEST(testMergeDoc); CPPUNIT_TEST(testMergeDoc);
CPPUNIT_TEST(testCreatePortions); CPPUNIT_TEST(testCreatePortions);
CPPUNIT_TEST(testBookmarkUndo); CPPUNIT_TEST(testBookmarkUndo);
...@@ -112,6 +111,7 @@ public: ...@@ -112,6 +111,7 @@ public:
CPPUNIT_TEST(testFdo87448); CPPUNIT_TEST(testFdo87448);
CPPUNIT_TEST(testTdf68183); CPPUNIT_TEST(testTdf68183);
CPPUNIT_TEST(testCp1000115); CPPUNIT_TEST(testCp1000115);
CPPUNIT_TEST(testTdf90003);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -648,15 +648,6 @@ void SwUiWriterTest::testAutoCorr() ...@@ -648,15 +648,6 @@ void SwUiWriterTest::testAutoCorr()
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getColumns()->getCount()); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getColumns()->getCount());
} }
void SwUiWriterTest::testFdo87005()
{
createDoc("fdo87005.odt");
xmlDocPtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
// This was 1, no SwFlyPortion was created for the second fly.
assertXPath(pXmlDoc, "//Special[@nType='POR_FLY']", 2);
}
void SwUiWriterTest::testMergeDoc() void SwUiWriterTest::testMergeDoc()
{ {
SwDoc* const pDoc1(createDoc("merge-change1.odt")); SwDoc* const pDoc1(createDoc("merge-change1.odt"));
...@@ -846,6 +837,16 @@ void SwUiWriterTest::testCp1000115() ...@@ -846,6 +837,16 @@ void SwUiWriterTest::testCp1000115()
xmlXPathFreeObject(pXmlObj); xmlXPathFreeObject(pXmlObj);
} }
void SwUiWriterTest::testTdf90003()
{
createDoc("tdf90003.odt");
xmlDocPtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
// This was 1: an unexpected fly portion was created, resulting in too
// large x position for the empty paragraph marker.
assertXPath(pXmlDoc, "//Special[@nType='POR_FLY']", 0);
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1303,13 +1303,6 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf ) ...@@ -1303,13 +1303,6 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
{ {
rInf.SetFull(true); rInf.SetFull(true);
CalcFlyWidth( rInf ); CalcFlyWidth( rInf );
// In case we have no portion to return, but CalcFlyWidth()
// created a fly portion, then return that. Otherwise such a
// fly portion would not be ever inserted to the layout.
if (!pPor)
pPor = rInf.GetFly();
return pPor; return pPor;
} }
cChar = rInf.GetChar( rInf.GetIdx() ); cChar = rInf.GetChar( rInf.GetIdx() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment