incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1362903 - in /incubator/ooo/trunk/main: basic/source/runtime/ cui/source/options/ cui/source/tabpages/ extensions/source/scanner/ filter/source/graphicfilter/icgm/ vcl/source/gdi/ vcl/unx/gtk/a11y/ vcl/unx/gtk/app/
Date Wed, 18 Jul 2012 12:11:49 GMT
Author: alg
Date: Wed Jul 18 12:11:48 2012
New Revision: 1362903

URL: http://svn.apache.org/viewvc?rev=1362903&view=rev
Log:
basic, cui, extensions, filter, vcl: fix some warnings
Patch by: Michael Stahl

Modified:
    incubator/ooo/trunk/main/basic/source/runtime/runtime.cxx
    incubator/ooo/trunk/main/cui/source/options/opthtml.cxx
    incubator/ooo/trunk/main/cui/source/tabpages/numpages.cxx
    incubator/ooo/trunk/main/extensions/source/scanner/sane.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/chart.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/metric.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/outmap.cxx
    incubator/ooo/trunk/main/vcl/unx/gtk/a11y/atkwrapper.cxx
    incubator/ooo/trunk/main/vcl/unx/gtk/app/gtkdata.cxx

Modified: incubator/ooo/trunk/main/basic/source/runtime/runtime.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/basic/source/runtime/runtime.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/basic/source/runtime/runtime.cxx (original)
+++ incubator/ooo/trunk/main/basic/source/runtime/runtime.cxx Wed Jul 18 12:11:48 2012
@@ -731,17 +731,17 @@ sal_Bool SbiRuntime::Step()
 
 		SbiOpcode eOp = (SbiOpcode ) ( *pCode++ );
 		sal_uInt32 nOp1, nOp2;
-		if( eOp <= SbOP0_END )
+        if (eOp < SbOP0_END)
 		{
 			(this->*( aStep0[ eOp ] ) )();
 		}
-		else if( eOp >= SbOP1_START && eOp <= SbOP1_END )
+        else if (eOp >= SbOP1_START && eOp < SbOP1_END)
 		{
 			nOp1 = *pCode++; nOp1 |= *pCode++ << 8; nOp1 |= *pCode++ << 16; nOp1 |= *pCode++
<< 24;
 			
 			(this->*( aStep1[ eOp - SbOP1_START ] ) )( nOp1 );
 		}
-		else if( eOp >= SbOP2_START && eOp <= SbOP2_END )
+        else if (eOp >= SbOP2_START && eOp < SbOP2_END)
 		{
 			nOp1 = *pCode++; nOp1 |= *pCode++ << 8; nOp1 |= *pCode++ << 16; nOp1 |= *pCode++
<< 24;
 			nOp2 = *pCode++; nOp2 |= *pCode++ << 8; nOp2 |= *pCode++ << 16; nOp2 |= *pCode++
<< 24;

Modified: incubator/ooo/trunk/main/cui/source/options/opthtml.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/options/opthtml.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/options/opthtml.cxx (original)
+++ incubator/ooo/trunk/main/cui/source/options/opthtml.cxx Wed Jul 18 12:11:48 2012
@@ -198,7 +198,9 @@ void OfaHtmlTabPage::Reset( const SfxIte
 	aIgnoreFontNamesCB.Check(pHtmlOpt->IsIgnoreFontFamily());
 	sal_uInt16 nExport = pHtmlOpt->GetExportMode();
 	if( nExport >= ( sizeof( aExportToPosArr ) / sizeof( sal_uInt16 ) ) )
-		nExport = 4;	// default for bad config entry is NS 4.0
+    {
+        nExport = 3;    // default for bad config entry is NS 4.0
+    }
 	sal_uInt16 nPosArr = aExportToPosArr[ nExport ];
 //	if( nPosArr == DEPRECATED_ENTRY )
 //		nPosArr = aExportToPosArr[ 4 ];		// again: NS 4.0 is default

Modified: incubator/ooo/trunk/main/cui/source/tabpages/numpages.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/tabpages/numpages.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/tabpages/numpages.cxx (original)
+++ incubator/ooo/trunk/main/cui/source/tabpages/numpages.cxx Wed Jul 18 12:11:48 2012
@@ -3247,6 +3247,12 @@ void SvxNumPositionTabPage::InitControls
 		nMask <<= 1;
 
 	}
+    if (SVX_MAX_NUM <= nLvl)
+    {
+        OSL_ENSURE(false, "cannot happen.");
+        return;
+    }
+
 	if(bSameDistBorderNum)
 	{
 		long nDistBorderNum;

Modified: incubator/ooo/trunk/main/extensions/source/scanner/sane.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/extensions/source/scanner/sane.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/extensions/source/scanner/sane.cxx (original)
+++ incubator/ooo/trunk/main/extensions/source/scanner/sane.cxx Wed Jul 18 12:11:48 2012
@@ -984,7 +984,7 @@ String Sane::GetOptionUnitName( int n )
 	String aText;
 	SANE_Unit nUnit = mppOptions[n]->unit;
     size_t nUnitAsSize = (size_t)nUnit;
-	if( nUnitAsSize > sizeof( ppUnits )/sizeof( ppUnits[0] ) )
+    if (nUnitAsSize >= sizeof(ppUnits)/sizeof(ppUnits[0]))
 		aText = String::CreateFromAscii( "[unknown units]" );
 	else
 		aText = String( ppUnits[ nUnit ], gsl_getSystemTextEncoding() );

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/chart.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/chart.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/chart.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/chart.cxx Wed Jul 18 12:11:48
2012
@@ -67,8 +67,8 @@ void CGMChart::DeleteTextEntry( TextEntr
 			pTAttr = pTAttr->pNextAttribute;
 			delete pTempTAttr;
 		}
-		delete pTextEntry;
 		maTextEntryList.Remove( pTextEntry );
+		delete pTextEntry;
 	}
 };
 

Modified: incubator/ooo/trunk/main/vcl/source/gdi/metric.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/metric.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/metric.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/metric.cxx Wed Jul 18 12:11:48 2012
@@ -748,7 +748,7 @@ bool ParseCMAP( const unsigned char* pCm
             while( cMin < cEnd )
             {
                 int j = 0;
-                for(; (cMin < cEnd) && (j < NINSIZE); ++cMin )
+                for (; (cMin < cEnd) && (j < (NINSIZE-1)); ++cMin)
                 {
                     if( cMin >= 0x0100 )
                         cCharsInp[ j++ ] = static_cast<sal_Char>(cMin >> 8);

Modified: incubator/ooo/trunk/main/vcl/source/gdi/outmap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/outmap.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/outmap.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/outmap.cxx Wed Jul 18 12:11:48 2012
@@ -60,9 +60,10 @@ DBG_NAMEEX( Region )
 
 // =======================================================================
 
-static long aImplNumeratorAry[MAP_PIXEL+1] =
+static int const s_ImplArySize = MAP_PIXEL+1;
+static long aImplNumeratorAry[s_ImplArySize] =
 	{	 1,   1,   5,  50,	  1,   1,  1, 1,  1,	1, 1 };
-static long aImplDenominatorAry[MAP_PIXEL+1] =
+static long aImplDenominatorAry[s_ImplArySize] =
 	 { 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1 };
 
 // -----------------------------------------------------------------------
@@ -1952,9 +1953,9 @@ Region OutputDevice::PixelToLogic( const
 #define ENTER3( eUnitSource, eUnitDest )								\
 	long nNumerator 	 = 1;		\
 	long nDenominator	 = 1;		\
-	DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit");	\
-	DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit");	\
-	if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) )
\
+	DBG_ASSERT( eUnitSource < s_ImplArySize, "Invalid source map unit");	\
+	DBG_ASSERT( eUnitDest < s_ImplArySize, "Invalid destination map unit");	\
+	if( (eUnitSource < s_ImplArySize) && (eUnitDest < s_ImplArySize) )	\
 	{	\
 		nNumerator 	 = aImplNumeratorAry[eUnitSource] * 			\
 						   aImplDenominatorAry[eUnitDest];				\

Modified: incubator/ooo/trunk/main/vcl/unx/gtk/a11y/atkwrapper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/gtk/a11y/atkwrapper.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/gtk/a11y/atkwrapper.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/gtk/a11y/atkwrapper.cxx Wed Jul 18 12:11:48 2012
@@ -313,7 +313,7 @@ static AtkRole mapToAtkRole( sal_Int16 n
         initialized = true;
     }
 
-    static const sal_Int32 nMapSize = sizeof(roleMap)/sizeof(sal_Int16);
+    static const sal_Int32 nMapSize = sizeof(roleMap)/sizeof(roleMap[0]);
     if( 0 <= nRole &&  nMapSize > nRole )
         role = roleMap[nRole];
 

Modified: incubator/ooo/trunk/main/vcl/unx/gtk/app/gtkdata.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/unx/gtk/app/gtkdata.cxx?rev=1362903&r1=1362902&r2=1362903&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/unx/gtk/app/gtkdata.cxx (original)
+++ incubator/ooo/trunk/main/vcl/unx/gtk/app/gtkdata.cxx Wed Jul 18 12:11:48 2012
@@ -364,7 +364,7 @@ GdkCursor* GtkSalDisplay::getFromXPM( co
 
 GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle )
 {
-    if( ePointerStyle > POINTER_COUNT )
+    if (ePointerStyle >= POINTER_COUNT)
         return NULL;
 
 	if ( !m_aCursors[ ePointerStyle ] )



Mime
View raw message