summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2020-05-07 12:08:39 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2020-05-09 09:36:15 +0200
commit0bd0903369d3a55052a6727c0489369a537d540c (patch)
treeab95a6c74e5b40def83cc6d5db11454e1fb11572 /sw
parent8692addd7ba2e60132500b695eb606d3b9c7703a (diff)
lok: MSForms: dont send form field button data with empty text area.
Change-Id: I88d793765b58a3c483aad51d1a0e2e9f0159d5f1
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx19
-rw-r--r--sw/source/core/crsr/bookmrk.cxx3
2 files changed, 4 insertions, 18 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 7446d5397b20..8ef00b63908f 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -2534,24 +2534,7 @@ void SwTiledRenderingTest::testDropDownFormFieldButton()
// Move the cursor to trigger displaying of the field button.
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
-
- CPPUNIT_ASSERT(!m_aFormFieldButton.isEmpty());
-
- // First we have a button with an empty text area.
- {
- std::stringstream aStream(m_aFormFieldButton.getStr());
- boost::property_tree::ptree aTree;
- boost::property_tree::read_json(aStream, aTree);
-
- OString sAction = aTree.get_child("action").get_value<std::string>().c_str();
- CPPUNIT_ASSERT_EQUAL(OString("show"), sAction);
-
- OString sType = aTree.get_child("type").get_value<std::string>().c_str();
- CPPUNIT_ASSERT_EQUAL(OString("drop-down"), sType);
-
- OString sTextArea = aTree.get_child("textArea").get_value<std::string>().c_str();
- CPPUNIT_ASSERT_EQUAL(OString("0, 0, -1, -1"), sTextArea);
- }
+ CPPUNIT_ASSERT(m_aFormFieldButton.isEmpty());
// Do a tile rendering to trigger the button message with a valide text area
size_t nCanvasWidth = 1024;
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 2f8a9e96b183..945312968e1e 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -583,6 +583,9 @@ namespace sw { namespace mark
OStringBuffer sPayload;
if (sAction == "show")
{
+ if(m_aPortionPaintArea.IsEmpty())
+ return;
+
sPayload = OStringLiteral("{\"action\": \"show\","
" \"type\": \"drop-down\", \"textArea\": \"") +
m_aPortionPaintArea.SVRect().toString() + "\",";