summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf78727.docxbin0 -> 15004 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx11
-rw-r--r--sw/source/core/doc/docedt.cxx3
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf78727.docx b/sw/qa/extras/uiwriter/data/tdf78727.docx
new file mode 100644
index 000000000000..a8787d49cc42
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf78727.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 875c2c184851..8ff9436570c5 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -204,6 +204,7 @@ public:
void testTableStyleUndo();
void testRedlineParam();
void testRedlineViewAuthor();
+ void testTdf78727();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -309,6 +310,7 @@ public:
CPPUNIT_TEST(testTableStyleUndo);
CPPUNIT_TEST(testRedlineParam);
CPPUNIT_TEST(testRedlineViewAuthor);
+ CPPUNIT_TEST(testTdf78727);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3899,6 +3901,15 @@ void SwUiWriterTest::testRedlineViewAuthor()
CPPUNIT_ASSERT_EQUAL(aAuthor, xField->getPropertyValue("Author").get<OUString>());
}
+void SwUiWriterTest::testTdf78727()
+{
+ SwDoc* pDoc = createDoc("tdf78727.docx");
+ SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+ // This was 1: make sure we don't loose the TextBox anchored inside the
+ // table that is moved inside a text frame.
+ CPPUNIT_ASSERT(SwTextBoxHelper::getCount(pPage) > 1);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 49e940c5c3fc..88e13c62abdc 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -212,7 +212,8 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
{
// If the Fly is deleted, all Flys in its content have to be deleted too.
const SwFormatContent &rContent = pFormat->GetContent();
- if( rContent.GetContentIdx() )
+ // But only fly formats own their content, not draw formats.
+ if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT)
{
DelFlyInRange( *rContent.GetContentIdx(),
SwNodeIndex( *rContent.GetContentIdx()->