From cc3293b94ab58b196bc2786eb4012d64351e8fa4 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 10 Jul 2013 17:33:15 +0200 Subject: 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 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- sc/source/filter/xml/xmlstyli.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 477f151cbba6..9ca8245e4c3c 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -750,7 +750,7 @@ UniReference < SvXMLImportPropertyMapper > { ((XMLTableStylesContext *)this)->xCellImpPropMapper = new ScXMLCellImportPropertyMapper( GetScImport().GetCellStylesPropertySetMapper(), const_cast(GetImport()) ); - xCellImpPropMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(const_cast(GetImport()), const_cast(GetScImport().GetFontDecls()))); + xCellImpPropMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(const_cast(GetImport()))); } xMapper = xCellImpPropMapper; } -- cgit v1.2.3