sc/source/ui/view/gridwin.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
New commits: commit a3f4d31783721f61b8436c5f8032321b4c97de1a Author: Bayram Çiçek <bayram.ci...@collabora.com> AuthorDate: Mon May 27 12:14:56 2024 +0300 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue May 28 14:11:23 2024 +0200 add AutoFill menu items - LOK_CALLBACK_CONTEXT_MENU - added AutoFill menu items "Copy cells" and "Fill series" - send information with LOK_CALLBACK_CONTEXT_MENU Signed-off-by: Bayram Çiçek <bayram.ci...@collabora.com> Change-Id: I3118f5535f74cfa4ab049e643930df83512b6850 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168086 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1a36f83d88a8..b5cd268e4cc4 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2366,7 +2366,36 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) } } else + { 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())); + } } else if (mrViewData.GetFillMode() == ScFillMode::MATRIX) {