Revert "Implement export and import of author field in fixed format"
This reverts commit 5de40734af30a8b897c6c5b7f681759e36a25557. Change-Id: Ib09fb1dc54066cadcd9503c92140d78e7482ae6c Reviewed-on: https://gerrit.libreoffice.org/35281 Reviewed-by: Rosemary Sebastian <rosemaryseb8@gmail.com> Tested-by: Rosemary Sebastian <rosemaryseb8@gmail.com>
This commit is contained in:
parent
3e5aa33ef4
commit
cae16645e1
@ -181,16 +181,13 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
|
|||||||
SvxAuthorField* pData = new SvxAuthorField(
|
SvxAuthorField* pData = new SvxAuthorField(
|
||||||
aFirstName, aLastName, OUString(), bIsFixed ? SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
|
aFirstName, aLastName, OUString(), bIsFixed ? SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
|
||||||
|
|
||||||
if (!bIsFixed)
|
if (!bFullName)
|
||||||
{
|
{
|
||||||
if (!bFullName)
|
pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
|
||||||
{
|
}
|
||||||
pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
|
else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= SVXAUTHORFORMAT_SHORTNAME)
|
||||||
}
|
{
|
||||||
else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= SVXAUTHORFORMAT_SHORTNAME)
|
pData->SetFormat(static_cast<SvxAuthorFormat>(nFmt));
|
||||||
{
|
|
||||||
pData->SetFormat(static_cast<SvxAuthorFormat>(nFmt));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pData;
|
return pData;
|
||||||
|
Binary file not shown.
@ -92,7 +92,6 @@ public:
|
|||||||
void testTdf62176();
|
void testTdf62176();
|
||||||
void testTransparentBackground();
|
void testTransparentBackground();
|
||||||
void testEmbeddedPdf();
|
void testEmbeddedPdf();
|
||||||
void testAuthorField();
|
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(SdExportTest);
|
CPPUNIT_TEST_SUITE(SdExportTest);
|
||||||
|
|
||||||
@ -107,7 +106,6 @@ public:
|
|||||||
CPPUNIT_TEST(testTdf62176);
|
CPPUNIT_TEST(testTdf62176);
|
||||||
CPPUNIT_TEST(testTransparentBackground);
|
CPPUNIT_TEST(testTransparentBackground);
|
||||||
CPPUNIT_TEST(testEmbeddedPdf);
|
CPPUNIT_TEST(testEmbeddedPdf);
|
||||||
CPPUNIT_TEST(testAuthorField);
|
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
@ -554,23 +552,6 @@ void SdExportTest::testEmbeddedPdf()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SdExportTest::testAuthorField()
|
|
||||||
{
|
|
||||||
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_fixed.odp"), ODP);
|
|
||||||
|
|
||||||
xDocShRef = saveAndReload( xDocShRef.get(), ODP );
|
|
||||||
|
|
||||||
uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef);
|
|
||||||
CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() );
|
|
||||||
|
|
||||||
uno::Reference< beans::XPropertySet > xPropSet( xField, uno::UNO_QUERY_THROW );
|
|
||||||
bool bFixed = false;
|
|
||||||
xPropSet->getPropertyValue("IsFixed") >>= bFixed;
|
|
||||||
CPPUNIT_ASSERT_MESSAGE("Author field is not fixed", bFixed);
|
|
||||||
|
|
||||||
xDocShRef->DoClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
|
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@ -234,10 +234,6 @@ protected:
|
|||||||
virtual void StartElement(
|
virtual void StartElement(
|
||||||
const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) override;
|
const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList) override;
|
||||||
|
|
||||||
/// process attribute values
|
|
||||||
virtual void ProcessAttribute( sal_uInt16 nAttrToken,
|
|
||||||
const OUString& sAttrValue ) override;
|
|
||||||
|
|
||||||
/// prepare XTextField for insertion into document
|
/// prepare XTextField for insertion into document
|
||||||
virtual void PrepareField(
|
virtual void PrepareField(
|
||||||
const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override;
|
const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override;
|
||||||
|
@ -1055,11 +1055,8 @@ void XMLTextFieldExport::ExportFieldHelper(
|
|||||||
switch (nToken) {
|
switch (nToken) {
|
||||||
case FIELD_ID_AUTHOR:
|
case FIELD_ID_AUTHOR:
|
||||||
// author field: fixed, field (sub-)type
|
// author field: fixed, field (sub-)type
|
||||||
if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
|
ProcessBoolean(XML_FIXED,
|
||||||
{
|
GetBoolProperty(sPropertyIsFixed, rPropSet), true);
|
||||||
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FIXED,
|
|
||||||
(GetBoolProperty(sPropertyIsFixed, rPropSet) ? XML_TRUE : XML_FALSE) );
|
|
||||||
}
|
|
||||||
ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
|
ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -680,16 +680,6 @@ void XMLAuthorFieldImportContext::StartElement(
|
|||||||
XMLTextFieldImportContext::StartElement(xAttrList);
|
XMLTextFieldImportContext::StartElement(xAttrList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLAuthorFieldImportContext::ProcessAttribute(sal_uInt16 nAttrToken, const OUString& sAttrValue)
|
|
||||||
{
|
|
||||||
if(nAttrToken == XML_TOK_TEXTFIELD_FIXED)
|
|
||||||
{
|
|
||||||
bool bTmp(false);
|
|
||||||
if (::sax::Converter::convertBool(bTmp, sAttrValue))
|
|
||||||
bFixed = bTmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLAuthorFieldImportContext::PrepareField(
|
void XMLAuthorFieldImportContext::PrepareField(
|
||||||
const Reference<XPropertySet> & rPropSet)
|
const Reference<XPropertySet> & rPropSet)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user