summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-04 15:36:02 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-04 19:12:50 +0100
commit282bd32aac90f81520a4dd5cbb13053f6dbf6ed7 (patch)
tree0aedfe7a5f7a05a07618932fb94b785d9d32371d
parent3a40e9d4b2338e8650c921ff4c8c2bb9e7cba33b (diff)
bnc#636128 DOC export: handle FFData.cch
Change-Id: Ia1a3a4ef5e61d8ed2a3bde689f3d2101525efc46 (cherry picked from commit 2ad1f195b875f2c1052c8ffab79602b9f6871ccb)
-rw-r--r--sw/qa/extras/ww8export/data/bnc636128.docbin0 -> 26112 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx10
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx10
3 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/bnc636128.doc b/sw/qa/extras/ww8export/data/bnc636128.doc
new file mode 100644
index 000000000000..5f92c3e2ecd1
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/bnc636128.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 8a611e6d3fd4..b4037ed27441 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -17,6 +17,7 @@
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
+#include <com/sun/star/text/XFormField.hpp>
class Test : public SwModelTestBase
{
@@ -215,6 +216,15 @@ DECLARE_WW8EXPORT_TEST(testFdo59530, "fdo59530.doc")
#endif
+DECLARE_WW8EXPORT_TEST(testBnc636128, "bnc636128.doc")
+{
+ // Import / export of FFData.cch was missing.
+ uno::Reference<text::XFormField> xFormField = getProperty< uno::Reference<text::XFormField> >(getRun(getParagraph(1), 2), "Bookmark");
+ uno::Reference<container::XNameContainer> xParameters = xFormField->getParameters();
+ // This resulted in a container.NoSuchElementException.
+ CPPUNIT_ASSERT_EQUAL(OUString("5"), xParameters->getByName("MaxLength").get<OUString>());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 7530668a0926..ec558c9aaa5f 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3663,6 +3663,16 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
ffres = 0;
}
aFldHeader.bits |= ( (ffres<<2) & 0x7C );
+ if (type == 0) // iTypeText
+ {
+ sw::mark::IFieldmark::parameter_map_t::const_iterator pParameter = rFieldmark.GetParameters()->find("MaxLength");
+ if (pParameter != rFieldmark.GetParameters()->end())
+ {
+ OUString aLength;
+ pParameter->second >>= aLength;
+ aFldHeader.cch = aLength.toUInt32();
+ }
+ }
std::vector< OUString > aListItems;
if (type==2)