summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-20 03:37:17 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-20 03:37:17 +0000
commitd253a4f0c9b0dd49693d2315557bc392593fb0c5 (patch)
treeecd2bbc2f35668ae3bbcc936f5e6ec452e4fd72d /sal
parent5cb346acadb73c7f02588d240f587dd2c32276f9 (diff)
INTEGRATION: CWS warnings01 (1.7.62); FILE MERGED
2005/09/23 01:48:10 sb 1.7.62.3: RESYNC: (1.7-1.8); FILE MERGED 2005/09/14 12:58:36 sb 1.7.62.2: #i53898# Fixed previous change. 2005/08/29 13:56:09 sb 1.7.62.1: #i53898# Made code warning-free.
Diffstat (limited to 'sal')
-rw-r--r--sal/textenc/convertiso2022jp.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/sal/textenc/convertiso2022jp.c b/sal/textenc/convertiso2022jp.c
index e6238c5468b7..c4a6fe58029e 100644
--- a/sal/textenc/convertiso2022jp.c
+++ b/sal/textenc/convertiso2022jp.c
@@ -4,9 +4,9 @@
*
* $RCSfile: convertiso2022jp.c,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 16:33:03 $
+ * last change: $Author: hr $ $Date: 2006-06-20 04:37:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -294,22 +294,24 @@ sal_Size ImplConvertIso2022JpToUnicode(ImplTextConverterData const * pData,
&& (nInfo & (RTL_TEXTTOUNICODE_INFO_ERROR
| RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL))
== 0)
+ {
if ((nFlags & RTL_TEXTTOUNICODE_FLAGS_FLUSH) == 0)
nInfo |= RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL;
- else
- switch (ImplHandleBadInputTextToUnicodeConversion(
- sal_False, sal_True, 0, nFlags, &pDestBufPtr, pDestBufEnd,
- &nInfo))
- {
- case IMPL_BAD_INPUT_STOP:
- case IMPL_BAD_INPUT_CONTINUE:
- eState = IMPL_ISO_2022_JP_TO_UNICODE_STATE_ASCII;
- break;
+ else
+ switch (ImplHandleBadInputTextToUnicodeConversion(
+ sal_False, sal_True, 0, nFlags, &pDestBufPtr, pDestBufEnd,
+ &nInfo))
+ {
+ case IMPL_BAD_INPUT_STOP:
+ case IMPL_BAD_INPUT_CONTINUE:
+ eState = IMPL_ISO_2022_JP_TO_UNICODE_STATE_ASCII;
+ break;
- case IMPL_BAD_INPUT_NO_OUTPUT:
- nInfo |= RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL;
- break;
- }
+ case IMPL_BAD_INPUT_NO_OUTPUT:
+ nInfo |= RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL;
+ break;
+ }
+ }
if (pContext)
{
@@ -399,6 +401,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
if (nChar == 0x0A || nChar == 0x0D) /* LF, CR */
{
if (b0208)
+ {
if (pDestBufEnd - pDestBufPtr >= 3)
{
*pDestBufPtr++ = 0x1B; /* ESC */
@@ -408,6 +411,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
}
else
goto no_output;
+ }
if (pDestBufPtr != pDestBufEnd)
*pDestBufPtr++ = (sal_Char) nChar;
else
@@ -418,6 +422,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
else if (nChar < 0x80)
{
if (b0208)
+ {
if (pDestBufEnd - pDestBufPtr >= 3)
{
*pDestBufPtr++ = 0x1B; /* ESC */
@@ -427,6 +432,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
}
else
goto no_output;
+ }
if (pDestBufPtr != pDestBufEnd)
*pDestBufPtr++ = (sal_Char) nChar;
else
@@ -463,6 +469,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
if (nBytes != 0)
{
if (!b0208)
+ {
if (pDestBufEnd - pDestBufPtr >= 3)
{
*pDestBufPtr++ = 0x1B; /* ESC */
@@ -472,6 +479,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
}
else
goto no_output;
+ }
if (pDestBufEnd - pDestBufPtr >= 2)
{
*pDestBufPtr++ = (sal_Char) (nBytes >> 8);
@@ -525,6 +533,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
{
sal_Bool bFlush = sal_True;
if (nHighSurrogate != 0)
+ {
if ((nFlags & RTL_UNICODETOTEXT_FLAGS_FLUSH) != 0)
nInfo |= RTL_UNICODETOTEXT_INFO_SRCBUFFERTOSMALL;
else
@@ -554,6 +563,7 @@ sal_Size ImplConvertUnicodeToIso2022Jp(ImplTextConverterData const * pData,
nInfo |= RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL;
break;
}
+ }
if (bFlush
&& b0208
&& (nFlags & RTL_UNICODETOTEXT_FLAGS_FLUSH) != 0)