summaryrefslogtreecommitdiff
path: root/sw
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 16:37:45 +0100
commit2ad1f195b875f2c1052c8ffab79602b9f6871ccb (patch)
treea60d6f77dd34d01f747259dea33c0fa30829a900 /sw
parentdfa26e6d489a2c5bd79652450a9f27343008d37f (diff)
bnc#636128 DOC export: handle FFData.cch
Change-Id: Ia1a3a4ef5e61d8ed2a3bde689f3d2101525efc46
Diffstat (limited to 'sw')
-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 e97302947c9e..c1e6ca681a20 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -16,6 +16,7 @@
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
+#include <com/sun/star/text/XFormField.hpp>
class Test : public SwModelTestBase
{
@@ -378,6 +379,15 @@ DECLARE_WW8EXPORT_TEST(testCellBgColor, "cell-bg-color.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor"));
}
+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 58718c238b27..97629aeafb38 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3783,6 +3783,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)