diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2020-10-13 20:16:22 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-26 09:07:10 +0100 |
commit | b2f4e18f63457d11a783db939729450ddbe9d594 (patch) | |
tree | e1f0e1f0acf47188f2233c00aaa710086af503c4 /sw | |
parent | 7ca0f29249eb11623c98efdc4fb6d0d7725ff10a (diff) |
Check render parameters for AutoSpellChecking
Conflicts:
sc/qa/unit/tiledrendering/tiledrendering.cxx
sw/qa/extras/tiledrendering/tiledrendering.cxx
Change-Id: Ife2551b4023461da26e70ac3de505adf9d7db1e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106602
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 17 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index afb261b4d4bc..752f2431630a 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -145,6 +145,7 @@ public: void testDropDownFormFieldButtonNoSelection(); void testDropDownFormFieldButtonNoItem(); void testTablePaintInvalidate(); + void testSpellOnlineRenderParameter(); CPPUNIT_TEST_SUITE(SwTiledRenderingTest); CPPUNIT_TEST(testRegisterCallback); @@ -217,6 +218,7 @@ public: CPPUNIT_TEST(testDropDownFormFieldButtonNoSelection); CPPUNIT_TEST(testDropDownFormFieldButtonNoItem); CPPUNIT_TEST(testTablePaintInvalidate); + CPPUNIT_TEST(testSpellOnlineRenderParameter); CPPUNIT_TEST_SUITE_END(); private: @@ -2869,6 +2871,21 @@ void SwTiledRenderingTest::testTablePaintInvalidate() CPPUNIT_ASSERT_EQUAL(0, m_nInvalidations); } +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 d3f70fb77a0b..2a723e185a64 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3471,6 +3471,8 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css:: // switch. m_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 |