summaryrefslogtreecommitdiffstats
path: root/sw/qa/core/txtnode
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
commit9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch)
tree812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /sw/qa/core/txtnode
parentReleasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff)
downloadlibreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz
libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/core/txtnode')
-rw-r--r--sw/qa/core/txtnode/data/plain-content-control-copy.docxbin0 -> 12178 bytes
-rw-r--r--sw/qa/core/txtnode/txtnode.cxx23
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/core/txtnode/data/plain-content-control-copy.docx b/sw/qa/core/txtnode/data/plain-content-control-copy.docx
new file mode 100644
index 0000000000..80fecae26d
--- /dev/null
+++ b/sw/qa/core/txtnode/data/plain-content-control-copy.docx
Binary files differ
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index c2df8a407e..be4d971902 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -539,6 +539,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testSplitFlyAnchorSplit)
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Fly"), aPortionType);
}
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPlainContentControlCopy)
+{
+ // Given a document with a plain text content control, all text selected and copied to the
+ // clipboard:
+ createSwDoc("plain-content-control-copy.docx");
+ SwDocShell* pDocShell = getSwDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ pWrtShell->SelAll();
+ {
+ rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell);
+ xTransfer->Copy();
+ }
+
+ // When closing that document, then make sure we don't crash on shutdown:
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<util::XCloseable> xFrame(xModel->getCurrentController()->getFrame(),
+ uno::UNO_QUERY);
+ // Without the accompanying fix in place, this resulted in an assertion failure, a char style
+ // still had clients by the time it was deleted.
+ xFrame->close(false);
+ mxComponent.clear();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */