summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-10-13 20:16:22 +0300
committerJan Holesovsky <kendy@collabora.com>2020-10-19 09:51:03 +0200
commit5c5fa6597af973ebce48f983af8fdbb87789d03f (patch)
treed674e0bc91145407e8ed523814080ae1d603962c /sc
parent44b5084beb7380996b1eb9c7f946768834779b1c (diff)
Check render parameters for AutoSpellChecking
Change-Id: Ife2551b4023461da26e70ac3de505adf9d7db1e8 Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104274 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.cxx17
-rw-r--r--sc/source/ui/unoobj/docuno.cxx12
2 files changed, 28 insertions, 1 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 33a15349b70b..b6db96dc5473 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -112,6 +112,7 @@ public:
void testDeleteCellMultilineContent();
void testFunctionDlg();
void testSpellOnlineParameter();
+ void testSpellOnlineRenderParameter();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnHeaders);
@@ -158,6 +159,7 @@ public:
CPPUNIT_TEST(testDeleteCellMultilineContent);
CPPUNIT_TEST(testFunctionDlg);
CPPUNIT_TEST(testSpellOnlineParameter);
+ CPPUNIT_TEST(testSpellOnlineRenderParameter);
CPPUNIT_TEST_SUITE_END();
private:
@@ -604,6 +606,21 @@ void ScTiledRenderingTest::testViewCursors()
CPPUNIT_ASSERT(aView1.m_bViewCursorInvalidated);
}
+void ScTiledRenderingTest::testSpellOnlineRenderParameter()
+{
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ bool bSet = pDoc->GetDocOptions().IsAutoSpell();
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues =
+ {
+ comphelper::makePropertyValue(".uno:SpellOnline", uno::makeAny(!bSet)),
+ };
+ pModelObj->initializeForTiledRendering(aPropertyValues);
+
+ CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
+}
+
void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rArguments)
{
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b51e63419f57..9d2539a25bcd 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1173,7 +1173,7 @@ void ScModelObj::completeFunction(const OUString& rFunctionName)
}
}
-void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
+void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
{
SolarMutexGuard aGuard;
@@ -1182,6 +1182,16 @@ void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans
aAppOptions.SetAutoComplete(false);
SC_MOD()->SetAppOptions(aAppOptions);
+ for (const beans::PropertyValue& rValue : rArguments)
+ {
+ if (rValue.Name == ".uno:SpellOnline" && rValue.Value.has<bool>())
+ {
+ ScDocOptions options = GetDocument()->GetDocOptions();
+ options.SetAutoSpell(rValue.Value.get<bool>());
+ GetDocument()->SetDocOptions(options);
+ }
+ }
+
// show us the text exactly
ScInputOptions aInputOptions(SC_MOD()->GetInputOptions());
aInputOptions.SetTextWysiwyg(true);