partial revert tdf79435 doc: round-trip legacy input formfields
Apparently import isn't always properly reading some of these
strings, so it is just garbage being round-tripped in some cases.
Let's just avoid that until such time as import might be fixed.
I couldn't readily identify the import problem. It even happens with
version eWW8 files and also TestBeltAndBraces() didn't seem to
prevent the problem.
These crashes are due to reading garbage:
/srv/crashtestdata/files/doc/ooo78311-1.doc
-DISTRICT_COURSE_OUTLINE_TEMPLATE.doc
/srv/crashtestdata/files/doc/kde79024-2.doc
-Ü2_Blanko.doc
/srv/crashtestdata/files/doc/ooo24395-1.doc
-stateapp-emp.doc
/srv/crashtestdata/files/doc/abi9921-1.doc
/srv/crashtestdata/files/doc/ooo59101-1.doc
-Hovedblankett.DOC
/srv/crashtestdata/files/doc/fdo48097-1.doc
-BR1010.doc
Change-Id: Iceaa53760867f06c73ab900c57f197dbc0fb8e65
Reviewed-on: https://gerrit.libreoffice.org/63938
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index ac7909e..547afcd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -733,18 +733,19 @@
uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
OUString sTmp;
xParameters->getByName("EntryMacro") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
xParameters->getByName("Help") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("F1Help"), sTmp);
xParameters->getByName("ExitMacro") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
// Doc import problems, so disabling tests
//xParameters->getByName("EntryMacro") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
//xParameters->getByName("Help") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("F1Help"), sTmp);
//xParameters->getByName("ExitMacro") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
xParameters->getByName("Hint") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("StatusHelp"), sTmp);
xParameters->getByName("Content") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("Camelcase"), sTmp);
xParameters->getByName("Format") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("TITLE CASE"), sTmp);
//xParameters->getByName("Content") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("Camelcase"), sTmp);
//xParameters->getByName("Format") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("TITLE CASE"), sTmp);
sal_uInt16 nMaxLength = 0;
xParameters->getByName("MaxLength") >>= nMaxLength;
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 14293e2..e85ec0e 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -75,18 +75,20 @@
uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
OUString sTmp;
xParameters->getByName("EntryMacro") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
xParameters->getByName("Help") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("F1Help"), sTmp);
xParameters->getByName("ExitMacro") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
// Too often the string reader can fail during import - fix that first to prevent round-tripping garbage.
// (for example BR-1010B.doc from tdf#48097)
//xParameters->getByName("EntryMacro") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
//xParameters->getByName("Help") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("F1Help"), sTmp);
//xParameters->getByName("ExitMacro") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("test"), sTmp);
xParameters->getByName("Description") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("StatusHelp"), sTmp);
xParameters->getByName("Content") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("Camelcase"), sTmp);
xParameters->getByName("Format") >>= sTmp;
CPPUNIT_ASSERT_EQUAL(OUString("TITLE CASE"), sTmp);
//xParameters->getByName("Content") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("Camelcase"), sTmp);
//xParameters->getByName("Format") >>= sTmp;
//CPPUNIT_ASSERT_EQUAL(OUString("TITLE CASE"), sTmp);
sal_uInt16 nMaxLength = 0;
xParameters->getByName("MaxLength") >>= nMaxLength;
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 0aec993..0127551 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -158,11 +158,10 @@
if (!aBookmarkName.isEmpty()) {
m_aFieldStack.back().SetBookmarkName(aBookmarkName);
m_aFieldStack.back().SetBookmarkType(ODF_FORMTEXT);
m_aFieldStack.back().getParameters()["Description"] <<= aFormula.msToolTip;
if ( aFormula.mbHelp && !aFormula.msHelp.isEmpty() )
m_aFieldStack.back().getParameters()["Help"] <<= aFormula.msHelp;
if ( aFormula.msToolTip.getLength() < 139 )
m_aFieldStack.back().getParameters()["Description"] <<= aFormula.msToolTip;
m_aFieldStack.back().getParameters()["Name"] <<= aFormula.msTitle;
if (aFormula.mnMaxLen)
if (aFormula.mnMaxLen && aFormula.mnMaxLen < 32768 )
m_aFieldStack.back().getParameters()["MaxLength"] <<= aFormula.mnMaxLen;
if ( aFormula.mfType == 1 )
@@ -175,15 +174,6 @@
m_aFieldStack.back().getParameters()["Type"] <<= OUString("currentDate");
else if ( aFormula.mfType == 5 )
m_aFieldStack.back().getParameters()["Type"] <<= OUString("calculated");
if ( !aFormula.msDefault.isEmpty() )
m_aFieldStack.back().getParameters()["Content"] <<= aFormula.msDefault;
if ( !aFormula.msFormatting.isEmpty() )
m_aFieldStack.back().getParameters()["Format"] <<= aFormula.msFormatting;
if ( !aFormula.msEntryMcr.isEmpty() )
m_aFieldStack.back().getParameters()["EntryMacro"] <<= aFormula.msEntryMcr;
if ( !aFormula.msExitMcr.isEmpty() )
m_aFieldStack.back().getParameters()["ExitMacro"] <<= aFormula.msExitMcr;
}
return eF_ResT::TEXT;
}