summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-20 11:37:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-20 11:37:59 +0100
commit26dc5f2ee67342bd474640e1cc39b96d3220721b (patch)
tree1c520492c01ac9ef399a7608135e72fc95262695
parentdfee01afdff0223284d17a4ea2134bece2ef440a (diff)
Resolves: fdo#67665 font names filtered out on odp/odg export
Change-Id: Ia529992d15152db981379a1e0a4dec63b2dad40c
-rw-r--r--xmloff/source/text/txtexppr.cxx59
1 files changed, 41 insertions, 18 deletions
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 7c978f868145..12a72a551641 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -217,25 +217,48 @@ void XMLTextExportPropertySetMapper::ContextFontFilter(
if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) )
eEnc = (rtl_TextEncoding)nTmp;
- OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
- sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
- if( !sName.isEmpty() )
+ //Resolves: fdo#67665 The purpose here appears to be to replace
+ //FontFamilyName and FontStyleName etc with a single FontName property. The
+ //problem is that repeated calls to here will first set
+ //pFontFamilyNameState->mnIndex to -1 to indicate it is disabled, so the
+ //next time pFontFamilyNameState is not passed here at all, which gives an
+ //empty sFamilyName resulting in disabling pFontNameState->mnIndex to -1.
+ //That doesn't seem right to me.
+ //
+ //So assuming that the main purpose is just to convert the properties in
+ //the main when we can, and to leave them alone when we can't. And with a
+ //secondary purpose to filter out empty font properties, then is would
+ //appear to make sense to base attempting the conversion if we have
+ //both of the major facts of the font description
+ //
+ //An alternative solution is to *not* fill the FontAutoStylePool with
+ //every font in the document, but to partition the fonts into the
+ //hard-attribute fonts which go into that pool and the style-attribute
+ //fonts which go into some additional pool which get merged just for
+ //the purposes of writing the embedded fonts but are not queried by
+ //"Find" which restores the original logic.
+ if (pFontFamilyNameState || pFontStyleNameState)
{
- pFontNameState->maValue <<= sName;
- if( pFontFamilyNameState )
- pFontFamilyNameState->mnIndex = -1;
- if( pFontStyleNameState )
- pFontStyleNameState->mnIndex = -1;
- if( pFontFamilyState )
- pFontFamilyState->mnIndex = -1;
- if( pFontPitchState )
- pFontPitchState->mnIndex = -1;
- if( pFontCharsetState )
- pFontCharsetState->mnIndex = -1;
- }
- else
- {
- pFontNameState->mnIndex = -1;
+ OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
+ sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
+ if( !sName.isEmpty() )
+ {
+ pFontNameState->maValue <<= sName;
+ if( pFontFamilyNameState )
+ pFontFamilyNameState->mnIndex = -1;
+ if( pFontStyleNameState )
+ pFontStyleNameState->mnIndex = -1;
+ if( pFontFamilyState )
+ pFontFamilyState->mnIndex = -1;
+ if( pFontPitchState )
+ pFontPitchState->mnIndex = -1;
+ if( pFontCharsetState )
+ pFontCharsetState->mnIndex = -1;
+ }
+ else
+ {
+ pFontNameState->mnIndex = -1;
+ }
}
if( pFontFamilyNameState && sFamilyName.isEmpty() )