[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 15 13:50:37 UTC 2020
sw/qa/extras/tiledrendering/data/fieldmark.docx |binary
sw/qa/extras/tiledrendering/tiledrendering.cxx | 9 ++++++++-
sw/source/core/crsr/viscrs.cxx | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 77870621351acdeb116f7213bf8a6b064f422590
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Apr 15 12:27:55 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Apr 15 15:50:07 2020 +0200
sw: avoid calling SwView::GetWrtShell() unconditionally from the SwView ctor
Regression from commit dfcfdf47b5da6a11b2c3118a0f63cc48c10c2cd7 (lok:
get spelling context menu on long press, 2019-10-20), the problem was
that GetWrtShell() returns a reference, and the underlying pointer can
be nullptr till the SwView ctor is in progress.
Fix the problem by not caring about spelling till the initial view is
ready, that still provides the cursor position.
(cherry picked from commit ae3342857350c805f536c1af2f560a117be12da8)
Conflicts:
sw/qa/extras/tiledrendering/tiledrendering.cxx
Change-Id: I5580a1b36b83e0a4cb8495f41e7087c784f6c83c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92268
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/qa/extras/tiledrendering/data/fieldmark.docx b/sw/qa/extras/tiledrendering/data/fieldmark.docx
new file mode 100644
index 000000000000..02748bb7e182
Binary files /dev/null and b/sw/qa/extras/tiledrendering/data/fieldmark.docx differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index e1fdbcc4b97b..2771b76fda79 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -122,6 +122,7 @@ public:
void testDeselectCustomShape();
void testHyperlink();
void testRedlineNotificationDuringSave();
+ void testFieldmark();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -185,6 +186,7 @@ public:
CPPUNIT_TEST(testDeselectCustomShape);
CPPUNIT_TEST(testHyperlink);
CPPUNIT_TEST(testRedlineNotificationDuringSave);
+ CPPUNIT_TEST(testFieldmark);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2489,7 +2491,6 @@ void SwTiledRenderingTest::testHyperlink()
CPPUNIT_ASSERT_EQUAL(OString("http://example.com/"), m_sHyperlinkLink);
}
-
void SwTiledRenderingTest::testRedlineNotificationDuringSave()
{
// Load a document with redlines which are hidden at a layout level.
@@ -2508,6 +2509,12 @@ void SwTiledRenderingTest::testRedlineNotificationDuringSave()
xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
}
+void SwTiledRenderingTest::testFieldmark()
+{
+ // Without the accompanying fix in place, this crashed on load.
+ createDoc("fieldmark.docx");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 62f7f033da63..6161c1994822 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -232,7 +232,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
// is cursor at a mispelled word ?
bool bIsWrong = false;
- if (pView)
+ if (pView && pView->GetWrtShellPtr())
{
const SwViewOption* pVOpt = pView->GetWrtShell().GetViewOptions();
if(pVOpt && pVOpt->IsOnlineSpell())
More information about the Libreoffice-commits
mailing list