summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:08:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:28 +0100
commit18804c92e10c7f4572b9698b1cf6dc86db8d6f32 (patch)
tree871d06b7a7430c9b5ef93910ab46eb26ead5ffa6 /vcl/generic
parent33875d862ad5d870cfd1f67d5ef9ad91b8be740f (diff)
Clean up C-style casts from pointers to void
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/fontmanager/fontconfig.cxx4
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx6
-rw-r--r--vcl/generic/fontmanager/parseAFM.cxx32
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx10
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx12
-rw-r--r--vcl/generic/print/common_gfx.cxx2
-rw-r--r--vcl/generic/print/genprnpsp.cxx4
-rw-r--r--vcl/generic/print/genpspgraphics.cxx4
-rw-r--r--vcl/generic/print/glyphset.cxx12
-rw-r--r--vcl/generic/print/printerjob.cxx2
-rw-r--r--vcl/generic/print/prtsetup.cxx8
-rw-r--r--vcl/generic/print/text_gfx.cxx20
12 files changed, 58 insertions, 58 deletions
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 2a354cca4cf4..f872164e9a63 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -919,7 +919,7 @@ IMPL_LINK_NOARG(PrintFontManager, autoInstallFontLangSupport)
return -1;
}
- gchar **fonts = (gchar**)g_malloc((m_aCurrentRequests.size() + 1) * sizeof(gchar*));
+ gchar **fonts = static_cast<gchar**>(g_malloc((m_aCurrentRequests.size() + 1) * sizeof(gchar*)));
gchar **font = fonts;
for (std::vector<OString>::const_iterator aI = m_aCurrentRequests.begin(); aI != m_aCurrentRequests.end(); ++aI)
*font++ = const_cast<gchar*>(aI->getStr());
@@ -1088,7 +1088,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
// update rMissingCodes by removing resolved unicodes
if( !rMissingCodes.isEmpty() )
{
- sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) );
+ sal_uInt32* pRemainingCodes = static_cast<sal_uInt32*>(alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) ));
int nRemainingLen = 0;
FcCharSet* unicodes;
if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes))
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index c98ccc522d3c..f2b67d1aca84 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -472,7 +472,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( MultiAtomProvider* pProvider,
// first transform the character codes to unicode
// note: this only works with single byte encodings
- sal_Unicode* pUnicodes = (sal_Unicode*)alloca( pInfo->numOfChars * sizeof(sal_Unicode));
+ sal_Unicode* pUnicodes = static_cast<sal_Unicode*>(alloca( pInfo->numOfChars * sizeof(sal_Unicode)));
CharMetricInfo* pChar = pInfo->cmi;
int i;
@@ -979,7 +979,7 @@ std::vector<fontID> PrintFontManager::findFontFileIDs( int nDirID, const OString
OUString PrintFontManager::convertTrueTypeName( void* pRecord ) const
{
- NameRecord* pNameRecord = (NameRecord*)pRecord;
+ NameRecord* pNameRecord = static_cast<NameRecord*>(pRecord);
OUString aValue;
if(
( pNameRecord->platformID == 3 && ( pNameRecord->encodingID == 0 || pNameRecord->encodingID == 1 ) ) // MS, Unicode
@@ -1128,7 +1128,7 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
::std::set< OUString > aSet;
NameRecord* pNameRecords = NULL;
- int nNameRecords = GetTTNameRecords( (TrueTypeFont*)pTTFont, &pNameRecords );
+ int nNameRecords = GetTTNameRecords( static_cast<TrueTypeFont*>(pTTFont), &pNameRecords );
if( nNameRecords && pNameRecords )
{
LanguageTag aSystem("");
diff --git a/vcl/generic/fontmanager/parseAFM.cxx b/vcl/generic/fontmanager/parseAFM.cxx
index e3a3170a14ab..267ef1c2c248 100644
--- a/vcl/generic/fontmanager/parseAFM.cxx
+++ b/vcl/generic/fontmanager/parseAFM.cxx
@@ -120,7 +120,7 @@ FileInputStream::FileInputStream(const char* pFilename)
struct stat aStat;
if (!fstat(fileno(fp), &aStat) && S_ISREG(aStat.st_mode) && aStat.st_size > 0)
{
- m_pMemory = (char*)rtl_allocateMemory( aStat.st_size );
+ m_pMemory = static_cast<char*>(rtl_allocateMemory( aStat.st_size ));
m_nLen = (unsigned int)fread( m_pMemory, 1, aStat.st_size, fp );
}
fclose( fp );
@@ -666,7 +666,7 @@ reallocFontMetrics( void **pp_fontmetrics, int *p_oldcount, int n_newcount, unsi
if (*p_oldcount == n_newcount)
return ok;
- p_tmpmetrics = (char*)realloc(*pp_fontmetrics, n_newcount * n_size);
+ p_tmpmetrics = static_cast<char*>(realloc(*pp_fontmetrics, n_newcount * n_size));
if (p_tmpmetrics == NULL)
return storageProblem;
@@ -816,7 +816,7 @@ static int parseCharMetrics( FileInputStream* fp, FontInfo* fi)
tail = &(node->next);
}
- *tail = (Ligature *) calloc(1, sizeof(Ligature));
+ *tail = static_cast<Ligature *>(calloc(1, sizeof(Ligature)));
if ((keyword = token(fp,tokenlen)) != NULL)
(*tail)->succ = (char *)strdup(keyword);
if ((keyword = token(fp,tokenlen)) != NULL)
@@ -1169,8 +1169,8 @@ static int parseCompCharData( FileInputStream* fp, FontInfo* fi)
fi->ccd[pos].ccName = strdup( keyword );
if ((keyword = token(fp,tokenlen)) != NULL)
fi->ccd[pos].numOfPieces = atoi(keyword);
- fi->ccd[pos].pieces = (Pcc *)
- calloc(fi->ccd[pos].numOfPieces, sizeof(Pcc));
+ fi->ccd[pos].pieces = static_cast<Pcc *>(
+ calloc(fi->ccd[pos].numOfPieces, sizeof(Pcc)));
j = 0;
ccount++;
}
@@ -1252,12 +1252,12 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
char *keyword; /* used to store a token */
- (*fi) = (FontInfo *) calloc(1, sizeof(FontInfo));
+ (*fi) = static_cast<FontInfo *>(calloc(1, sizeof(FontInfo)));
if ((*fi) == NULL) { error = storageProblem; return error; }
if (flags & P_G)
{
- (*fi)->gfi = (GlobalFontInfo *) calloc(1, sizeof(GlobalFontInfo));
+ (*fi)->gfi = static_cast<GlobalFontInfo *>(calloc(1, sizeof(GlobalFontInfo)));
if ((*fi)->gfi == NULL) { error = storageProblem; return error; }
}
@@ -1281,8 +1281,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
(*fi)->numOfChars = atoi(keyword);
if (flags & (P_M ^ P_W))
{
- (*fi)->cmi = (CharMetricInfo *)
- calloc((*fi)->numOfChars, sizeof(CharMetricInfo));
+ (*fi)->cmi = static_cast<CharMetricInfo *>(
+ calloc((*fi)->numOfChars, sizeof(CharMetricInfo)));
if ((*fi)->cmi == NULL) { error = storageProblem; return error; }
code = parseCharMetrics(&aFile, *fi);
}
@@ -1290,7 +1290,7 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
{
if (flags & P_W)
{
- (*fi)->cwi = (int *) calloc(256, sizeof(int));
+ (*fi)->cwi = static_cast<int *>(calloc(256, sizeof(int)));
if ((*fi)->cwi == NULL)
{
error = storageProblem;
@@ -1331,8 +1331,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
if ((flags & P_T) && keyword)
{
(*fi)->numOfTracks = atoi(keyword);
- (*fi)->tkd = (TrackKernData *)
- calloc((*fi)->numOfTracks, sizeof(TrackKernData));
+ (*fi)->tkd = static_cast<TrackKernData *>(
+ calloc((*fi)->numOfTracks, sizeof(TrackKernData)));
if ((*fi)->tkd == NULL)
{
error = storageProblem;
@@ -1346,8 +1346,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
if ((flags & P_P) && keyword)
{
(*fi)->numOfPairs = atoi(keyword);
- (*fi)->pkd = (PairKernData *)
- calloc((*fi)->numOfPairs, sizeof(PairKernData));
+ (*fi)->pkd = static_cast<PairKernData *>(
+ calloc((*fi)->numOfPairs, sizeof(PairKernData)));
if ((*fi)->pkd == NULL)
{
error = storageProblem;
@@ -1361,8 +1361,8 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
if ((flags & P_C) && keyword)
{
(*fi)->numOfComps = atoi(keyword);
- (*fi)->ccd = (CompCharData *)
- calloc((*fi)->numOfComps, sizeof(CompCharData));
+ (*fi)->ccd = static_cast<CompCharData *>(
+ calloc((*fi)->numOfComps, sizeof(CompCharData)));
if ((*fi)->ccd == NULL)
{
error = storageProblem;
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 887b5f4fb482..93a79b1649ac 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -169,8 +169,8 @@ bool FtFontFile::Map()
return false;
}
mnFileSize = aStat.st_size;
- mpFileMap = (unsigned char*)
- mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 );
+ mpFileMap = static_cast<unsigned char*>(
+ mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 ));
if( mpFileMap == MAP_FAILED )
mpFileMap = NULL;
close( nFile );
@@ -548,7 +548,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
//static const int TT_CODEPAGE_RANGE_950 = (1L << 20); // Chinese: Traditional
//static const int TT_CODEPAGE_RANGE_1361 = (1L << 21); // Korean Johab
static const int TT_CODEPAGE_RANGES1_CJKT = 0x3F0000; // all of the above
- const TT_OS2* pOs2 = (const TT_OS2*)FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 );
+ const TT_OS2* pOs2 = static_cast<const TT_OS2*>(FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 ));
if ((pOs2) && (pOs2->ulCodePageRange1 & TT_CODEPAGE_RANGES1_CJKT )
&& rFSD.mnHeight < 20)
mbUseGamma = true;
@@ -652,7 +652,7 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
rFactor = 0x100;
- const TT_OS2* pOS2 = (const TT_OS2*)FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 );
+ const TT_OS2* pOS2 = static_cast<const TT_OS2*>(FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 ));
const double fScale = (double)GetFontSelData().mnHeight / maFaceFT->units_per_EM;
rTo.mnAscent = 0;
@@ -676,7 +676,7 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
}
else
{
- const TT_HoriHeader* pHHea = (const TT_HoriHeader*)FT_Get_Sfnt_Table(maFaceFT, ft_sfnt_hhea);
+ const TT_HoriHeader* pHHea = static_cast<const TT_HoriHeader*>(FT_Get_Sfnt_Table(maFaceFT, ft_sfnt_hhea));
if (pHHea)
{
rTo.mnAscent = pHHea->Ascender * fScale + 0.5;
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 8e9deeb4f226..94486a1a8813 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -126,7 +126,7 @@ static hb_blob_t *getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
pTagName[3] = (char)(nTableTag);
pTagName[4] = 0;
- ServerFont* pFont = (ServerFont*) pUserData;
+ ServerFont* pFont = static_cast<ServerFont*>(pUserData);
SAL_INFO("vcl.harfbuzz", "getFontTable(" << pFont << ", " << pTagName << ")");
@@ -145,7 +145,7 @@ static hb_bool_t getFontGlyph(hb_font_t* /*font*/, void* pFontData,
hb_codepoint_t* nGlyphIndex,
void* /*pUserData*/)
{
- ServerFont* pFont = (ServerFont*) pFontData;
+ ServerFont* pFont = static_cast<ServerFont*>(pFontData);
*nGlyphIndex = pFont->GetRawGlyphIndex(ch, vs);
return *nGlyphIndex != 0;
@@ -155,7 +155,7 @@ static hb_position_t getGlyphAdvanceH(hb_font_t* /*font*/, void* pFontData,
hb_codepoint_t nGlyphIndex,
void* /*pUserData*/)
{
- ServerFont* pFont = (ServerFont*) pFontData;
+ ServerFont* pFont = static_cast<ServerFont*>(pFontData);
const GlyphMetric& rGM = pFont->GetGlyphMetric(nGlyphIndex);
return rGM.GetCharWidth() << 6;
}
@@ -192,7 +192,7 @@ static hb_position_t getGlyphKerningH(hb_font_t* /*font*/, void* pFontData,
{
// This callback is for old style 'kern' table, GPOS kerning is handled by HarfBuzz directly
- ServerFont* pFont = (ServerFont*) pFontData;
+ ServerFont* pFont = static_cast<ServerFont*>(pFontData);
FT_Face aFace = pFont->GetFtFace();
SAL_INFO("vcl.harfbuzz", "getGlyphKerningH(" << pFont << ", " << nGlyphIndex1 << ", " << nGlyphIndex2 << ")");
@@ -223,7 +223,7 @@ static hb_bool_t getGlyphExtents(hb_font_t* /*font*/, void* pFontData,
hb_glyph_extents_t* pExtents,
void* /*pUserData*/)
{
- ServerFont* pFont = (ServerFont*) pFontData;
+ ServerFont* pFont = static_cast<ServerFont*>(pFontData);
FT_Face aFace = pFont->GetFtFace();
SAL_INFO("vcl.harfbuzz", "getGlyphExtents(" << pFont << ", " << nGlyphIndex << ")");
@@ -247,7 +247,7 @@ static hb_bool_t getGlyphContourPoint(hb_font_t* /*font*/, void* pFontData,
void* /*pUserData*/)
{
bool ret = false;
- ServerFont* pFont = (ServerFont*) pFontData;
+ ServerFont* pFont = static_cast<ServerFont*>(pFontData);
FT_Face aFace = pFont->GetFtFace();
SAL_INFO("vcl.harfbuzz", "getGlyphContourPoint(" << pFont << ", " << nGlyphIndex << ", " << nPointIndex << ")");
diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index cc7c4d992f9c..769bb9893507 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -1219,7 +1219,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
bSuccess = nOutLength == nSize;
// corresponding EndDocument
- if( ((char*)pPtr)[ nSize-1 ] != '\n' )
+ if( static_cast<char*>(pPtr)[ nSize-1 ] != '\n' )
WritePS( mpPageBody, "\n" );
WritePS( mpPageBody, "%%EndDocument\n" );
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 0eb63379c35a..7a0ab922eca8 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -232,7 +232,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
+ pJobSetup->mpDriverData = static_cast<sal_uInt8*>(pBuffer);
}
else
{
@@ -563,7 +563,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
void* pBuffer = NULL;
aInfo.getStreamBuffer( pBuffer, nBytes );
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
+ pJobSetup->mpDriverData = static_cast<sal_uInt8*>(pBuffer);
// copy everything to job setup
copyJobDataToJobSetup( pJobSetup, aInfo );
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index af73d8a9c77e..d121ba6ca2eb 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -1248,7 +1248,7 @@ void GenPspGraphics::DoFreeEmbedFontData( const void* pData, long nLen )
{
#if defined( UNX )
if( pData )
- munmap( (char*)pData, nLen );
+ munmap( const_cast<void *>(pData), nLen );
#else
(void)nLen;
rtl_freeMemory( (void *)pData );
@@ -1332,7 +1332,7 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF;
break;
case psp::fonttype::Type1: {
- const bool bPFA = ((*(unsigned char*)pFile) < 0x80);
+ const bool bPFA = *static_cast<unsigned char*>(pFile) < 0x80;
rInfo.m_nFontType = bPFA ? FontSubsetInfo::TYPE1_PFA : FontSubsetInfo::TYPE1_PFB;
}
break;
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 3ac8d8dd28e9..37bd752525f8 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -448,8 +448,8 @@ void GlyphSet::DrawGlyphs(
const sal_Int32* pDeltaArray,
const bool bUseGlyphs)
{
- unsigned char *pGlyphID = (unsigned char*)alloca (nLen * sizeof(unsigned char));
- sal_Int32 *pGlyphSetID = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
+ unsigned char *pGlyphID = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char)));
+ sal_Int32 *pGlyphSetID = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32)));
std::set< sal_Int32 > aGlyphSet;
// convert unicode to font glyph id and font subset
@@ -464,8 +464,8 @@ void GlyphSet::DrawGlyphs(
// loop over all glyph sets to detect substrings that can be xshown together
// without changing the postscript font
- sal_Int32 *pDeltaSubset = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
- unsigned char *pGlyphSubset = (unsigned char*)alloca (nLen * sizeof(unsigned char));
+ sal_Int32 *pDeltaSubset = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32)));
+ unsigned char *pGlyphSubset = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char)));
std::set< sal_Int32 >::iterator aSet;
for (aSet = aGlyphSet.begin(); aSet != aGlyphSet.end(); ++aSet)
@@ -545,8 +545,8 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
}
int nChar;
- unsigned char *pGlyphID = (unsigned char*)alloca (nLen * sizeof(unsigned char));
- sal_Int32 *pGlyphSetID = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
+ unsigned char *pGlyphID = static_cast<unsigned char*>(alloca (nLen * sizeof(unsigned char)));
+ sal_Int32 *pGlyphSetID = static_cast<sal_Int32*>(alloca (nLen * sizeof(sal_Int32)));
// convert unicode to glyph id and char set (font subset)
for (nChar = 0; nChar < nLen; nChar++)
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index 7cfeeade1273..f3aa39df8125 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -66,7 +66,7 @@ AppendPS (FILE* pDst, osl::File* pSrc, unsigned char* pBuffer,
if (nBlockSize == 0)
nBlockSize = nBLOCKSIZE;
if (pBuffer == NULL)
- pBuffer = (unsigned char*)alloca (nBlockSize);
+ pBuffer = static_cast<unsigned char*>(alloca (nBlockSize));
sal_uInt64 nIn = 0;
sal_uInt64 nOut = 0;
diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx
index ed598b6cb19b..cbe60c35f3f5 100644
--- a/vcl/generic/print/prtsetup.cxx
+++ b/vcl/generic/print/prtsetup.cxx
@@ -258,7 +258,7 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox )
}
if( pKey )
{
- PPDValue* pValue = (PPDValue*)pBox->GetSelectEntryData();
+ PPDValue* pValue = static_cast<PPDValue*>(pBox->GetSelectEntryData());
m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue );
update();
}
@@ -412,13 +412,13 @@ IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox )
{
if( pBox == m_pPPDKeyBox )
{
- const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData();
+ const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData());
FillValueBox( pKey );
}
else if( pBox == m_pPPDValueBox )
{
- const PPDKey* pKey = (PPDKey*)m_pPPDKeyBox->GetSelectEntryData();
- const PPDValue* pValue = (PPDValue*)m_pPPDValueBox->GetSelectEntryData();
+ const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData());
+ const PPDValue* pValue = static_cast<PPDValue*>(m_pPPDValueBox->GetSelectEntryData());
if (pKey && pValue)
{
m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue );
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index dec130475a41..569a10e4ed35 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -197,9 +197,9 @@ void PrinterGfx::DrawGlyphs(
// vertical glyphs can have an additional rotation ... sigh.
// so break up text in chunks of normal glyphs and print out
// specially rotated glyphs extra
- sal_GlyphId* pTempGlyphIds = (sal_GlyphId*)alloca(sizeof(sal_Int32)*nLen);
- sal_Int32* pTempDelta = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen);
- sal_Unicode* pTempUnicodes = (sal_Unicode*)alloca(sizeof(sal_Unicode)*nLen);
+ sal_GlyphId* pTempGlyphIds = static_cast<sal_GlyphId*>(alloca(sizeof(sal_Int32)*nLen));
+ sal_Int32* pTempDelta = static_cast<sal_Int32*>(alloca(sizeof(sal_Int32)*nLen));
+ sal_Unicode* pTempUnicodes = static_cast<sal_Unicode*>(alloca(sizeof(sal_Unicode)*nLen));
sal_Int16 nTempLen = 0;
sal_Int32 nTempFirstDelta = 0;
Point aRotPoint;
@@ -314,7 +314,7 @@ PrinterGfx::DrawText (
sal_Unicode *pEffectiveStr;
if ( aFont.IsSymbolFont() )
{
- pEffectiveStr = (sal_Unicode*)alloca(nLen * sizeof(pStr[0]));
+ pEffectiveStr = static_cast<sal_Unicode*>(alloca(nLen * sizeof(pStr[0])));
for (int i = 0; i < nLen; i++)
pEffectiveStr[i] = pStr[i] < 256 ? pStr[i] + 0xF000 : pStr[i];
}
@@ -323,8 +323,8 @@ PrinterGfx::DrawText (
pEffectiveStr = const_cast<sal_Unicode*>(pStr);
}
- fontID *pFontMap = (fontID*) alloca(nLen * sizeof(fontID));
- sal_Int32 *pCharWidth = (sal_Int32*) alloca(nLen * sizeof(sal_Int32));
+ fontID *pFontMap = static_cast<fontID*>(alloca(nLen * sizeof(fontID)));
+ sal_Int32 *pCharWidth = static_cast<sal_Int32*>(alloca(nLen * sizeof(sal_Int32)));
for( int n = 0; n < nLen; n++ )
{
@@ -335,7 +335,7 @@ PrinterGfx::DrawText (
}
// setup a new delta array, use virtual resolution of 1000
- sal_Int32* pNewDeltaArray = (sal_Int32*)alloca( sizeof( sal_Int32 )*nLen );
+ sal_Int32* pNewDeltaArray = static_cast<sal_Int32*>(alloca( sizeof( sal_Int32 )*nLen ));
if ( pDeltaArray != 0)
{
for (int i = 0; i < nLen - 1; i++)
@@ -438,7 +438,7 @@ bool PrinterGfx::drawVerticalizedText(
if (!rMgr.getFontInfo(mnFontID, aInfo))
return false;
- sal_Int32* pDelta = (sal_Int32*)alloca( nLen * sizeof(sal_Int32) );
+ sal_Int32* pDelta = static_cast<sal_Int32*>(alloca( nLen * sizeof(sal_Int32) ));
int nTextScale = maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight;
int nNormalAngle = mnTextAngle;
@@ -447,7 +447,7 @@ bool PrinterGfx::drawVerticalizedText(
double fSin = sin( -2.0*M_PI*nNormalAngle/3600 );
double fCos = cos( -2.0*M_PI*nNormalAngle/3600 );
- bool* pGsubFlags = (bool*)alloca( nLen * sizeof(bool) );
+ bool* pGsubFlags = static_cast<bool*>(alloca( nLen * sizeof(bool) ));
rMgr.hasVerticalSubstitutions( mnFontID, pStr, nLen, pGsubFlags );
Point aPoint( rPoint );
@@ -546,7 +546,7 @@ PrinterGfx::LicenseWarning(const Point& rPoint, const sal_Unicode* pStr,
PSSetFont (aFontName, RTL_TEXTENCODING_ISO_8859_1);
sal_Size nSize = 4 * nLen;
- unsigned char* pBuffer = (unsigned char*)alloca (nSize* sizeof(unsigned char));
+ unsigned char* pBuffer = static_cast<unsigned char*>(alloca (nSize* sizeof(unsigned char)));
ConverterFactory &rCvt = GetConverterFactory ();
nSize = rCvt.Convert (pStr, nLen, pBuffer, nSize, RTL_TEXTENCODING_ISO_8859_1);