summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-07 12:11:22 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-07 15:55:49 +0200
commit4d599b5a9702863be8c5927ab657d4a3805570e7 (patch)
treee961ae09a8d5399245ad60e5906ce53da3bfaca6 /sc/source/ui/view
parente2128b2ea88460bd33ec9b70974366699ef5ccae (diff)
prep AutoFill menu in kit mode only
Change-Id: Id533d78e1433b616ce661e855dad0d571d24cf8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168524 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/gridwin.cxx55
1 files changed, 29 insertions, 26 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index dcc4361a313f..5d298458cb75 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2370,32 +2370,35 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
mrViewData.GetDispatcher().Execute( FID_FILL_AUTO, SfxCallMode::SLOT | SfxCallMode::RECORD );
- // prepare AutoFill menu items for "Copy Cells" and "Fill Series"
- ScTabViewShell* pViewShell = mrViewData.GetViewShell();
- boost::property_tree::ptree aMenu;
- boost::property_tree::ptree aItemTree;
-
- aItemTree.put("text", "~Copy Cells");
- aItemTree.put("type", "command");
- aItemTree.put("command", ".uno:AutoFill?Copy:bool=true");
- aItemTree.put("enabled", "true");
- aMenu.push_back(std::make_pair("", aItemTree));
-
- aItemTree.put("text", "~Fill Series");
- aItemTree.put("type", "command");
- aItemTree.put("command", ".uno:AutoFill?Copy:bool=false");
- aItemTree.put("enabled", "true");
- aMenu.push_back(std::make_pair("", aItemTree));
- aItemTree.clear();
-
- boost::property_tree::ptree aRoot;
- aRoot.add_child("menu", aMenu);
-
- std::stringstream aStream;
- boost::property_tree::write_json(aStream, aRoot, true);
-
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU,
- OString(aStream.str()));
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // prepare AutoFill menu items for "Copy Cells" and "Fill Series"
+ ScTabViewShell* pViewShell = mrViewData.GetViewShell();
+ boost::property_tree::ptree aMenu;
+ boost::property_tree::ptree aItemTree;
+
+ aItemTree.put("text", "~Copy Cells");
+ aItemTree.put("type", "command");
+ aItemTree.put("command", ".uno:AutoFill?Copy:bool=true");
+ aItemTree.put("enabled", "true");
+ aMenu.push_back(std::make_pair("", aItemTree));
+
+ aItemTree.put("text", "~Fill Series");
+ aItemTree.put("type", "command");
+ aItemTree.put("command", ".uno:AutoFill?Copy:bool=false");
+ aItemTree.put("enabled", "true");
+ aMenu.push_back(std::make_pair("", aItemTree));
+ aItemTree.clear();
+
+ boost::property_tree::ptree aRoot;
+ aRoot.add_child("menu", aMenu);
+
+ std::stringstream aStream;
+ boost::property_tree::write_json(aStream, aRoot, true);
+
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU,
+ OString(aStream.str()));
+ }
}
}
else if (mrViewData.GetFillMode() == ScFillMode::MATRIX)