summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-07-10 17:33:15 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-10 19:33:24 +0000
commitcc3293b94ab58b196bc2786eb4012d64351e8fa4 (patch)
tree2bae24b69ead7bcbe31d9006ce8b28d149b0ef89 /include
parent60455c972b09ca02b18660c6fb3dafc03b30b2b5 (diff)
fix reading fonts from .odp using style::font-name (fdo#65338)
b40bcde076f9fabf24810d2520e878d604d99637 made writing .odp use style:font-name and office:font-face-decls, instead of using fo:font-family . But the reading back was broken, as xFontDecls is not set in XMLTextImportPropertyMapper::handleSpecialItem(), so the font data was ignored. And xFontDecls was not set because it's set while reading office:font-face-decls, which is at the top of the xml document, but even before the xml is parsed, the call to SdXMLImport::setTargetDocument() calls GetShapeImport(), which creates XMLShapeImportHelper instance, which calls XMLTextImportHelper::CreateParaExtPropMapper(), and XMLTextImportPropertyMapper is created with rImport.GetFontDecls() still being NULL at that point. And it actually doesn't seem to make any sense to just pass around all the pointers to XMLFontStylesContext, as eventually it's always just the one from SvXMLImport. So simply dump all that and make the one single place that actually uses it (i.e. XMLTextImportPropertyMapper::handleSpecialItem()) refer directly to SvXMLImport::GetFontDecls(). Change-Id: Ib1b3e4b1bcaf87ca3e4703d1cc1563ad6b3f9ce7 Reviewed-on: https://gerrit.libreoffice.org/4816 Reviewed-by: Michael Meeks <michael.meeks@suse.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/xmloff/txtimp.hxx11
-rw-r--r--include/xmloff/txtimppr.hxx6
2 files changed, 5 insertions, 12 deletions
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 0fc68b529773..c15bd8b186a7 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -409,9 +409,6 @@ public:
void SetAutoStyles( SvXMLStylesContext *pStyles );
- void SetFontDecls( XMLFontStylesContext *pFontDecls );
- const XMLFontStylesContext *GetFontDecls() const;
-
SvXMLImportContext *CreateTextChildContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix, const OUString& rLocalName,
@@ -557,10 +554,10 @@ public:
GetRubyImportPropertySetMapper() const;
static SvXMLImportPropertyMapper *CreateShapeExtPropMapper(SvXMLImport&);
- static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&, XMLFontStylesContext *pFontDecls = NULL);
- static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
- static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
- static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
+ static SvXMLImportPropertyMapper *CreateParaExtPropMapper(SvXMLImport&);
+ static SvXMLImportPropertyMapper* CreateParaDefaultExtPropMapper(SvXMLImport&);
+ static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&);
+ static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&);
SvI18NMap& GetRenameMap();
diff --git a/include/xmloff/txtimppr.hxx b/include/xmloff/txtimppr.hxx
index ae58bdd9f55e..0bae7ed87635 100644
--- a/include/xmloff/txtimppr.hxx
+++ b/include/xmloff/txtimppr.hxx
@@ -28,7 +28,6 @@ class XMLOFF_DLLPUBLIC XMLTextImportPropertyMapper : public SvXMLImportPropertyM
{
sal_Int32 nSizeTypeIndex;
sal_Int32 nWidthTypeIndex;
- SvXMLImportContextRef xFontDecls;
void FontFinished(
XMLPropertyState *pFontFamilyNameState,
@@ -58,12 +57,9 @@ protected:
public:
XMLTextImportPropertyMapper(
const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImport,
- XMLFontStylesContext *pFontDecls = 0 );
+ SvXMLImport& rImport );
virtual ~XMLTextImportPropertyMapper();
- void SetFontDecls( XMLFontStylesContext *pFontDecls );
-
/** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */
virtual void finished(
::std::vector< XMLPropertyState >& rProperties,