summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-03-07 19:45:49 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-03-08 13:35:27 +0100
commite2cd75f005dd5bf57336f39abd8820ecac0b048e (patch)
tree429e024b52781adc38817f4039c833b12d340cf4 /xmloff/source/style
parent8fcc60bee755b812489ef652ab2fa779babddeac (diff)
embed also view-only fonts, but do not use them
MSO embeds even fonts which allow only embedding for viewing the document but not editing it. So embed such fonts too, but do not actually use them from the document. What MSO does when such a font is not present locally when opening the document is switching to read-only mode, warning about this and providing a button for switching to editing mode by dumping the font(s). That should be done for LO too, but right now dropping view-only fonts is better than using them for editing. Change-Id: I19c28fadb091e6b21beaf4cbf8b47e3078256d1c
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index 561814d32c18..8f603ab0419a 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -282,8 +282,11 @@ void XMLFontAutoStylePool::exportXML()
j < SAL_N_ELEMENTS( weight );
++j )
{
+ // Embed font if at least viewing is allowed (in which case the opening app must check
+ // the font license rights too and open either read-only or not use the font for editing).
OUString fileUrl = EmbeddedFontsHelper::fontFileUrl( pEntry->GetFamilyName(), pEntry->GetFamily(),
- italic[ j ], weight[ j ], pEntry->GetPitch(), pEntry->GetEncoding());
+ italic[ j ], weight[ j ], pEntry->GetPitch(), pEntry->GetEncoding(),
+ EmbeddedFontsHelper::ViewingAllowed );
if( fileUrl.isEmpty())
continue;
if( !fontFilesMap.count( fileUrl ))