html export: Fix export of checked checkbox and radiobutton.
Change-Id: Ia77f9840df7508d96292aac63e65714a7892342f
This commit is contained in:
@@ -56,6 +56,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_htmlexport,\
|
|||||||
canvas/source/factory/canvasfactory \
|
canvas/source/factory/canvasfactory \
|
||||||
comphelper/util/comphelp \
|
comphelper/util/comphelp \
|
||||||
configmgr/source/configmgr \
|
configmgr/source/configmgr \
|
||||||
|
dbaccess/util/dba \
|
||||||
embeddedobj/util/embobj \
|
embeddedobj/util/embobj \
|
||||||
filter/source/config/cache/filterconfig1 \
|
filter/source/config/cache/filterconfig1 \
|
||||||
filter/source/storagefilterdetect/storagefd \
|
filter/source/storagefilterdetect/storagefd \
|
||||||
|
BIN
sw/qa/extras/htmlexport/data/checkbox-radiobutton.doc
Normal file
BIN
sw/qa/extras/htmlexport/data/checkbox-radiobutton.doc
Normal file
Binary file not shown.
@@ -200,6 +200,26 @@ DECLARE_HTMLEXPORT_TEST(testExportImageProperties, "HTMLImage.odt")
|
|||||||
assertXPath(pDoc, "/html/body/p/a/font/img", "usemap", "#map1");
|
assertXPath(pDoc, "/html/body/p/a/font/img", "usemap", "#map1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutton.doc")
|
||||||
|
{
|
||||||
|
htmlDocPtr pDoc = parseHtml(maTempFile);
|
||||||
|
CPPUNIT_ASSERT(pDoc);
|
||||||
|
|
||||||
|
assertXPath(pDoc, "/html/body", 1);
|
||||||
|
assertXPath(pDoc, "/html/body/p[1]/input", "type", "checkbox");
|
||||||
|
assertXPath(pDoc, "/html/body/p[1]/input", "checked", "checked");
|
||||||
|
assertXPath(pDoc, "/html/body/p[2]/input", "type", "checkbox");
|
||||||
|
assertXPathNoAttribute(pDoc, "/html/body/p[2]/input", "checked");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[1]/input", "type", "checkbox");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[1]/input", "checked", "checked");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[2]/input", "type", "checkbox");
|
||||||
|
assertXPathNoAttribute(pDoc, "/html/body/form/p[2]/input", "checked");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[3]/input", "type", "radio");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[3]/input", "checked", "checked");
|
||||||
|
assertXPath(pDoc, "/html/body/form/p[4]/input", "type", "radio");
|
||||||
|
assertXPathNoAttribute(pDoc, "/html/body/form/p[4]/input", "checked");
|
||||||
|
}
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -752,6 +752,9 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
|
|||||||
TRISTATE_FALSE != *(sal_Int16*) aTmp.getValue() )
|
TRISTATE_FALSE != *(sal_Int16*) aTmp.getValue() )
|
||||||
{
|
{
|
||||||
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_checked);
|
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_checked);
|
||||||
|
sOptions += "=\"";
|
||||||
|
sOptions += OString(OOO_STRING_SVTOOLS_HTML_O_checked);
|
||||||
|
sOptions += "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
aTmp = xPropSet->getPropertyValue( "RefValue" );
|
aTmp = xPropSet->getPropertyValue( "RefValue" );
|
||||||
@@ -970,7 +973,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
|
|||||||
sOut = "\"";
|
sOut = "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
sOut = sOptions;
|
sOut += " " + sOptions;
|
||||||
|
|
||||||
if( TYPE_IMAGE == eType )
|
if( TYPE_IMAGE == eType )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user