[Libreoffice-commits] core.git: 2 commits - toolkit/source tools/source ucb/source unotools/source vcl/source vcl/unx
Takeshi Abe
tabe at fixedpoint.jp
Tue Aug 27 12:56:09 PDT 2013
toolkit/source/awt/vclxtoolkit.cxx | 18 +++++++++---------
tools/source/datetime/tdate.cxx | 2 +-
tools/source/zcodec/zcodec.cxx | 2 +-
ucb/source/core/ucbprops.cxx | 2 +-
unotools/source/config/pathoptions.cxx | 4 ++--
unotools/source/misc/fontcvt.cxx | 10 +++++-----
vcl/source/edit/texteng.cxx | 6 +++---
vcl/source/filter/ixpm/rgbtable.hxx | 2 +-
vcl/source/fontsubset/sft.cxx | 2 +-
vcl/source/gdi/impvect.cxx | 18 +++++++++---------
vcl/source/gdi/outmap.cxx | 4 ++--
vcl/unx/gtk/window/gtksalframe.cxx | 2 +-
vcl/unx/kde/fpicker/kdefpmain.cxx | 2 +-
13 files changed, 37 insertions(+), 37 deletions(-)
New commits:
commit eb6ab3bc045701e3d4b8751751700d8375f89fcc
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Wed Aug 28 04:53:50 2013 +0900
Mark as const
Change-Id: If20ac542f31dd650d6d1cc22ced618f73e1ce773
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 11f1917..719219a 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -32,7 +32,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *buffer);
}
#endif
-static sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
+static const sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
#define MAX_DAYS 3636532
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index 497662c..8d23861 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -35,7 +35,7 @@
#define GZ_COMMENT 0x10 /* bit 4 set: file comment present */
#define GZ_RESERVED 0xE0 /* bits 5..7: reserved */
-static int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
+static const int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
ZCodec::ZCodec( sal_uIntPtr nInBufSize, sal_uIntPtr nOutBufSize, sal_uIntPtr nMemUsage )
: mnCRC(0)
diff --git a/ucb/source/core/ucbprops.cxx b/ucb/source/core/ucbprops.cxx
index 2207a05..ee61cb6 100644
--- a/ucb/source/core/ucbprops.cxx
+++ b/ucb/source/core/ucbprops.cxx
@@ -164,7 +164,7 @@ static const com::sun::star::uno::Type& Sequence_SendMediaTypes_getCppuType()
#define ATTR_DEFAULT ( PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID | PropertyAttribute::MAYBEDEFAULT )
-static PropertyTableEntry __aPropertyTable[] =
+static const PropertyTableEntry __aPropertyTable[] =
{
{ "Account", -1, ATTR_DEFAULT, &OUString_getCppuType },
{ "AutoUpdateInterval", -1, ATTR_DEFAULT, &sal_uInt32_getCppuType },
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 2acbea0..9435505 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -196,7 +196,7 @@ struct VarNameAttribute
VarNameProperty eVarProperty; // Which return value is needed by this path variable
};
-static PropertyStruct aPropNames[] =
+static const PropertyStruct aPropNames[] =
{
{ "Addin", SvtPathOptions::PATH_ADDIN },
{ "AutoCorrect", SvtPathOptions::PATH_AUTOCORRECT },
@@ -224,7 +224,7 @@ static PropertyStruct aPropNames[] =
{ "Fingerprint", SvtPathOptions::PATH_FINGERPRINT }
};
-static VarNameAttribute aVarNameAttribute[] =
+static const VarNameAttribute aVarNameAttribute[] =
{
{ SUBSTITUTE_INSTPATH, VAR_NEEDS_SYSTEM_PATH }, // $(instpath)
{ SUBSTITUTE_PROGPATH, VAR_NEEDS_SYSTEM_PATH }, // $(progpath)
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 516a05a..277afed 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1404,7 +1404,7 @@ void ConvertChar::RecodeString( OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen
struct RecodeTable { const char* pOrgName; ConvertChar aCvt;};
-static RecodeTable aStarSymbolRecodeTable[] =
+static const RecodeTable aStarSymbolRecodeTable[] =
{
// the first two entries must be StarMath and StarBats; do not reorder!
// reason: fgrep for FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
@@ -1428,7 +1428,7 @@ static RecodeTable aStarSymbolRecodeTable[] =
{"mtextra", {aMTExtraTab, "StarSymbol", NULL}}
};
-static RecodeTable aAppleSymbolRecodeTable[] = {
+static const RecodeTable aAppleSymbolRecodeTable[] = {
{"symbol", {aAdobeSymbolToAppleSymbolTab, "AppleSymbol", NULL}}
};
@@ -1451,7 +1451,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con
int nEntries = SAL_N_ELEMENTS(aStarSymbolRecodeTable);
for( int i = 0; i < nEntries; ++i)
{
- RecodeTable& r = aStarSymbolRecodeTable[i];
+ const RecodeTable& r = aStarSymbolRecodeTable[i];
if( aOrgName.equalsAscii( r.pOrgName ) )
{ pCvt = &r.aCvt; break; }
}
@@ -1464,7 +1464,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con
int nEntries = SAL_N_ELEMENTS(aAppleSymbolRecodeTable);
for( int i = 0; i < nEntries; ++i)
{
- RecodeTable& r = aAppleSymbolRecodeTable[i];
+ const RecodeTable& r = aAppleSymbolRecodeTable[i];
if( aOrgName.equalsAscii( r.pOrgName ) )
{ pCvt = &r.aCvt; break; }
}
@@ -1496,7 +1496,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter( const OUString& rOrgName,
nEntries = 2;
for( int i = 0; i < nEntries; ++i )
{
- RecodeTable& r = aStarSymbolRecodeTable[i];
+ const RecodeTable& r = aStarSymbolRecodeTable[i];
if( aName.equalsAscii( r.pOrgName ) )
{ pCvt = &r.aCvt; break; }
}
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index cd84e6f..3710fbf 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -234,9 +234,9 @@ void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth )
}
}
-static sal_Unicode static_aLFText[] = { '\n', 0 };
-static sal_Unicode static_aCRText[] = { '\r', 0 };
-static sal_Unicode static_aCRLFText[] = { '\r', '\n', 0 };
+static const sal_Unicode static_aLFText[] = { '\n', 0 };
+static const sal_Unicode static_aCRText[] = { '\r', 0 };
+static const sal_Unicode static_aCRLFText[] = { '\r', '\n', 0 };
static inline const sal_Unicode* static_getLineEndText( LineEnd aLineEnd )
{
diff --git a/vcl/source/filter/ixpm/rgbtable.hxx b/vcl/source/filter/ixpm/rgbtable.hxx
index 8f86fe8..375dbde 100644
--- a/vcl/source/filter/ixpm/rgbtable.hxx
+++ b/vcl/source/filter/ixpm/rgbtable.hxx
@@ -25,7 +25,7 @@ struct XPMRGBTab
sal_uInt8 blue;
};
-static XPMRGBTab pRGBTable[] = {
+static const XPMRGBTab pRGBTable[] = {
{ "white", 255, 255, 255 },
{ "black", 0, 0, 0 },
{ "snow", 255, 250, 250 },
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 548b2d3..e1dcb76 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -414,7 +414,7 @@ _inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord)
#ifndef NO_TYPE42
/* Hex Formatter functions */
-static char HexChars[] = "0123456789ABCDEF";
+static const char HexChars[] = "0123456789ABCDEF";
static HexFmt *HexFmtNew(FILE *outf)
{
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index d427ba4..027a416 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -45,7 +45,7 @@
struct ChainMove { long nDX; long nDY; };
-static ChainMove aImplMove[ 8 ] = {
+static const ChainMove aImplMove[ 8 ] = {
{ 1L, 0L },
{ 0L, -1L },
{ -1L, 0L },
@@ -56,7 +56,7 @@ static ChainMove aImplMove[ 8 ] = {
{ 1L, 1L }
};
-static ChainMove aImplMoveInner[ 8 ] = {
+static const ChainMove aImplMoveInner[ 8 ] = {
{ 0L, 1L },
{ 1L, 0L },
{ 0L, -1L },
@@ -67,7 +67,7 @@ static ChainMove aImplMoveInner[ 8 ] = {
{ -1L, 0L }
};
-static ChainMove aImplMoveOuter[ 8 ] = {
+static const ChainMove aImplMoveOuter[ 8 ] = {
{ 0L, -1L },
{ -1L, 0L },
{ 0L, 1L },
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index 0f252fa..6327749 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -52,9 +52,9 @@ DBG_NAMEEX( Region )
// =======================================================================
static int const s_ImplArySize = MAP_PIXEL+1;
-static long aImplNumeratorAry[s_ImplArySize] =
+static const long aImplNumeratorAry[s_ImplArySize] =
{ 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1 };
-static long aImplDenominatorAry[s_ImplArySize] =
+static const long aImplDenominatorAry[s_ImplArySize] =
{ 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1 };
// -----------------------------------------------------------------------
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index fd6aa07..7c4ddfb 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -598,7 +598,7 @@ static void activate_uno(GSimpleAction *action, GVariant*, gpointer)
xDisp->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >());
}
-static GActionEntry app_entries[] = {
+static const GActionEntry app_entries[] = {
{ "OptionsTreeDialog", activate_uno, NULL, NULL, NULL, {0} },
{ "About", activate_uno, NULL, NULL, NULL, {0} },
{ "HelpIndex", activate_uno, NULL, NULL, NULL, {0} },
diff --git a/vcl/unx/kde/fpicker/kdefpmain.cxx b/vcl/unx/kde/fpicker/kdefpmain.cxx
index 8178586..ed01feb 100644
--- a/vcl/unx/kde/fpicker/kdefpmain.cxx
+++ b/vcl/unx/kde/fpicker/kdefpmain.cxx
@@ -60,7 +60,7 @@
// Main
//////////////////////////////////////////////////////////////////////////
-static KCmdLineOptions sOptions[] =
+static const KCmdLineOptions sOptions[] =
{
{ "winid <argument>", I18N_NOOP("Window ID to which is the fpicker modal"), "0" },
KCmdLineLastOption
commit 7673a08e7200227b9dbcb7ee8706064f55013c44
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Wed Aug 28 04:53:40 2013 +0900
sal_Bool to bool
Change-Id: I63a05b7ba0954dbc18932de9cbdea4f0c1a18422
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 5ba91b9..09502c1 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -132,14 +132,14 @@ TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt
{
WinBits nWinBits = 0;
- sal_Bool bMessBox = sal_False;
+ bool bMessBox = false;
if ( ( nCompType == WINDOW_INFOBOX ) ||
( nCompType == WINDOW_MESSBOX ) ||
( nCompType == WINDOW_QUERYBOX ) ||
( nCompType == WINDOW_WARNINGBOX ) ||
( nCompType == WINDOW_ERRORBOX ) )
{
- bMessBox = sal_True;
+ bMessBox = true;
}
bool bDecoratedWindow = false;
@@ -337,14 +337,14 @@ static int SAL_CALL ComponentInfoCompare( const void* pFirst, const void* pSecon
sal_uInt16 ImplGetComponentType( const String& rServiceName )
{
- static sal_Bool bSorted = sal_False;
+ static bool bSorted = false;
if( !bSorted )
{
qsort( (void*) aComponentInfos,
sizeof( aComponentInfos ) / sizeof( ComponentInfo ),
sizeof( ComponentInfo ),
ComponentInfoCompare );
- bSorted = sal_True;
+ bSorted = true;
}
@@ -411,7 +411,7 @@ namespace
// ----------------------------------------------------
static sal_Int32 nVCLToolkitInstanceCount = 0;
-static sal_Bool bInitedByVCLToolkit = sal_False;
+static bool bInitedByVCLToolkit = false;
static osl::Mutex & getInitMutex()
{
@@ -527,7 +527,7 @@ void SAL_CALL VCLXToolkit::disposing()
{
Application::Quit();
JoinMainLoopThread();
- bInitedByVCLToolkit = sal_False;
+ bInitedByVCLToolkit = false;
}
}
}
@@ -634,7 +634,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
{
// Wenn die Component einen Parent braucht, dann NULL zurueckgeben,
// spaeter mal ::com::sun::star::uno::Exception...
- sal_Bool bException = sal_True;
+ bool bException = true;
if ( ( nType == WINDOW_DIALOG )
|| ( nType == WINDOW_MODALDIALOG )
|| ( nType == WINDOW_MODELESSDIALOG )
@@ -644,13 +644,13 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
|| ( nType == WINDOW_ERRORBOX )
|| ( nType == WINDOW_QUERYBOX )
)
- bException = sal_False;
+ bException = false;
else if ( ( nType == WINDOW_WINDOW ) ||
( nType == WINDOW_WORKWINDOW ) ||
( nType == VCLWINDOW_FRAMEWINDOW ) )
{
if ( rDescriptor.Type == ::com::sun::star::awt::WindowClass_TOP )
- bException = sal_False;
+ bException = false;
}
if ( bException )
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index de4a9f9..d427ba4 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -82,18 +82,18 @@ struct ImplColorSet
{
BitmapColor maColor;
sal_uInt16 mnIndex;
- sal_Bool mbSet;
+ bool mbSet;
- sal_Bool operator<( const ImplColorSet& rSet ) const;
- sal_Bool operator>( const ImplColorSet& rSet ) const;
+ bool operator<( const ImplColorSet& rSet ) const;
+ bool operator>( const ImplColorSet& rSet ) const;
};
-inline sal_Bool ImplColorSet::operator<( const ImplColorSet& rSet ) const
+inline bool ImplColorSet::operator<( const ImplColorSet& rSet ) const
{
return( mbSet && ( !rSet.mbSet || ( maColor.GetLuminance() > rSet.maColor.GetLuminance() ) ) );
}
-inline sal_Bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
+inline bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
{
return( !mbSet || ( rSet.mbSet && maColor.GetLuminance() < rSet.maColor.GetLuminance() ) );
}
@@ -675,7 +675,7 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pColorSet[ pRAcc->GetPixel( nY, nX ).GetIndex() ].mbSet = 1;
+ pColorSet[ pRAcc->GetPixel( nY, nX ).GetIndex() ].mbSet = true;
qsort( pColorSet, 256, sizeof( ImplColorSet ), ImplColorSetCmpFnc );
More information about the Libreoffice-commits
mailing list