diff options
Diffstat (limited to 'vcl/unx/source/printergfx/psputil.cxx')
-rw-r--r-- | vcl/unx/source/printergfx/psputil.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/vcl/unx/source/printergfx/psputil.cxx b/vcl/unx/source/printergfx/psputil.cxx index 3fe106221ad2..5f4723bc867d 100644 --- a/vcl/unx/source/printergfx/psputil.cxx +++ b/vcl/unx/source/printergfx/psputil.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,8 +35,8 @@ #include "tools/debug.hxx" -namespace psp { - +namespace psp { + /* * string convenience routines */ @@ -44,8 +44,8 @@ namespace psp { sal_Int32 getHexValueOf (sal_Int32 nValue, sal_Char* pBuffer) { - const static sal_Char pHex [0x10] = { - '0', '1', '2', '3', '4', '5', '6', '7', + const static sal_Char pHex [0x10] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; pBuffer[0] = pHex [(nValue & 0xF0) >> 4]; @@ -60,14 +60,14 @@ getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer) // get sign sal_Bool bNegative = nValue < 0; nValue = bNegative ? -nValue : nValue; - + // get required buffer size, must be a multiple of two sal_Int32 nPrecision; if (nValue < 0x80) nPrecision = 2; else if (nValue < 0x8000) - nPrecision = 4; + nPrecision = 4; else if (nValue < 0x800000) nPrecision = 6; @@ -96,7 +96,7 @@ getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer) case '6' : pBuffer[0] = 'E'; break; case '7' : pBuffer[0] = 'F'; break; default: DBG_ERROR("Already a signed value"); - } + } } // report precision @@ -121,7 +121,7 @@ getValueOf (sal_Int32 nValue, sal_Char* pBuffer) } sal_Char pInvBuffer [32]; - sal_Int32 nInvChar = 0; + sal_Int32 nInvChar = 0; while (nValue > 0) { pInvBuffer [nInvChar++] = '0' + nValue % 10; @@ -131,14 +131,14 @@ getValueOf (sal_Int32 nValue, sal_Char* pBuffer) { pBuffer [nChar++] = pInvBuffer [--nInvChar]; } - + return nChar; } sal_Int32 appendStr (const sal_Char* pSrc, sal_Char* pDst) { - sal_Int32 nBytes = strlen (pSrc); + sal_Int32 nBytes = strlen (pSrc); strncpy (pDst, pSrc, nBytes + 1); return nBytes; @@ -148,7 +148,7 @@ sal_Int32 appendStr (const sal_Char* pSrc, sal_Char* pDst, sal_Int32 nBytes) { strncpy (pDst, pSrc, nBytes); - pDst [nBytes] = '\0'; + pDst [nBytes] = '\0'; return nBytes; } @@ -161,7 +161,7 @@ WritePS (osl::File* pFile, const sal_Char* pString) { sal_uInt64 nInLength = rtl_str_getLength (pString); sal_uInt64 nOutLength = 0; - + if (nInLength > 0 && pFile) pFile->write (pString, nInLength, nOutLength); @@ -172,7 +172,7 @@ sal_Bool WritePS (osl::File* pFile, const sal_Char* pString, sal_uInt64 nInLength) { sal_uInt64 nOutLength = 0; - + if (nInLength > 0 && pFile) pFile->write (pString, nInLength, nOutLength); @@ -184,7 +184,7 @@ WritePS (osl::File* pFile, const rtl::OString &rString) { sal_uInt64 nInLength = rString.getLength(); sal_uInt64 nOutLength = 0; - + if (nInLength > 0 && pFile) pFile->write (rString, nInLength, nOutLength); @@ -211,7 +211,7 @@ ConverterFactory::~ConverterFactory () rtl_destroyUnicodeToTextConverter (it->second); } -rtl_UnicodeToTextConverter +rtl_UnicodeToTextConverter ConverterFactory::Get (rtl_TextEncoding nEncoding) { if (rtl_isOctetTextEncoding( nEncoding )) @@ -234,7 +234,7 @@ ConverterFactory::Get (rtl_TextEncoding nEncoding) // wrapper for rtl_convertUnicodeToText that handles the usual cases for // textconversion in drawtext sal_Size -ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen, +ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen, sal_uChar *pBuffer, sal_Size nBufferSize, rtl_TextEncoding nEncoding) { const sal_uInt32 nCvtFlags = RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK @@ -245,7 +245,7 @@ ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen, rtl_UnicodeToTextConverter aConverter = Get (nEncoding); rtl_UnicodeToTextContext aContext = rtl_createUnicodeToTextContext (aConverter); - sal_Size nSize = rtl_convertUnicodeToText (aConverter, aContext, + sal_Size nSize = rtl_convertUnicodeToText (aConverter, aContext, pText, nTextLen, (sal_Char*)pBuffer, nBufferSize, nCvtFlags, &nCvtInfo, &nCvtChars); |