summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx17
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 320ee898a2ed..1f48de38d086 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -130,6 +130,7 @@ public:
void testDropDownFormFieldButtonEditing();
void testDropDownFormFieldButtonNoSelection();
void testDropDownFormFieldButtonNoItem();
+ void testSpellOnlineRenderParameter();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -198,6 +199,7 @@ public:
CPPUNIT_TEST(testDropDownFormFieldButtonEditing);
CPPUNIT_TEST(testDropDownFormFieldButtonNoSelection);
CPPUNIT_TEST(testDropDownFormFieldButtonNoItem);
+ CPPUNIT_TEST(testSpellOnlineRenderParameter);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2743,6 +2745,21 @@ void SwTiledRenderingTest::testDropDownFormFieldButtonNoItem()
}
}
+void SwTiledRenderingTest::testSpellOnlineRenderParameter()
+{
+ SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ const SwViewOption* pOpt = pWrtShell->GetViewOptions();
+ bool bSet = pOpt->IsOnlineSpell();
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
+ {
+ {".uno:SpellOnline", uno::makeAny(!bSet)},
+ }));
+ pXTextDocument->initializeForTiledRendering(aPropertyValues);
+ CPPUNIT_ASSERT_EQUAL(!bSet, pOpt->IsOnlineSpell());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index be5c2ff289c3..2c4d8066b035 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3489,6 +3489,8 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
// switch.
pDocShell->SetView(pView);
}
+ else if (rValue.Name == ".uno:SpellOnline" && rValue.Value.has<bool>())
+ aViewOption.SetOnlineSpell(rValue.Value.get<bool>());
}
// Set the initial zoom value to 1; usually it is set in setClientZoom and