[Libreoffice-commits] core.git: include/xmloff xmloff/inc xmloff/source
Katarina Behrens
Katarina.Behrens at cib.de
Wed Apr 22 06:26:01 PDT 2015
include/xmloff/txtimp.hxx | 1 +
xmloff/inc/txtfldi.hxx | 22 ++++++++++++++++++++++
xmloff/source/text/txtfldi.cxx | 32 ++++++++++++++++++++++++++++++++
xmloff/source/text/txtimp.cxx | 2 ++
4 files changed, 57 insertions(+)
New commits:
commit 57929ce5ccbb0ddf213d2182b94e939ba6a337bb
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Apr 22 15:19:45 2015 +0200
tdf#88056: Implement import of page title field from ODF
the field seems to get imported now, but still ain't displayed
in Impress *sigh*
Change-Id: I095b9a2c59145f984bc9db853cc22501ca103bb7
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index e179fd4..a5721a1 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -231,6 +231,7 @@ enum XMLTextPElemTokens
XML_TOK_DRAW_FOOTER,
XML_TOK_DRAW_DATE_TIME,
XML_TOK_TEXT_PAGE_CONTINUATION,
+ XML_TOK_DRAW_PAGE_TITLE,
XML_TOK_TEXT_FIELDMARK,
XML_TOK_TEXT_FIELDMARK_START,
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index f423513..1972856 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -1406,6 +1406,28 @@ public:
::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
};
+/** import page|slide title fields (<presentation:page-title>) */
+class XMLPageTitleFieldImportContext : public XMLTextFieldImportContext
+{
+public:
+ TYPEINFO_OVERRIDE();
+
+ XMLPageTitleFieldImportContext(
+ SvXMLImport& rImport, /// XML Import
+ XMLTextImportHelper& rHlp, /// Text import helper
+ sal_uInt16 nPrfx, /// namespace prefix
+ const OUString& sLocalName); /// element name w/o prefix
+
+ /// process attribute values
+ virtual void ProcessAttribute( sal_uInt16 nAttrToken,
+ const OUString& sAttrValue ) SAL_OVERRIDE;
+
+ /// prepare XTextField for insertion into document
+ virtual void PrepareField(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & xPropertySet) SAL_OVERRIDE;
+};
+
class XMLCustomPropertyFieldImportContext : public XMLTextFieldImportContext
{
OUString sName;
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 2a22699..a4288e2 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -138,6 +138,7 @@ const sal_Char sAPI_drop_down[] = "DropDown";
const sal_Char sAPI_header[] = "Header";
const sal_Char sAPI_footer[] = "Footer";
const sal_Char sAPI_datetime[] = "DateTime";
+const sal_Char sAPI_pagetitle[] = "PageTitle";
// property names
const sal_Char sAPI_is_fixed[] = "IsFixed";
@@ -580,6 +581,10 @@ XMLTextFieldImportContext::CreateTextFieldImportContext(
pContext = new XMLDateTimeFieldImportContext( rImport, rHlp,
nPrefix, rName );
break;
+ case XML_TOK_DRAW_PAGE_TITLE:
+ pContext = new XMLPageTitleFieldImportContext( rImport, rHlp,
+ nPrefix, rName );
+ break;
default:
// ignore! May not even be a textfield.
@@ -4154,4 +4159,31 @@ void XMLDateTimeFieldImportContext::PrepareField(
{
}
+/** import page|slide title fields (<presentation:page-title>) */
+TYPEINIT1( XMLPageTitleFieldImportContext, XMLTextFieldImportContext );
+
+XMLPageTitleFieldImportContext::XMLPageTitleFieldImportContext(
+ SvXMLImport& rImport, /// XML Import
+ XMLTextImportHelper& rHlp, /// Text import helper
+ sal_uInt16 nPrfx, /// namespace prefix
+ const OUString& sLocalName) /// element name w/o prefix
+: XMLTextFieldImportContext(rImport, rHlp, sAPI_datetime, nPrfx, sLocalName )
+{
+ sServicePrefix = sAPI_presentation_prefix;
+ bValid = true;
+}
+
+/// process attribute values
+void XMLPageTitleFieldImportContext::ProcessAttribute( sal_uInt16,
+ const OUString& )
+{
+}
+
+/// prepare XTextField for insertion into document
+void XMLPageTitleFieldImportContext::PrepareField(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> &)
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index e1b3983..afd5ec9 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -281,6 +281,8 @@ static const SvXMLTokenMapEntry aTextPElemTokenMap[] =
{ XML_NAMESPACE_PRESENTATION, XML_HEADER, XML_TOK_DRAW_HEADER },
{ XML_NAMESPACE_PRESENTATION, XML_FOOTER, XML_TOK_DRAW_FOOTER },
{ XML_NAMESPACE_PRESENTATION, XML_DATE_TIME, XML_TOK_DRAW_DATE_TIME },
+ { XML_NAMESPACE_LO_EXT, XML_PAGE_TITLE, XML_TOK_DRAW_PAGE_TITLE },
+ { XML_NAMESPACE_PRESENTATION, XML_PAGE_TITLE, XML_TOK_DRAW_PAGE_TITLE },
{ XML_NAMESPACE_TEXT, XML_PAGE_CONTINUATION, XML_TOK_TEXT_PAGE_CONTINUATION },
{ XML_NAMESPACE_FIELD, XML_FIELDMARK, XML_TOK_TEXT_FIELDMARK },
More information about the Libreoffice-commits
mailing list