vcl/CustomTarget_qt5_moc.mk          |    1 
 vcl/CustomTarget_qt6_moc.mk          |    1 
 vcl/Library_vclplug_qt5.mk           |    1 
 vcl/Library_vclplug_qt6.mk           |    1 
 vcl/inc/qt5/QtInstanceEntry.hxx      |    7 +-----
 vcl/inc/qt5/QtInstanceTextView.hxx   |    7 +-----
 vcl/inc/qt5/QtInstanceTextWidget.hxx |   27 ++++++++++++++++++++++++
 vcl/inc/qt6/QtInstanceTextWidget.hxx |   12 ++++++++++
 vcl/qt5/QtInstanceComboBox.cxx       |   39 ++++++++++++++++++++++++++++++++---
 vcl/qt5/QtInstanceEntry.cxx          |    6 -----
 vcl/qt5/QtInstanceTextView.cxx       |    6 -----
 vcl/qt5/QtInstanceTextWidget.cxx     |   22 +++++++++++++++++++
 vcl/qt6/QtInstanceTextWidget.cxx     |   12 ++++++++++
 13 files changed, 119 insertions(+), 23 deletions(-)

New commits:
commit 6f7ff2579796841bb8bfeb5621fd5d6f0d68a9ca
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Jan 3 18:44:19 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Jan 4 15:05:00 2026 +0100

    tdf#130857 qt weld: Implement combobox clipboard logic
    
    Implement clipboard-related methods in
    QtInstanceComboBox by creating a QtInstanceEntry
    for the combobox's entry/QLineEdit and calling the corresponding
    weld::Entry methods.
    
    Change-Id: I0ed2c5180e36ab85ad7414a2069100490e05a62c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196458
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx
index bb4f7f6666d7..6da25a687505 100644
--- a/vcl/qt5/QtInstanceComboBox.cxx
+++ b/vcl/qt5/QtInstanceComboBox.cxx
@@ -314,11 +314,44 @@ void QtInstanceComboBox::set_entry_editable(bool 
bEditable)
     GetQtInstance().RunInMainThread([&] { m_pComboBox->setEditable(bEditable); 
});
 }
 
-void QtInstanceComboBox::cut_entry_clipboard() { assert(false && "Not 
implemented yet"); }
+void QtInstanceComboBox::cut_entry_clipboard()
+{
+    SolarMutexGuard g;
+
+    GetQtInstance().RunInMainThread([&] {
+        if (QLineEdit* pEdit = m_pComboBox->lineEdit())
+        {
+            QtInstanceEntry aEntry(pEdit);
+            aEntry.cut_clipboard();
+        }
+    });
+}
+
+void QtInstanceComboBox::copy_entry_clipboard()
+{
+    SolarMutexGuard g;
+
+    GetQtInstance().RunInMainThread([&] {
+        if (QLineEdit* pEdit = m_pComboBox->lineEdit())
+        {
+            QtInstanceEntry aEntry(pEdit);
+            aEntry.copy_clipboard();
+        }
+    });
+}
 
-void QtInstanceComboBox::copy_entry_clipboard() { assert(false && "Not 
implemented yet"); }
+void QtInstanceComboBox::paste_entry_clipboard()
+{
+    SolarMutexGuard g;
 
-void QtInstanceComboBox::paste_entry_clipboard() { assert(false && "Not 
implemented yet"); }
+    GetQtInstance().RunInMainThread([&] {
+        if (QLineEdit* pEdit = m_pComboBox->lineEdit())
+        {
+            QtInstanceEntry aEntry(pEdit);
+            aEntry.copy_clipboard();
+        }
+    });
+}
 
 void QtInstanceComboBox::set_font(const vcl::Font& rFont) { setFont(rFont); }
 
commit e16e437d16cbed23c3f1a4d6185127039753a171
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Jan 3 16:26:17 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Jan 4 15:04:50 2026 +0100

    tdf#130857 qt weld: Introduce QtInstanceTextWidget
    
    Move the duplicate logic to set the font (color) from
    QtInstanceEntry and QtInstanceTextView to a new
    shared base class QtInstanceTextWidget.
    
    Change-Id: I817aa8342b6126c8dcdd1cf2a6f0b137faf12db1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196457
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 918f1b6ca0f6..c55ac794504b 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -52,6 +52,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSpinButton.moc \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSpinner.moc \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTextView.moc \
+       $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTextWidget.moc \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceToggleButton.moc \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceToolbar.moc \
        $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTreeView.moc \
diff --git a/vcl/CustomTarget_qt6_moc.mk b/vcl/CustomTarget_qt6_moc.mk
index c90468650892..2f4eb8264c4c 100644
--- a/vcl/CustomTarget_qt6_moc.mk
+++ b/vcl/CustomTarget_qt6_moc.mk
@@ -52,6 +52,7 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSpinButton.moc \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSpinner.moc \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTextView.moc \
+       $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTextWidget.moc \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceToggleButton.moc \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceToolbar.moc \
        $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTreeView.moc \
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 954f497b0e97..d3deabaa9476 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -135,6 +135,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/QtInstanceSpinButton \
     vcl/qt5/QtInstanceSpinner \
     vcl/qt5/QtInstanceTextView \
+    vcl/qt5/QtInstanceTextWidget \
     vcl/qt5/QtInstanceToggleButton \
     vcl/qt5/QtInstanceToolbar \
     vcl/qt5/QtInstanceTreeIter \
diff --git a/vcl/Library_vclplug_qt6.mk b/vcl/Library_vclplug_qt6.mk
index 8408d417c07e..cb42295ab379 100644
--- a/vcl/Library_vclplug_qt6.mk
+++ b/vcl/Library_vclplug_qt6.mk
@@ -134,6 +134,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt6,\
     vcl/qt6/QtInstanceSpinButton \
     vcl/qt6/QtInstanceSpinner \
     vcl/qt6/QtInstanceTextView \
+    vcl/qt6/QtInstanceTextWidget \
     vcl/qt6/QtInstanceToggleButton \
     vcl/qt6/QtInstanceToolbar \
     vcl/qt6/QtInstanceTreeIter \
diff --git a/vcl/inc/qt5/QtInstanceEntry.hxx b/vcl/inc/qt5/QtInstanceEntry.hxx
index f57d2c27be8a..b3fe80204ffe 100644
--- a/vcl/inc/qt5/QtInstanceEntry.hxx
+++ b/vcl/inc/qt5/QtInstanceEntry.hxx
@@ -9,13 +9,13 @@
 
 #pragma once
 
-#include "QtInstanceWidget.hxx"
+#include "QtInstanceTextWidget.hxx"
 
 #include <vcl/weld/Entry.hxx>
 
 #include <QtWidgets/QLineEdit>
 
-class QtInstanceEntry : public QtInstanceWidget, public virtual weld::Entry
+class QtInstanceEntry : public QtInstanceTextWidget, public virtual weld::Entry
 {
     Q_OBJECT;
 
@@ -43,9 +43,6 @@ public:
     virtual void set_overwrite_mode(bool bOn) override;
     virtual bool get_overwrite_mode() const override;
 
-    virtual void set_font(const vcl::Font& rFont) override;
-    virtual void set_font_color(const Color& rColor) override;
-
     virtual void set_alignment(TxtAlign eXAlign) override;
 
     static void setMessageType(QLineEdit& rLineEdit, weld::EntryMessageType 
eType);
diff --git a/vcl/inc/qt5/QtInstanceTextView.hxx 
b/vcl/inc/qt5/QtInstanceTextView.hxx
index b9c068cd8f7f..8ded0693864e 100644
--- a/vcl/inc/qt5/QtInstanceTextView.hxx
+++ b/vcl/inc/qt5/QtInstanceTextView.hxx
@@ -9,13 +9,13 @@
 
 #pragma once
 
-#include "QtInstanceWidget.hxx"
+#include "QtInstanceTextWidget.hxx"
 
 #include <vcl/weld/TextView.hxx>
 
 #include <QtWidgets/QPlainTextEdit>
 
-class QtInstanceTextView : public QtInstanceWidget, public virtual 
weld::TextView
+class QtInstanceTextView : public QtInstanceTextWidget, public virtual 
weld::TextView
 {
     Q_OBJECT
 
@@ -34,9 +34,6 @@ public:
     virtual void set_monospace(bool bMonospace) override;
     virtual void set_max_length(int nChars) override;
 
-    virtual void set_font(const vcl::Font& rFont) override;
-    virtual void set_font_color(const Color& rColor) override;
-
     virtual bool can_move_cursor_with_up() const override;
     virtual bool can_move_cursor_with_down() const override;
 
diff --git a/vcl/inc/qt5/QtInstanceTextWidget.hxx 
b/vcl/inc/qt5/QtInstanceTextWidget.hxx
new file mode 100644
index 000000000000..d8f9dff42a20
--- /dev/null
+++ b/vcl/inc/qt5/QtInstanceTextWidget.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include "QtInstanceWidget.hxx"
+
+#include <vcl/weld/TextWidget.hxx>
+
+class QtInstanceTextWidget : public QtInstanceWidget, public virtual 
weld::TextWidget
+{
+    Q_OBJECT
+
+public:
+    QtInstanceTextWidget(QWidget* pWidget);
+
+    virtual void set_font(const vcl::Font& rFont) override;
+    virtual void set_font_color(const Color& rColor) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/inc/qt6/QtInstanceTextWidget.hxx 
b/vcl/inc/qt6/QtInstanceTextWidget.hxx
new file mode 100644
index 000000000000..610e0aee6920
--- /dev/null
+++ b/vcl/inc/qt6/QtInstanceTextWidget.hxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "../qt5/QtInstanceTextWidget.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/qt5/QtInstanceEntry.cxx b/vcl/qt5/QtInstanceEntry.cxx
index e15619a59583..0edc26df653d 100644
--- a/vcl/qt5/QtInstanceEntry.cxx
+++ b/vcl/qt5/QtInstanceEntry.cxx
@@ -15,7 +15,7 @@
 #include <QtGui/QIcon>
 
 QtInstanceEntry::QtInstanceEntry(QLineEdit* pLineEdit)
-    : QtInstanceWidget(pLineEdit)
+    : QtInstanceTextWidget(pLineEdit)
     , m_pLineEdit(pLineEdit)
 {
     assert(m_pLineEdit);
@@ -176,10 +176,6 @@ bool QtInstanceEntry::get_overwrite_mode() const
     return false;
 }
 
-void QtInstanceEntry::set_font(const vcl::Font& rFont) { setFont(rFont); }
-
-void QtInstanceEntry::set_font_color(const Color& rColor) { 
setFontColor(rColor); }
-
 void QtInstanceEntry::set_alignment(TxtAlign eXAlign)
 {
     SolarMutexGuard g;
diff --git a/vcl/qt5/QtInstanceTextView.cxx b/vcl/qt5/QtInstanceTextView.cxx
index ce4cd83d9408..37de3790249d 100644
--- a/vcl/qt5/QtInstanceTextView.cxx
+++ b/vcl/qt5/QtInstanceTextView.cxx
@@ -16,7 +16,7 @@
 #include <QtWidgets/QScrollBar>
 
 QtInstanceTextView::QtInstanceTextView(QPlainTextEdit* pTextEdit)
-    : QtInstanceWidget(pTextEdit)
+    : QtInstanceTextWidget(pTextEdit)
     , m_pTextEdit(pTextEdit)
 {
     assert(m_pTextEdit);
@@ -108,10 +108,6 @@ void QtInstanceTextView::set_monospace(bool bMonospace)
 
 void QtInstanceTextView::set_max_length(int) { assert(false && "Not 
implemented yet"); }
 
-void QtInstanceTextView::set_font(const vcl::Font& rFont) { setFont(rFont); }
-
-void QtInstanceTextView::set_font_color(const Color& rColor) { 
setFontColor(rColor); }
-
 bool QtInstanceTextView::can_move_cursor_with_up() const
 {
     assert(false && "Not implemented yet");
diff --git a/vcl/qt5/QtInstanceTextWidget.cxx b/vcl/qt5/QtInstanceTextWidget.cxx
new file mode 100644
index 000000000000..f590d66b8c1a
--- /dev/null
+++ b/vcl/qt5/QtInstanceTextWidget.cxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <QtInstanceTextWidget.hxx>
+#include <QtInstanceTextWidget.moc>
+
+QtInstanceTextWidget::QtInstanceTextWidget(QWidget* pWidget)
+    : QtInstanceWidget(pWidget)
+{
+}
+
+void QtInstanceTextWidget::set_font(const vcl::Font& rFont) { setFont(rFont); }
+
+void QtInstanceTextWidget::set_font_color(const Color& rColor) { 
setFontColor(rColor); }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/qt6/QtInstanceTextWidget.cxx b/vcl/qt6/QtInstanceTextWidget.cxx
new file mode 100644
index 000000000000..b9d9e161c7d3
--- /dev/null
+++ b/vcl/qt6/QtInstanceTextWidget.cxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "../qt5/QtInstanceTextWidget.cxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to