summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/cellsh.cxx')
-rw-r--r--sc/source/ui/view/cellsh.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 58fd0ee27ace..7642274eead4 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -613,6 +613,29 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
bDisable = true;
}
+ // This is only a workaround, we don't want that text content copied
+ // in one view is pasted in a different view.
+ // This part of the patch takes care to disable the "Paste" entry
+ // in the context menu.
+ // TODO: implement a solution providing one clipboard per view
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard(nullptr);
+ if (pOwnClip)
+ {
+ ScDocument* pClipDoc = pOwnClip->GetDocument();
+ if (pClipDoc)
+ {
+ ScTabViewShell* pThisView = GetViewData()->GetViewShell();
+ ScTabViewShell* pSourceView = dynamic_cast<ScTabViewShell*>(pClipDoc->GetClipParam().getSourceView());
+ if (pThisView && pSourceView && pThisView != pSourceView)
+ {
+ bDisable = true;
+ }
+ }
+ }
+ }
+
if (bDisable)
{
rSet.DisableItem( SID_PASTE );