Bug 139269 - Pasting text into master slides shouldn't be allowed
Summary: Pasting text into master slides shouldn't be allowed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium minor
Assignee: Andreas Heinisch
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Master-Slide-View
  Show dependency treegraph
 
Reported: 2020-12-28 06:55 UTC by Aron Budea
Modified: 2025-11-13 06:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2020-12-28 06:55:53 UTC
Start a presentation, switch to Master view via View -> Slide Master, click into a text box, and paste text into it.

=> It's possible to paste text into a master slide.

Normal editing is disallowed, the placeholder entries can only be formatted, thus pasting shouldn't be allowed, either.

Observed using LO 7.2.0.0.alpha0+ (2577d9ecea199ca2c10d852cf279053a1b22faf7), 5.3.0.3 / Ubuntu. In earlier versions Impress crashes for me when I switch to Master view.
Comment 1 Sophie Sipasseuth 2023-05-05 08:47:06 UTC
Hello Aron,

Thank you for reporting the bug. I can confirm that the bug is present in master.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fb3a6b82b55a298eabf8f431f1451dc826642acd
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 2 QA Administrators 2025-05-05 03:10:19 UTC Comment hidden (noise)
Comment 3 Commit Notification 2025-11-04 20:44:03 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d2257fbe9111ba75bd8235f4d3089253a1dafc04

tdf#139269 - Prevent pasting text into master pages

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Andreas Heinisch 2025-11-04 20:49:46 UTC
Tried to come up with a unit test, but I was unable to paste via python into any object of the master view. I may provide the basic test here:


from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues

class tdf139269(UITestCase):

   def test_tdf139269_prevent_pasting_into_readonly_master_objects(self):
        with self.ui_test.create_doc_in_start_center("impress"):
            # Close template dialog at startup
            xTemplateDlg = self.xUITest.getTopFocusWindow()
            xCancelBtn = xTemplateDlg.getChild("close")
            self.ui_test.close_dialog_through_button(xCancelBtn)

            # Type some text and put it into the clipboard
            xImpressDoc = self.xUITest.getTopFocusWindow()
            xEditWin = xImpressDoc.getChild("impress_win")
            xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed_Obj_0"}))
            xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"test"}))
            xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
            self.xUITest.executeCommand(".uno:Copy")            

            # Open master view
            self.xUITest.executeCommand(".uno:SlideMasterPage")
            xMaster = self.xUITest.getTopFocusWindow().getChild("impress_win")
            xMaster.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed_Obj_2"}))
            # Does not work under any circumstance
            self.xUITest.executeCommand(".uno:Paste")
Comment 5 Commit Notification 2025-11-13 05:40:03 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/eb2e89096a022ac2264350e70fecd73eaa530cf8

tdf#139269: sd: add test

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Andreas Heinisch 2025-11-13 06:16:37 UTC
Thank you very much Xisco for the test! I did not think about a C++ test could test this feature. Thank you again.