summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-10-08 13:37:07 +0300
committerJan Holesovsky <kendy@collabora.com>2020-10-09 15:37:51 +0200
commitd90a404a078b9fc1baa98ec0eb3d6a90f869b336 (patch)
tree57e0cf761e5f8a42f32888edbdc4ae4dff0c4a13 /sc
parentd7a5298ac87453e7dbb343f93e6c70ce0508c44a (diff)
Added optional parameter Enabled for uno:SpellOnline
Change-Id: I3578b0a002ea2cdcc7893972607f26732ce545ea Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104083 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx25
-rw-r--r--sc/source/ui/app/scmod.cxx4
2 files changed, 28 insertions, 1 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 4962ebc5fb68..33a15349b70b 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -38,6 +38,7 @@
#include <vcl/unohelp2.hxx>
#include <sc.hrc>
#include <comphelper/string.hxx>
+#include <docoptio.hxx>
#include <chrono>
#include <cstddef>
@@ -110,6 +111,7 @@ public:
void testSheetGeometryDataCorrectness();
void testDeleteCellMultilineContent();
void testFunctionDlg();
+ void testSpellOnlineParameter();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnHeaders);
@@ -155,6 +157,7 @@ public:
CPPUNIT_TEST(testSheetGeometryDataCorrectness);
CPPUNIT_TEST(testDeleteCellMultilineContent);
CPPUNIT_TEST(testFunctionDlg);
+ CPPUNIT_TEST(testSpellOnlineParameter);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1684,6 +1687,28 @@ void ScTiledRenderingTest::testFunctionDlg()
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
}
+void ScTiledRenderingTest::testSpellOnlineParameter()
+{
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ bool bSet = pDoc->GetDocOptions().IsAutoSpell();
+
+ uno::Sequence<beans::PropertyValue> params =
+ {
+ comphelper::makePropertyValue("Enable", uno::makeAny(!bSet)),
+ };
+ lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
+
+ // set the same state as now and we don't expect any change (no-toggle)
+ params =
+ {
+ comphelper::makePropertyValue("Enable", uno::makeAny(!bSet)),
+ };
+ lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
+}
+
void ScTiledRenderingTest::testVbaRangeCopyPaste()
{
comphelper::LibreOfficeKit::setActive();
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 739d13322051..59fc059bf5ef 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -342,7 +342,9 @@ void ScModule::Execute( SfxRequest& rReq )
{
bool bSet;
const SfxPoolItem* pItem;
- if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
+ if (pReqArgs->HasItem(FN_PARAM_1, &pItem))
+ bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+ else if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
{ // Toggle