summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-17 10:40:22 +0200
committerNoel Grandin <noel@peralex.com>2015-04-22 10:28:39 +0200
commit6e3bbbdf0aea17aa3129fb4d11b9667af17a5d1e (patch)
treeb3fda393939d8ebcb29d7644514e08a8c6c6ee53 /svtools
parentcd23e6d3dd1c95b7cd74796612637cbc0f2af5fb (diff)
convert FONTLIST_FONTNAMETYPE constants to scoped enum
and move them inside the module, since they are not used anywhere else Change-Id: I63a629c8a497f5fb832f5287c260df7eb15fed3a
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/ctrltool.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 7babd84d5fbf..b9f987ae975f 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -31,6 +31,7 @@
#include <svtools/svtools.hrc>
#include <svtools/svtresid.hxx>
#include <svtools/ctrltool.hxx>
+#include <o3tl/typed_flags_set.hxx>
// Standard Fontgroessen fuer scalierbare Fonts
const sal_IntPtr FontList::aStdSizeAry[] =
@@ -87,6 +88,17 @@ public:
OutputDevice* GetDevice() const { return mpDevice; }
};
+enum class FontListFontNameType
+{
+ NONE = 0x00,
+ PRINTER = 0x01,
+ SCREEN = 0x02,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<FontListFontNameType> : is_typed_flags<FontListFontNameType, 0x3> {};
+}
+
class ImplFontListNameInfo
{
friend class FontList;
@@ -94,12 +106,12 @@ class ImplFontListNameInfo
private:
OUString maSearchName;
ImplFontListFontInfo* mpFirst;
- sal_uInt16 mnType;
+ FontListFontNameType mnType;
ImplFontListNameInfo(const OUString& rSearchName)
: maSearchName(rSearchName)
, mpFirst(NULL)
- , mnType(0)
+ , mnType(FontListFontNameType::NONE)
{
}
};
@@ -231,11 +243,11 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll,
{
rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding();
- sal_uInt16 nType;
+ FontListFontNameType nType;
if ( pDevice->GetOutDevType() != OUTDEV_PRINTER )
- nType = FONTLIST_FONTNAMETYPE_SCREEN;
+ nType = FontListFontNameType::SCREEN;
else
- nType = FONTLIST_FONTNAMETYPE_PRINTER;
+ nType = FontListFontNameType::PRINTER;
// inquire all fonts from the device
int n = pDevice->GetDevFontCount();
@@ -487,8 +499,8 @@ OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const
}
// search for synthetic style
- sal_uInt16 nType = pData->mnType;
- const OUString& rStyleName = rInfo.GetStyleName();
+ FontListFontNameType nType = pData->mnType;
+ const OUString& rStyleName = rInfo.GetStyleName();
if (!rStyleName.isEmpty())
{
bool bNotSynthetic = false;
@@ -516,14 +528,14 @@ OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const
}
// Only Printer-Font?
- if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_PRINTER )
+ if ( nType == FontListFontNameType::PRINTER )
{
if (maMapPrinterOnly.isEmpty())
const_cast<FontList*>(this)->maMapPrinterOnly = SVT_RESSTR(STR_SVT_FONTMAP_PRINTERONLY);
return maMapPrinterOnly;
}
// Only Screen-Font?
- else if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_SCREEN
+ else if ( nType == FontListFontNameType::SCREEN
&& rInfo.GetType() == TYPE_RASTER )
{
if (maMapScreenOnly.isEmpty())