summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-31 13:58:24 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-03 06:17:15 +0000
commitdb4e8806aace921ca1348c1bc0949a7e554f34ac (patch)
tree7d7aa30bf8d9f86ae45773cb148ad3bf0419ec97
parente88107c0552a2165d3e3e8137ebbd80d97b5570e (diff)
Convert FontRights to scoped enum
Change-Id: Ib46fe9dbe4b41bfe2e85e9171e8dcf7a96ccb483 Reviewed-on: https://gerrit.libreoffice.org/25717 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/vcl/embeddedfontshelper.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--vcl/source/gdi/embeddedfontshelper.cxx6
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/include/vcl/embeddedfontshelper.hxx b/include/vcl/embeddedfontshelper.hxx
index e986e500032a..7361195c4dce 100644
--- a/include/vcl/embeddedfontshelper.hxx
+++ b/include/vcl/embeddedfontshelper.hxx
@@ -26,7 +26,7 @@ class VCL_DLLPUBLIC EmbeddedFontsHelper
{
public:
/// Specification of what kind of operation is allowed when embedding a font
- enum FontRights
+ enum class FontRights
{
ViewingAllowed, ///< Font may be embedded for viewing the document (but not editing)
EditingAllowed ///< Font may be embedded for editing document (implies viewing)
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7e66549ff8dd..6dc190e64660 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5865,7 +5865,7 @@ void DocxAttributeOutput::EmbedFontStyle( const OUString& name, int tag, FontFam
// 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 fontUrl = EmbeddedFontsHelper::fontFileUrl( name, family, italic, weight, pitch, encoding,
- EmbeddedFontsHelper::ViewingAllowed );
+ EmbeddedFontsHelper::FontRights::ViewingAllowed );
if( fontUrl.isEmpty())
return;
// TODO IDocumentSettingAccess::EMBED_SYSTEM_FONTS
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx
index c9f4a5ceab62..b39136dafb34 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -143,7 +143,7 @@ bool EmbeddedFontsHelper::addEmbeddedFont( const uno::Reference< io::XInputStrea
}
if( !eot )
{
- sufficientFontRights = sufficientTTFRights( &fontData.front(), fontData.size(), EditingAllowed );
+ sufficientFontRights = sufficientTTFRights( &fontData.front(), fontData.size(), FontRights::EditingAllowed );
}
if( !sufficientFontRights )
{
@@ -197,10 +197,10 @@ bool EmbeddedFontsHelper::sufficientTTFRights( const void* data, long size, Font
int copyright = info.typeFlags & TYPEFLAG_COPYRIGHT_MASK;
switch( rights )
{
- case ViewingAllowed:
+ case FontRights::ViewingAllowed:
// Embedding not restricted completely.
return ( copyright & 0x02 ) != 0x02;
- case EditingAllowed:
+ case FontRights::EditingAllowed:
// Font is installable or editable.
return copyright == 0 || ( copyright & 0x08 );
}
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index 13bdfe845353..6b4b5a4d59e5 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -306,7 +306,7 @@ void XMLFontAutoStylePool::exportXML()
// 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(),
- EmbeddedFontsHelper::ViewingAllowed );
+ EmbeddedFontsHelper::FontRights::ViewingAllowed );
if( fileUrl.isEmpty())
continue;
if( !fontFilesMap.count( fileUrl ))