summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-17 17:02:58 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-17 18:45:14 +0100
commit5169abbac92f30b950ab19c2c8e285c47fb1f0d7 (patch)
tree12dc79b6a99b1978982f816037a9c1bad23032f0
parent3e5ff1f8d4da3470fa4016264c9410834a9736d8 (diff)
bool improvements
Change-Id: I7ec4f5b2e691ec03e9e2c5ca3a004f1e04efbc27
-rw-r--r--vcl/generic/fontmanager/fontconfig.cxx10
-rw-r--r--vcl/generic/glyphs/glyphcache.cxx2
-rw-r--r--vcl/inc/salframe.hxx2
-rw-r--r--vcl/inc/salwtype.hxx2
-rw-r--r--vcl/inc/sft.hxx4
-rw-r--r--vcl/inc/unx/i18n_ic.hxx4
-rw-r--r--vcl/inc/unx/i18n_im.hxx10
-rw-r--r--vcl/inc/unx/salunxtime.h10
-rw-r--r--vcl/inc/window.h4
-rw-r--r--vcl/source/control/ilstbox.cxx2
-rw-r--r--vcl/source/fontsubset/cff.cxx32
-rw-r--r--vcl/source/fontsubset/gsub.cxx6
-rw-r--r--vcl/source/fontsubset/gsub.h2
-rw-r--r--vcl/source/fontsubset/sft.cxx12
-rw-r--r--vcl/source/fontsubset/ttcr.cxx2
-rw-r--r--vcl/source/gdi/graphictools.cxx2
-rw-r--r--vcl/source/gdi/impfont.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx26
-rw-r--r--vcl/source/gdi/sallayout.cxx4
-rw-r--r--vcl/source/helper/strhelper.cxx8
-rw-r--r--vcl/source/window/layout.cxx6
-rw-r--r--vcl/source/window/winproc.cxx152
-rw-r--r--vcl/unx/generic/app/i18n_ic.cxx2
-rw-r--r--vcl/unx/generic/app/i18n_im.cxx16
-rw-r--r--vcl/unx/generic/app/sm.cxx2
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx2
-rw-r--r--vcl/unx/generic/gdi/salgdi2.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx4
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx5
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx4
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx8
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx2
33 files changed, 175 insertions, 178 deletions
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 0069f5f3f34d..d6bc5565b8cc 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -134,13 +134,13 @@ namespace
{
FcChar8 *pNameA=NULL, *pNameB=NULL;
- int nHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
- int nHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
+ bool nHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
+ bool nHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
if (nHaveA && nHaveB)
return strcmp((const char*)pNameA, (const char*)pNameB);
- return nHaveA - nHaveB;
+ return int(nHaveA) - int(nHaveB);
}
//Sort fonts so that fonts with the same family name are side-by-side, with
@@ -156,8 +156,8 @@ namespace
int nVersionA=0, nVersionB=0;
- int nHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
- int nHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
+ bool nHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
+ bool nHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
if (nHaveA && nHaveB)
return nVersionA > nVersionB;
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
index 4ac5d82a1b9b..4e5e939e4bb9 100644
--- a/vcl/generic/glyphs/glyphcache.cxx
+++ b/vcl/generic/glyphs/glyphcache.cxx
@@ -89,7 +89,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData
size_t nHash = nFontId << 8;
nHash += rFontSelData.mnHeight;
nHash += rFontSelData.mnOrientation;
- nHash += rFontSelData.mbVertical;
+ nHash += size_t(rFontSelData.mbVertical);
nHash += rFontSelData.GetSlant();
nHash += rFontSelData.GetWeight();
#if ENABLE_GRAPHITE
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 4c6965569797..41b510f7e879 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -240,7 +240,7 @@ public:
// that should not know more than necessary about the SalFrame implementation
// (e.g. input methods, printer update handlers).
long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
- { return m_pProc ? m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
+ { return m_pProc ? long(m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent )) : 0; }
};
#endif // INCLUDED_VCL_INC_SALFRAME_HXX
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 4828f39c42db..b592a6ab7768 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -238,7 +238,7 @@ struct SalQueryCharPositionEvent
// - SalFrame-Types -
// ------------------
-typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
+typedef bool (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
sal_uInt16 nEvent, const void* pEvent );
// --------------------
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index b5b0548ffeed..aba541e874b9 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -178,7 +178,7 @@ namespace vcl
sal_uInt8 *ptr; /**< pointer to glyph data */
sal_uInt16 aw; /**< advance width */
sal_Int16 lsb; /**< left sidebearing */
- sal_uInt16 compflag; /**< 0- if non-composite, 1- otherwise */
+ bool compflag; /**< false- if non-composite */
sal_uInt16 npoints; /**< number of points */
sal_uInt16 ncontours; /**< number of contours */
/* */
@@ -225,7 +225,7 @@ namespace vcl
int typoLineGap; /**< OS/2 portable typographc line gap */
int winAscent; /**< ascender metric for Windows */
int winDescent; /**< descender metric for Windows */
- int symbolEncoded; /**< 1: MS symbol encoded 0: not symbol encoded */
+ bool symbolEncoded; /**< true: MS symbol encoded */
int rangeFlag; /**< if set to 1 Unicode Range flags are applicable */
sal_uInt32 ur1; /**< bits 0 - 31 of Unicode Range flags */
sal_uInt32 ur2; /**< bits 32 - 63 of Unicode Range flags */
diff --git a/vcl/inc/unx/i18n_ic.hxx b/vcl/inc/unx/i18n_ic.hxx
index 603451759783..9e7182d9cdd4 100644
--- a/vcl/inc/unx/i18n_ic.hxx
+++ b/vcl/inc/unx/i18n_ic.hxx
@@ -49,14 +49,14 @@ private:
XVaNestedList mpStatusAttributes;
XVaNestedList mpPreeditAttributes;
- Bool SupportInputMethodStyle( XIMStyles *pIMStyles );
+ bool SupportInputMethodStyle( XIMStyles *pIMStyles );
unsigned int GetWeightingOfIMStyle( XIMStyle n_style ) const ;
Bool IsSupportedIMStyle( XIMStyle n_style ) const ;
public:
Bool UseContext() { return mbUseable; }
- Bool IsPreeditMode() { return maClientData.eState == ePreeditStatusActive; }
+ bool IsPreeditMode() { return maClientData.eState == ePreeditStatusActive; }
XIC GetContext() { return maContext; }
void ExtendEventMask( XLIB_Window aFocusWindow );
diff --git a/vcl/inc/unx/i18n_im.hxx b/vcl/inc/unx/i18n_im.hxx
index 0da25d677c78..9f418848d7bc 100644
--- a/vcl/inc/unx/i18n_im.hxx
+++ b/vcl/inc/unx/i18n_im.hxx
@@ -28,7 +28,7 @@ extern "C" char* GetMethodName( XIMStyle nStyle, char *pBuf, int nBufSize);
class VCLPLUG_GEN_PUBLIC SalI18N_InputMethod
{
- Bool mbUseable; // system supports locale as well as status
+ bool mbUseable; // system supports locale as well as status
// and preedit style ?
XIM maMethod;
XIMCallback maDestroyCallback;
@@ -37,13 +37,13 @@ class VCLPLUG_GEN_PUBLIC SalI18N_InputMethod
public:
Bool PosixLocale();
- Bool UseMethod() { return mbUseable; }
+ bool UseMethod() { return mbUseable; }
XIM GetMethod() { return maMethod; }
void HandleDestroyIM();
- Bool CreateMethod( Display *pDisplay );
+ bool CreateMethod( Display *pDisplay );
XIMStyles *GetSupportedStyles() { return mpStyles; }
- Bool SetLocale( const char* pLocale = "" );
- Bool FilterEvent( XEvent *pEvent, XLIB_Window window );
+ bool SetLocale( const char* pLocale = "" );
+ bool FilterEvent( XEvent *pEvent, XLIB_Window window );
SalI18N_InputMethod();
~SalI18N_InputMethod();
diff --git a/vcl/inc/unx/salunxtime.h b/vcl/inc/unx/salunxtime.h
index aa6f4a266396..4715bfdba684 100644
--- a/vcl/inc/unx/salunxtime.h
+++ b/vcl/inc/unx/salunxtime.h
@@ -30,25 +30,23 @@
#endif
#include <sal/types.h>
-inline int operator >= ( const timeval &t1, const timeval &t2 )
+inline bool operator >= ( const timeval &t1, const timeval &t2 )
{
if( t1.tv_sec == t2.tv_sec )
return t1.tv_usec >= t2.tv_usec;
return t1.tv_sec > t2.tv_sec;
}
-inline int operator > ( const timeval &t1, const timeval &t2 )
+inline bool operator > ( const timeval &t1, const timeval &t2 )
{
if( t1.tv_sec == t2.tv_sec )
return t1.tv_usec > t2.tv_usec;
return t1.tv_sec > t2.tv_sec;
}
-inline int operator == ( const timeval &t1, const timeval &t2 )
+inline bool operator == ( const timeval &t1, const timeval &t2 )
{
- if( t1.tv_sec == t2.tv_sec )
- return t1.tv_usec == t2.tv_usec;
- return sal_False;
+ return t1.tv_sec == t2.tv_sec && t1.tv_usec == t2.tv_usec;
}
inline timeval &operator -= ( timeval &t1, const timeval &t2 )
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 87fb5aa331ab..00702c2aee5d 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -97,7 +97,7 @@ namespace vcl {
// - Prototypes -
// --------------
-long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, sal_uInt16 nEvent, const void* pEvent );
+bool ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, sal_uInt16 nEvent, const void* pEvent );
// -----------
// - HitTest -
@@ -406,7 +406,7 @@ public:
// - Hilfsmethoden -
// -----------------
-long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+bool ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
long nX, long nY, sal_uIntPtr nMsgTime,
sal_uInt16 nCode, sal_uInt16 nMode );
void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight );
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index cfd428242ed8..a9761a0b0b1b 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -288,7 +288,7 @@ sal_uInt16 ImplEntryList::FindMatchingEntry( const OUString& rStr, sal_uInt16 nS
nStart++; // decrements right away
const vcl::I18nHelper& rI18nHelper = mpWindow->GetSettings().GetLocaleI18nHelper();
- for ( sal_uInt16 n = nStart; bForward ? ( n < nEntryCount ) : n; )
+ for ( sal_uInt16 n = nStart; bForward ? n < nEntryCount : n != 0; )
{
if ( !bForward )
n--;
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 0fbe9407b633..d57b849ad965 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1113,7 +1113,7 @@ void CffSubsetterContext::convertOneTypeEsc( void)
break;
case TYPE2OP::NOT:
assert( mnStackIdx >= 1 );
- pTop[0] = (pTop[0] == 0);
+ pTop[0] = ValType(pTop[0] == 0);
break;
case TYPE2OP::ABS:
assert( mnStackIdx >= 1 );
@@ -1148,7 +1148,7 @@ void CffSubsetterContext::convertOneTypeEsc( void)
break;
case TYPE2OP::EQ:
assert( mnStackIdx >= 2 );
- pTop[0] = (pTop[0] == pTop[-1]);
+ pTop[0] = ValType(pTop[0] == pTop[-1]);
--mnStackIdx;
break;
case TYPE2OP::DROP:
@@ -2130,22 +2130,22 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
int nPrivEntryCount = 9;
#if !defined(IGNORE_HINTS)
// emit blue hints only if non-default values
- nPrivEntryCount += !mpCffLocal->maOtherBlues.empty();
- nPrivEntryCount += !mpCffLocal->maFamilyBlues.empty();
- nPrivEntryCount += !mpCffLocal->maFamilyOtherBlues.empty();
- nPrivEntryCount += (mpCffLocal->mfBlueScale != 0.0);
- nPrivEntryCount += (mpCffLocal->mfBlueShift != 0.0);
- nPrivEntryCount += (mpCffLocal->mfBlueFuzz != 0.0);
+ nPrivEntryCount += int(!mpCffLocal->maOtherBlues.empty());
+ nPrivEntryCount += int(!mpCffLocal->maFamilyBlues.empty());
+ nPrivEntryCount += int(!mpCffLocal->maFamilyOtherBlues.empty());
+ nPrivEntryCount += int(mpCffLocal->mfBlueScale != 0.0);
+ nPrivEntryCount += int(mpCffLocal->mfBlueShift != 0.0);
+ nPrivEntryCount += int(mpCffLocal->mfBlueFuzz != 0.0);
// emit stem hints only if non-default values
- nPrivEntryCount += (mpCffLocal->maStemStdHW != 0);
- nPrivEntryCount += (mpCffLocal->maStemStdVW != 0);
- nPrivEntryCount += !mpCffLocal->maStemSnapH.empty();
- nPrivEntryCount += !mpCffLocal->maStemSnapV.empty();
+ nPrivEntryCount += int(mpCffLocal->maStemStdHW != 0);
+ nPrivEntryCount += int(mpCffLocal->maStemStdVW != 0);
+ nPrivEntryCount += int(!mpCffLocal->maStemSnapH.empty());
+ nPrivEntryCount += int(!mpCffLocal->maStemSnapV.empty());
// emit other hints only if non-default values
- nPrivEntryCount += (mpCffLocal->mfExpFactor != 0.0);
- nPrivEntryCount += (mpCffLocal->mnLangGroup != 0);
- nPrivEntryCount += (mpCffLocal->mnLangGroup == 1);
- nPrivEntryCount += (mpCffLocal->mbForceBold != false);
+ nPrivEntryCount += int(mpCffLocal->mfExpFactor != 0.0);
+ nPrivEntryCount += int(mpCffLocal->mnLangGroup != 0);
+ nPrivEntryCount += int(mpCffLocal->mnLangGroup == 1);
+ nPrivEntryCount += int(mpCffLocal->mbForceBold != false);
#endif // IGNORE_HINTS
// emit the privdict header
pOut += sprintf( pOut,
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index cf75d28cd4bf..e51fb2ee34f3 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -53,12 +53,12 @@ inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
#define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
-int ReadGSUB( struct _TrueTypeFont* pTTFile,
+bool ReadGSUB( struct _TrueTypeFont* pTTFile,
int nRequestedScript, int nRequestedLangsys )
{
const FT_Byte* pGsubBase = (FT_Byte*)pTTFile->tables[ O_gsub ];
if( !pGsubBase )
- return -1;
+ return false;
// #129682# check offsets inside GSUB table
const FT_Byte* pGsubLimit = pGsubBase + pTTFile->tlens[ O_gsub ];
@@ -73,7 +73,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
// sanity check the GSUB header
if( nVersion != 0x00010000 )
if( nVersion != 0x00001000 ) // workaround for SunBatang etc.
- return -1; // unknown format or broken
+ return false; // unknown format or broken
typedef std::vector<sal_uLong> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
index 66ac7bc3a77f..b4111e48fa88 100644
--- a/vcl/source/fontsubset/gsub.h
+++ b/vcl/source/fontsubset/gsub.h
@@ -27,7 +27,7 @@ int HasVerticalGSUB( struct vcl::_TrueTypeFont* pTTFile );
int UseGSUB( struct vcl::_TrueTypeFont* pTTFile, int nGlyph, int wmode );
-int ReadGSUB( struct vcl::_TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
+bool ReadGSUB( struct vcl::_TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
void ReleaseGSUB( struct vcl::_TrueTypeFont* pTTFile );
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 1fd3e8f4316f..23a15f64d1bb 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -715,9 +715,9 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
PSPathElement p( PS_NOOP );
int x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2, y2, curx, cury;
- int lastOff = 0; /*- last point was off-contour */
+ bool lastOff = false; /*- last point was off-contour */
int scflag = 1; /*- start contour flag */
- int ecflag = 0; /*- end contour flag */
+ bool ecflag = false; /*- end contour flag */
int cp = 0; /*- current point */
int StartContour = 0, EndContour = 1;
@@ -753,7 +753,7 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
cp++;
}
aPathList.push_back( p );
- lastOff = 0;
+ lastOff = false;
scflag = 0;
}
@@ -783,7 +783,7 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
aPathList.push_back( p );
}
}
- x0 = curx; y0 = cury; lastOff = 0;
+ x0 = curx; y0 = cury; lastOff = false;
}
else
{
@@ -810,7 +810,7 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
if (ecflag) {
aPathList.push_back( PSPathElement(PS_CLOSEPATH) );
scflag = 1;
- ecflag = 0;
+ ecflag = false;
cp = EndContour + 1;
if (cp >= srcCount) break;
continue;
@@ -2512,7 +2512,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
d->compflag = (GetInt16( srcptr, 0, 1 ) < 0);
} else {
d->ptr = 0;
- d->compflag = 0;
+ d->compflag = false;
}
d->glyphID = glyphID;
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index f92db8caf4e3..d8a97c16b389 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1370,7 +1370,7 @@ static void ProcessTables(TrueTypeCreator *tt)
if (z > yMax) yMax = z;
}
- if (gd->compflag == 0) { /* non-composite glyph */
+ if (!gd->compflag) { /* non-composite glyph */
if (gd->npoints > maxPoints) maxPoints = gd->npoints;
if (gd->ncontours > maxContours) maxContours = gd->ncontours;
} else { /* composite glyph */
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 1ea6906ade0a..31d9d61d23a7 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -301,7 +301,7 @@ SvStream& WriteSvtGraphicFill( SvStream& rOStm, const SvtGraphicFill& rClass )
int i;
for(i=0; i<SvtGraphicFill::Transform::MatrixSize; ++i)
rOStm.WriteDouble( rClass.maFillTransform.matrix[i] );
- nTmp = rClass.mbTiling;
+ nTmp = sal_uInt16(rClass.mbTiling);
rOStm.WriteUInt16( nTmp );
nTmp = sal::static_int_cast<sal_uInt16>( rClass.maHatchType );
rOStm.WriteUInt16( nTmp );
diff --git a/vcl/source/gdi/impfont.cxx b/vcl/source/gdi/impfont.cxx
index 9b27e3a29cfb..09bb07e77e5c 100644
--- a/vcl/source/gdi/impfont.cxx
+++ b/vcl/source/gdi/impfont.cxx
@@ -174,7 +174,7 @@ int ImplFontCharMap::GetGlyphIndex( sal_UCS4 cChar ) const
// check that we are inside any range
if( (nRange == 0) && (cChar < mpRangeCodes[0]) ) {
// symbol aliasing gives symbol fonts a second chance
- const bool bSymbolic = (mpRangeCodes[0]>=0xF000) & (mpRangeCodes[1]<=0xF0FF);
+ const bool bSymbolic = (mpRangeCodes[0]>=0xF000) && (mpRangeCodes[1]<=0xF0FF);
if( !bSymbolic )
return 0;
// check for symbol aliasing (U+F0xx -> U+00xx)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index f7a73ea5e865..464062aadfd0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2885,10 +2885,10 @@ bool PDFWriterImpl::emitTilings()
CHECK_RETURN( updateObject( it->m_nObject ) );
CHECK_RETURN( writeBuffer( aTilingObj.getStr(), aTilingObj.getLength() ) );
checkAndEnableStreamEncryption( it->m_nObject );
- nTilingStreamSize = writeBuffer( it->m_pTilingStream->GetData(), nTilingStreamSize );
+ bool written = writeBuffer( it->m_pTilingStream->GetData(), nTilingStreamSize );
delete it->m_pTilingStream;
it->m_pTilingStream = NULL;
- if( nTilingStreamSize == 0 )
+ if( !written )
return false;
disableStreamEncryption();
aTilingObj.setLength( 0 );
@@ -6329,8 +6329,8 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
aLine.append( "/Filter/FlateDecode" );
#endif
aLine.append( ">>\nstream\n" );
- CHECK_RETURN( updateObject( nICCObject ) );
- CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
+ if ( !updateObject( nICCObject ) ) return 0;
+ if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return 0;
//get file position
sal_uInt64 nBeginStreamPos = 0;
osl_getFilePos( m_aFile, &nBeginStreamPos );
@@ -6346,31 +6346,31 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
std::vector<unsigned char> xBuffer(nBytesNeeded);
cmsSaveProfileToMem(hProfile, &xBuffer[0], &nBytesNeeded);
cmsCloseProfile(hProfile);
- sal_Int32 nStreamSize = writeBuffer( &xBuffer[0], (sal_Int32) xBuffer.size() );
+ bool written = writeBuffer( &xBuffer[0], (sal_Int32) xBuffer.size() );
disableStreamEncryption();
endCompression();
sal_uInt64 nEndStreamPos = 0;
osl_getFilePos( m_aFile, &nEndStreamPos );
- if( nStreamSize == 0 )
+ if( !written )
return 0;
if( ! writeBuffer( "\nendstream\nendobj\n\n", 19 ) )
return 0 ;
aLine.setLength( 0 );
//emit the stream length object
- CHECK_RETURN( updateObject( nStreamLengthObject ) );
+ if ( !updateObject( nStreamLengthObject ) ) return 0;
aLine.setLength( 0 );
aLine.append( nStreamLengthObject );
aLine.append( " 0 obj\n" );
aLine.append( (sal_Int64)(nEndStreamPos-nBeginStreamPos) );
aLine.append( "\nendobj\n\n" );
- CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
+ if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return 0;
aLine.setLength( 0 );
//emit the OutputIntent dictionary
sal_Int32 nOIObject = createObject();
- CHECK_RETURN( updateObject( nOIObject ) );
+ if ( !updateObject( nOIObject ) ) return 0;
aLine.append( nOIObject );
aLine.append( " 0 obj\n"
"<</Type/OutputIntent/S/GTS_PDFA1/OutputConditionIdentifier");
@@ -6380,7 +6380,7 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
aLine.append("/DestOutputProfile ");
aLine.append( nICCObject );
aLine.append( " 0 R>>\nendobj\n\n" );;
- CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
+ if ( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) return 0;
return nOIObject;
}
@@ -6554,9 +6554,11 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataObj.append( (sal_Int32) aMetadataStream.getLength() );
aMetadataObj.append( ">>\nstream\n" );
- CHECK_RETURN( writeBuffer( aMetadataObj.getStr(), aMetadataObj.getLength() ) );
+ if ( !writeBuffer( aMetadataObj.getStr(), aMetadataObj.getLength() ) )
+ return 0;
//emit the stream
- CHECK_RETURN( writeBuffer( aMetadataStream.getStr(), aMetadataStream.getLength() ) );
+ if ( !writeBuffer( aMetadataStream.getStr(), aMetadataStream.getLength() ) )
+ return 0;
aMetadataObj.setLength( 0 );
aMetadataObj.append( "\nendstream\nendobj\n\n" );
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 51a79f15dd1d..30be7b152ed2 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -357,10 +357,10 @@ bool ImplLayoutRuns::AddPos( int nCharPos, bool bRTL )
{
int nRunPos0 = maRuns[ nIndex-2 ];
int nRunPos1 = maRuns[ nIndex-1 ];
- if( ((nCharPos + bRTL) == nRunPos1) && ((nRunPos0 > nRunPos1) == bRTL) )
+ if( ((nCharPos + int(bRTL)) == nRunPos1) && ((nRunPos0 > nRunPos1) == bRTL) )
{
// extend current run by new charpos
- maRuns[ nIndex-1 ] = nCharPos + !bRTL;
+ maRuns[ nIndex-1 ] = nCharPos + int(!bRTL);
return false;
}
// ignore new charpos when it is in current run
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 41e82929d24a..b5a35266415c 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -23,7 +23,7 @@
namespace psp {
-inline int isSpace( char cChar )
+inline bool isSpace( char cChar )
{
return
cChar == ' ' || cChar == '\t' ||
@@ -31,7 +31,7 @@ inline int isSpace( char cChar )
cChar == 0x0c || cChar == 0x0b;
}
-inline int isSpace( sal_Unicode cChar )
+inline bool isSpace( sal_Unicode cChar )
{
return
cChar == ' ' || cChar == '\t' ||
@@ -39,12 +39,12 @@ inline int isSpace( sal_Unicode cChar )
cChar == 0x0c || cChar == 0x0b;
}
-inline int isProtect( char cChar )
+inline bool isProtect( char cChar )
{
return cChar == '`' || cChar == '\'' || cChar == '"';
}
-inline int isProtect( sal_Unicode cChar )
+inline bool isProtect( sal_Unicode cChar )
{
return cChar == '`' || cChar == '\'' || cChar == '"';
}
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index e3303ded6f53..e22114746f02 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -929,10 +929,10 @@ void VclGrid::calcMaxs(const array_type &A, std::vector<Value> &rWidths, std::ve
sal_Int32 nHeight = rEntry.nSpanHeight;
for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX)
- rWidths[x+nSpanX].m_bExpand = rWidths[x+nSpanX].m_bExpand | pChild->get_hexpand();
+ rWidths[x+nSpanX].m_bExpand |= pChild->get_hexpand();
for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY)
- rHeights[y+nSpanY].m_bExpand = rHeights[y+nSpanY].m_bExpand | pChild->get_vexpand();
+ rHeights[y+nSpanY].m_bExpand |= pChild->get_vexpand();
if (nWidth == 1 || nHeight == 1)
{
@@ -1034,7 +1034,7 @@ VclGrid::Value accumulateValues(const VclGrid::Value &i, const VclGrid::Value &j
{
VclGrid::Value aRet;
aRet.m_nValue = i.m_nValue + j.m_nValue;
- aRet.m_bExpand = i.m_bExpand | j.m_bExpand;
+ aRet.m_bExpand = i.m_bExpand || j.m_bExpand;
return aRet;
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index e6d3d23b5101..90d1b2c56093 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -325,14 +325,14 @@ static long ContextMenuEventLink( void* pCEvent, void* )
return 0;
}
-long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+bool ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
long nX, long nY, sal_uLong nMsgTime,
sal_uInt16 nCode, sal_uInt16 nMode )
{
ImplSVData* pSVData = ImplGetSVData();
Point aMousePos( nX, nY );
Window* pChild;
- long nRet;
+ bool nRet;
sal_uInt16 nClicks;
ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData();
sal_uInt16 nOldCode = pWinFrameData->mnMouseCode;
@@ -349,7 +349,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if( pWindow->ImplGetWindow() == pSVData->maHelpData.mpHelpWin )
{
ImplDestroyHelpWindow( false );
- return 1; // pWindow is dead now - avoid crash!
+ return true; // pWindow is dead now - avoid crash!
}
else
ImplDestroyHelpWindow( true );
@@ -379,7 +379,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
ImplDestroyHelpWindow( true );
if ( aDelData.IsDead() )
- return 1; // pWindow is dead now - avoid crash! (#122045#)
+ return true; // pWindow is dead now - avoid crash! (#122045#)
}
}
else
@@ -393,7 +393,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( pSVData->maWinData.mpAutoScrollWin && (nSVEvent == EVENT_MOUSEBUTTONDOWN) )
{
pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
- return 1;
+ return true;
}
// find mouse window
@@ -406,10 +406,10 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// java client cannot capture mouse correctly
if ( pWindow != pChild->ImplGetFrameWindow() )
- return 0;
+ return false;
if ( bMouseLeave )
- return 0;
+ return false;
}
else
{
@@ -422,7 +422,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// test this because mouse events are buffered in the remote version
// and size may not be in sync
if ( !pChild && !bMouseLeave )
- return 0;
+ return false;
// execute a few tests and catch the message or implement the status
if ( pChild )
@@ -435,7 +435,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// no mouse messages to system object windows ?
// !!!KA: Is it OK to comment this out? !!!
// if ( pChild->ImplGetWindowImpl()->mpSysObj )
-// return 0;
+// return false;
// no mouse messages to disabled windows
// #106845# if the window was disabed during capturing we have to pass the mouse events to release capturing
@@ -462,14 +462,14 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
- return 1;
+ return true;
else
{
// Set normal MousePointer for disabled windows
if ( nSVEvent == EVENT_MOUSEMOVE )
ImplSetMousePointer( pChild );
- return 0;
+ return false;
}
}
@@ -497,7 +497,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// set mouse pointer anew, as it could have changed
// due to the mode switch
ImplSetMousePointer( pChild );
- return 0;
+ return false;
}
pWinFrameData->mnLastMouseWinX = aChildMousePos.X();
@@ -622,7 +622,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
pChild->ImplRemoveDel( &aDelData2 );
}
if ( aDelData.IsDead() )
- return 1;
+ return true;
pMouseMoveWin->ImplRemoveDel( &aDelData );
}
@@ -634,7 +634,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// MouseLeave
if ( !pChild )
- return 0;
+ return false;
}
else
{
@@ -700,7 +700,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
pChild->ImplRemoveDel( &aDelData );
pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
- return 1;
+ return true;
}
else
pChild->ImplRemoveDel( &aDelData );
@@ -724,14 +724,14 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
!(pChild->ImplGetFrameWindow()->GetStyle() & WB_OWNERDRAWDECORATION) ) // ownerdrawdecorated windows must never grab focus
pChild->ToTop();
if ( aDelData.IsDead() )
- return 1;
+ return true;
}
if ( ImplCallPreNotify( aNEvt ) || aDelData.IsDead() )
- nRet = 1;
+ nRet = true;
else
{
- nRet = 0;
+ nRet = false;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
if ( pSVData->maWinData.mpTrackWin )
@@ -746,7 +746,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
pSVData->maWinData.mpTrackTimer->Start();
}
bCallHelpRequest = sal_False;
- nRet = 1;
+ nRet = true;
}
else
{
@@ -773,7 +773,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
{
if ( pSVData->maWinData.mpTrackWin &&
!(pSVData->maWinData.mnTrackFlags & STARTTRACK_MOUSEBUTTONDOWN) )
- nRet = 1;
+ nRet = true;
else
{
pChild->ImplGetWindowImpl()->mbMouseButtonDown = sal_False;
@@ -785,7 +785,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( pSVData->maWinData.mpTrackWin )
{
pChild->EndTracking();
- nRet = 1;
+ nRet = true;
}
else
{
@@ -800,7 +800,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
if ( aDelData.IsDead() )
- return 1;
+ return true;
if ( nSVEvent == EVENT_MOUSEMOVE )
@@ -810,19 +810,19 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
{
if ( bCallHelpRequest && !pSVData->maHelpData.mbKeyboardHelp )
ImplHandleMouseHelpRequest( pChild, pChild->OutputToScreenPixel( aMEvt.GetPosPixel() ) );
- nRet = 1;
+ nRet = true;
}
else if ( !nRet )
{
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
{
if ( !pChild->ImplGetWindowImpl()->mbMouseButtonDown )
- nRet = 1;
+ nRet = true;
}
else
{
if ( !pChild->ImplGetWindowImpl()->mbMouseButtonUp )
- nRet = 1;
+ nRet = true;
}
}
@@ -839,7 +839,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( !bDrag )
{
// Command-Events
- if ( /*(nRet == 0) &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) &&
+ if ( /*!nRet &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) &&
(nCode == MOUSE_MIDDLE) )
{
sal_uInt16 nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
@@ -934,7 +934,7 @@ static Window* ImplGetKeyInputWindow( Window* pWindow )
// -----------------------------------------------------------------------
-static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
+static bool ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, sal_Bool bForward )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -961,7 +961,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
break;
}
if( nVCLEvent && pSVData->mpApp->HandleKey( nVCLEvent, pWindow, &aKeyEvent ) )
- return 1;
+ return true;
}
// #i1820# use locale specific decimal separator
@@ -987,7 +987,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
if ( aKeyCode.IsShift() && aKeyCode.IsMod1() && (aKeyCode.IsMod2() || aKeyCode.IsMod3()) && (aKeyCode.GetCode() == KEY_D) )
{
DBGGUI_START();
- return 1;
+ return true;
}
#endif
@@ -995,7 +995,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
Help::EndExtHelp();
if ( nEvCode == KEY_ESCAPE )
- return 1;
+ return true;
}
if ( pSVData->maHelpData.mpHelpWin )
ImplDestroyHelpWindow( false );
@@ -1005,7 +1005,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
if ( nEvCode == KEY_ESCAPE )
- return 1;
+ return true;
}
if ( pSVData->maWinData.mpTrackWin )
@@ -1026,15 +1026,15 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
}
}
- return 1;
+ return true;
}
else if ( nOrigCode == KEY_RETURN )
{
pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_KEY );
- return 1;
+ return true;
}
else if ( !(pSVData->maWinData.mnTrackFlags & STARTTRACK_KEYINPUT) )
- return 1;
+ return true;
}
// handle FloatingMode
@@ -1049,7 +1049,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
if( !bCtrlF6 )
- return 1;
+ return true;
}
}
}
@@ -1058,14 +1058,14 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
if ( pSVData->maAppData.mpAccelMgr )
{
if ( pSVData->maAppData.mpAccelMgr->IsAccelKey( aKeyCode, nRepeat ) )
- return 1;
+ return true;
}
}
// find window
Window* pChild = ImplGetKeyInputWindow( pWindow );
if ( !pChild )
- return 0;
+ return false;
// --- RTL --- mirror cursor keys
if( (aKeyCode.GetCode() == KEY_LEFT || aKeyCode.GetCode() == KEY_RIGHT) &&
@@ -1079,7 +1079,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
KeyEvent aKeyEvt( (sal_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt );
sal_Bool bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
- long nRet = 1;
+ bool nRet = true;
if ( !bKeyPreNotify && !aDelData.IsDead() )
{
@@ -1099,7 +1099,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
}
if ( aDelData.IsDead() )
- return 1;
+ return true;
pChild->ImplRemoveDel( &aDelData );
@@ -1157,29 +1157,29 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
pChild->RequestHelp( aHelpEvent );
}
else
- nRet = 0;
+ nRet = false;
}
else if ( aKeyCode.IsShift() )
{
if ( pSVData->maHelpData.mbExtHelp )
Help::StartExtHelp();
else
- nRet = 0;
+ nRet = false;
}
}
else
{
if ( ImplCallHotKey( aKeyCode ) )
- nRet = 1;
+ nRet = true;
else
- nRet = 0;
+ nRet = false;
}
}
}
else
{
if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyUp )
- nRet = 0;
+ nRet = false;
}
// #105591# send keyinput to parent if we are a floating window and the key was not pocessed yet
@@ -1193,7 +1193,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
NotifyEvent aNEvt( nSVEvent, pChild, &aKEvt );
sal_Bool bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
if ( aChildDelData.IsDead() )
- return 1;
+ return true;
if ( !bPreNotify )
{
@@ -1211,11 +1211,11 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
if( !aChildDelData.IsDead() )
aNEvt.GetWindow()->ImplNotifyKeyMouseCommandEventListeners( aNEvt );
if ( aChildDelData.IsDead() )
- return 1;
+ return true;
}
if( bPreNotify || !pChild->ImplGetWindowImpl()->mbKeyInput )
- nRet = 1;
+ nRet = true;
}
return nRet;
@@ -1223,7 +1223,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
// -----------------------------------------------------------------------
-static long ImplHandleExtTextInput( Window* pWindow,
+static bool ImplHandleExtTextInput( Window* pWindow,
const OUString& rText,
const sal_uInt16* pTextAttr,
sal_Int32 nCursorPos, sal_uInt16 nCursorFlags )
@@ -1239,7 +1239,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
{
pChild = ImplGetKeyInputWindow( pWindow );
if ( !pChild )
- return 0;
+ return false;
}
if( !pChild->ImplGetWindowImpl()->mpFrameData->mnFocusId )
break;
@@ -1264,7 +1264,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
// be aware of being recursively called in StartExtTextInput
if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
- return 0;
+ return false;
// Test for changes
bool bOnlyCursor = false;
@@ -1318,11 +1318,11 @@ static long ImplHandleExtTextInput( Window* pWindow,
// -----------------------------------------------------------------------
-static long ImplHandleEndExtTextInput( Window* /* pWindow */ )
+static bool ImplHandleEndExtTextInput( Window* /* pWindow */ )
{
ImplSVData* pSVData = ImplGetSVData();
Window* pChild = pSVData->maWinData.mpExtTextInputWin;
- long nRet = 0;
+ bool nRet = false;
if ( pChild )
{
@@ -1394,7 +1394,7 @@ static void ImplHandleExtTextInputPos( Window* pWindow,
// -----------------------------------------------------------------------
-static long ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang )
+static bool ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang )
{
Window* pChild = ImplGetKeyInputWindow( pWindow );
CommandInputContextData aData( eNewLang );
@@ -1427,7 +1427,7 @@ static sal_Bool ImplCallWheelCommand( Window* pWindow, const Point& rPos,
// -----------------------------------------------------------------------
-static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEvt, bool scaleDirectly = false )
+static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEvt, bool scaleDirectly = false )
{
ImplDelData aDogTag( pWindow );
@@ -1437,7 +1437,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if ( pSVData->maHelpData.mpHelpWin )
ImplDestroyHelpWindow( true );
if( aDogTag.IsDead() )
- return 0;
+ return false;
sal_uInt16 nMode;
sal_uInt16 nCode = rEvt.mnCode;
@@ -2017,7 +2017,7 @@ static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
+inline bool ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
{
return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_True,
pEvent->mnX, pEvent->mnY,
@@ -2027,7 +2027,7 @@ inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
+inline bool ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
{
return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False,
pEvent->mnX, pEvent->mnY,
@@ -2037,7 +2037,7 @@ inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent )
+inline bool ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent )
{
return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, sal_False,
pEvent->mnX, pEvent->mnY,
@@ -2052,7 +2052,7 @@ inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent
// -----------------------------------------------------------------------
-inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
+inline bool ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
{
return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, sal_False,
pEvent->mnX, pEvent->mnY,
@@ -2067,17 +2067,17 @@ inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-static long ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ )
+static bool ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ )
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
-static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
+static bool ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
{
// Find SystemWindow and its Menubar and let it dispatch the command
- long nRet = 0;
+ bool nRet = false;
Window *pWin = pWindow->ImplGetWindowImpl()->mpFirstChild;
while ( pWin )
{
@@ -2093,19 +2093,19 @@ static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt
switch( nEvent )
{
case SALEVENT_MENUACTIVATE:
- nRet = pMenuBar->HandleMenuActivateEvent( (Menu*) pEvent->mpMenu ) ? 1 : 0;
+ nRet = pMenuBar->HandleMenuActivateEvent( (Menu*) pEvent->mpMenu );
break;
case SALEVENT_MENUDEACTIVATE:
- nRet = pMenuBar->HandleMenuDeActivateEvent( (Menu*) pEvent->mpMenu ) ? 1 : 0;
+ nRet = pMenuBar->HandleMenuDeActivateEvent( (Menu*) pEvent->mpMenu );
break;
case SALEVENT_MENUHIGHLIGHT:
- nRet = pMenuBar->HandleMenuHighlightEvent( (Menu*) pEvent->mpMenu, pEvent->mnId ) ? 1 : 0;
+ nRet = pMenuBar->HandleMenuHighlightEvent( (Menu*) pEvent->mpMenu, pEvent->mnId );
break;
case SALEVENT_MENUBUTTONCOMMAND:
- nRet = pMenuBar->HandleMenuButtonEvent( (Menu*) pEvent->mpMenu, pEvent->mnId ) ? 1 : 0;
+ nRet = pMenuBar->HandleMenuButtonEvent( (Menu*) pEvent->mpMenu, pEvent->mnId );
break;
case SALEVENT_MENUCOMMAND:
- nRet = pMenuBar->HandleMenuCommandEvent( (Menu*) pEvent->mpMenu, pEvent->mnId ) ? 1 : 0;
+ nRet = pMenuBar->HandleMenuCommandEvent( (Menu*) pEvent->mpMenu, pEvent->mnId );
break;
default:
break;
@@ -2249,10 +2249,10 @@ static void ImplHandleSalExtTextInputPos( Window* pWindow, SalExtTextInputPosEve
// -----------------------------------------------------------------------
-static long ImplHandleShowDialog( Window* pWindow, int nDialogId )
+static bool ImplHandleShowDialog( Window* pWindow, int nDialogId )
{
if( ! pWindow )
- return sal_False;
+ return false;
if( pWindow->GetType() == WINDOW_BORDERWINDOW )
{
@@ -2381,18 +2381,18 @@ static void ImplHandleSalQueryCharPosition( Window *pWindow,
// -----------------------------------------------------------------------
-long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
+bool ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
sal_uInt16 nEvent, const void* pEvent )
{
DBG_TESTSOLARMUTEX();
- long nRet = 0;
+ bool nRet = false;
// #119709# for some unknown reason it is possible to receive events (in this case key events)
// although the corresponding VCL window must have been destroyed already
// at least ImplGetWindowImpl() was NULL in these cases, so check this here
if( pWindow->ImplGetWindowImpl() == NULL )
- return 0;
+ return false;
switch ( nEvent )
{
@@ -2565,15 +2565,15 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
// Message-Schleife beenden
Application::Quit();
- return sal_False;
+ return false;
}
else
{
bInQueryExit = false;
- return sal_True;
+ return true;
}
}
- return sal_False;
+ return false;
}
case SALEVENT_SETTINGSCHANGED:
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index 345f4f75f82b..a649c1523aa8 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -508,7 +508,7 @@ SalI18N_InputContext::IsSupportedIMStyle( XIMStyle nStyle ) const
return False;
}
-Bool
+bool
SalI18N_InputContext::SupportInputMethodStyle( XIMStyles *pIMStyles )
{
mnPreeditStyle = 0;
diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx
index d8377b9e5c32..9d91943e468b 100644
--- a/vcl/unx/generic/app/i18n_im.cxx
+++ b/vcl/unx/generic/app/i18n_im.cxx
@@ -55,11 +55,11 @@ extern "C" char * XSetIMValues(XIM im, ...);
//
// ------------------------------------------------------------------------------------
-Bool
+bool
IMServerKinput2 ()
{
const static char* p_xmodifiers = getenv ("XMODIFIERS");
- const static Bool b_kinput2 = (p_xmodifiers != NULL)
+ const static bool b_kinput2 = (p_xmodifiers != NULL)
&& (strcmp(p_xmodifiers, "@im=kinput2") == 0);
return b_kinput2;
@@ -76,7 +76,7 @@ class XKeyEventOp : XKeyEvent
XKeyEventOp& operator= (const XKeyEvent &rEvent);
void erase ();
- Bool match (const XKeyEvent &rEvent) const;
+ bool match (const XKeyEvent &rEvent) const;
};
void
@@ -122,7 +122,7 @@ XKeyEventOp::erase ()
init();
}
-Bool
+bool
XKeyEventOp::match (const XKeyEvent &rEvent) const
{
return ( (type == XLIB_KeyPress && rEvent.type == KeyRelease)
@@ -216,7 +216,7 @@ IsXWindowCompatibleLocale( const char* p_locale )
// see i8988, i9188, i8930, i16318
// on Solaris the environment needs to be set equivalent to the locale (#i37047#)
-Bool
+bool
SalI18N_InputMethod::SetLocale( const char* pLocale )
{
// check whether we want an Input Method engine, if we don't we
@@ -357,7 +357,7 @@ PrintInputStyle( XIMStyles *pStyle )
// prior to xopendisplay, the xopenim call has to be delayed
//
-Bool
+bool
SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
{
if ( mbUseable )
@@ -405,13 +405,13 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
// give IM the opportunity to look at the event, and possibly hide it
//
-Bool
+bool
SalI18N_InputMethod::FilterEvent( XEvent *pEvent, XLIB_Window window )
{
if (!mbUseable)
return False;
- Bool bFilterEvent = XFilterEvent (pEvent, window);
+ bool bFilterEvent = XFilterEvent (pEvent, window);
if (pEvent->type != XLIB_KeyPress && pEvent->type != KeyRelease)
return bFilterEvent;
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 5ff427348b56..f0d1387ab704 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -239,7 +239,7 @@ IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, SaveYourselfHdl, void*, pStat
{
// Decode argument smuggled in as void*:
sal_uIntPtr nStateVal = reinterpret_cast< sal_uIntPtr >(pStateVal);
- Bool shutdown = nStateVal != 0;
+ bool shutdown = nStateVal != 0;
SAL_INFO("vcl.sm", "posting save documents event shutdown = " << (shutdown ? "true" : "false" ));
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 2c3c160d20bb..cc443a5948ac 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -1111,7 +1111,7 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
rEntry.m_aPixmap = limitXCreatePixmap( pXDisplay, hDrawable_, 1, 1, 32 );
XRenderPictureAttributes aAttr;
- aAttr.repeat = true;
+ aAttr.repeat = int(true);
XRenderPictFormat* pXRPF = rRenderPeer.FindStandardFormat( PictStandardARGB32 );
rEntry.m_aPicture = rRenderPeer.CreatePicture( rEntry.m_aPixmap, pXRPF, CPRepeat, &aAttr );
diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx
index 5c53635c6e45..5d11f00e73a0 100644
--- a/vcl/unx/generic/gdi/salgdi2.cxx
+++ b/vcl/unx/generic/gdi/salgdi2.cxx
@@ -710,7 +710,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, sal_True );
XRenderPictureAttributes aAttr;
- aAttr.repeat = true;
+ aAttr.repeat = int(true);
Picture aAlphaPic = rPeer.CreatePicture( aAlphaPM, pAlphaFormat, CPRepeat, &aAttr );
if( !aAlphaPic )
return false;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index ee1abf8722aa..5705a217e35a 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -3841,7 +3841,7 @@ long X11SalFrame::HandleStateEvent( XPropertyEvent *pEvent )
)
return 0;
- DBG_ASSERT( actual_type = pEvent->atom
+ DBG_ASSERT( actual_type == pEvent->atom
&& 32 == actual_format
&& 2 == nitems
&& 0 == bytes_after, "HandleStateEvent" );
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index aab0961b5b34..a03729eaaf98 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -710,7 +710,7 @@ static GType
ensureTypeFor( uno::XInterface *pAccessible )
{
int i;
- int bTypes[ aTypeTableSize ] = { 0, };
+ bool bTypes[ aTypeTableSize ] = { false, };
OString aTypeName( "OOoAtkObj" );
for( i = 0; i < aTypeTableSize; i++ )
@@ -718,7 +718,7 @@ ensureTypeFor( uno::XInterface *pAccessible )
if( isOfType( pAccessible, aTypeTable[i].aGetUnoType() ) )
{
aTypeName += aTypeTable[i].name;
- bTypes[i] = TRUE;
+ bTypes[i] = true;
}
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 347006fdeab0..b94c198abe84 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -232,7 +232,8 @@ bool GtkSalDisplay::Dispatch( XEvent* pEvent )
it != m_aFrames.end(); ++it )
{
if( (GdkNativeWindow)(*it)->GetSystemData()->aWindow == pEvent->xany.window )
- return static_cast<GtkSalFrame*>(*it)->Dispatch( pEvent );
+ return static_cast<GtkSalFrame*>(*it)->Dispatch( pEvent )
+ ? GDK_FILTER_TRANSLATE : GDK_FILTER_CONTINUE; //TODO
}
}
@@ -573,7 +574,7 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents )
gboolean wasOneEvent = TRUE;
while( nMaxEvents-- && wasOneEvent )
{
- wasOneEvent = g_main_context_iteration( NULL, bWait & !bWasEvent );
+ wasOneEvent = g_main_context_iteration( NULL, bWait && !bWasEvent );
if( wasOneEvent )
bWasEvent = true;
}
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 6e6fef0a9977..f2281e47c7ea 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -369,7 +369,7 @@ GetAlternateKeyCode( const sal_uInt16 nKeyCode )
#if GTK_CHECK_VERSION(3,0,0)
static int debugQueuePureRedraw = 0;
-static int debugRedboxRedraws = 0;
+static bool debugRedboxRedraws = false;
namespace {
/// Decouple SalFrame lifetime from damagetracker lifetime
@@ -3148,7 +3148,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
aEvent.type = GDK_FOCUS_CHANGE;
aEvent.window = widget_get_window( m_pWindow );
aEvent.send_event = sal_True;
- aEvent.in = (pEvent->xclient.data.l[1] == 1);
+ aEvent.in = gint16(pEvent->xclient.data.l[1] == 1);
signalFocus( m_pWindow, &aEvent, this );
}
}
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index d2247045373a..fe5d87a30edd 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -300,15 +300,11 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
// Get internal menu item values.
OUString aText = pVCLMenu->GetItemText( nId );
- sal_Bool itemEnabled = pVCLMenu->IsItemEnabled( nId );
+ bool bEnabled = pVCLMenu->IsItemEnabled( nId );
KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId );
- sal_Bool itemChecked = pVCLMenu->IsItemChecked( nId );
+ bool bChecked = pVCLMenu->IsItemChecked( nId );
MenuItemBits itemBits = pVCLMenu->GetItemBits( nId );
- // Convert internal values to native values.
- gboolean bChecked = ( itemChecked == sal_True ) ? TRUE : FALSE;
- gboolean bEnabled = ( itemEnabled == sal_True ) ? TRUE : FALSE;
-
// Store current item command in command list.
gchar *aCurrentCommand = g_lo_menu_get_command_from_item_in_section( pLOMenu, nSection, nItemPos );
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 3365086c876e..1480d5e78568 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1444,7 +1444,7 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
(nType == CTRL_EDITBOX) ||
(nType == CTRL_PUSHBUTTON && nPart == PART_ENTIRE_CONTROL) ||
(nType == CTRL_CHECKBOX && nPart == PART_ENTIRE_CONTROL) ||
- (nType == CTRL_RADIOBUTTON && nPart == PART_ENTIRE_CONTROL) |
+ (nType == CTRL_RADIOBUTTON && nPart == PART_ENTIRE_CONTROL) ||
(nType == CTRL_TOOLBAR &&
(nPart == PART_BUTTON || nPart == PART_ENTIRE_CONTROL)) ||
((nType == CTRL_SPINBOX) &&