Kaydet (Commit) d3144a09 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Justin Luth

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: 's avatarJustin Luth <justin_luth@sil.org>
üst 956b39f4
......@@ -733,18 +733,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFi
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;
......
......@@ -75,18 +75,20 @@ DECLARE_WW8EXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFiel
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;
......
......@@ -158,11 +158,10 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr )
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 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr )
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment