incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1362918 - in /incubator/ooo/trunk/main/sw/source: core/doc/ filter/ww1/ filter/ww8/ ui/app/ ui/dialog/ ui/misc/ ui/table/ ui/utlui/
Date Wed, 18 Jul 2012 12:50:13 GMT
Author: alg
Date: Wed Jul 18 12:50:12 2012
New Revision: 1362918

URL: http://svn.apache.org/viewvc?rev=1362918&view=rev
Log:
sw: fix some warnings
Patch by: Michael Stahl

Modified:
    incubator/ooo/trunk/main/sw/source/core/doc/number.cxx
    incubator/ooo/trunk/main/sw/source/filter/ww1/w1filter.cxx
    incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx
    incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx
    incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx
    incubator/ooo/trunk/main/sw/source/ui/app/docsh.cxx
    incubator/ooo/trunk/main/sw/source/ui/dialog/ascfldlg.cxx
    incubator/ooo/trunk/main/sw/source/ui/misc/num.cxx
    incubator/ooo/trunk/main/sw/source/ui/table/tabledlg.cxx
    incubator/ooo/trunk/main/sw/source/ui/utlui/unotools.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/doc/number.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/doc/number.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/doc/number.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/doc/number.cxx Wed Jul 18 12:50:12 2012
@@ -1292,9 +1292,9 @@ namespace numfunc
             }
             inline sal_Unicode GetChar( sal_uInt8 p_nListLevel ) const
             {
-                if ( p_nListLevel > MAXLEVEL )
+                if (p_nListLevel >= MAXLEVEL)
                 {
-                    p_nListLevel = MAXLEVEL;
+                    p_nListLevel = MAXLEVEL - 1;
                 }
 
                 return mnLevelChars[p_nListLevel];

Modified: incubator/ooo/trunk/main/sw/source/filter/ww1/w1filter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww1/w1filter.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww1/w1filter.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww1/w1filter.cxx Wed Jul 18 12:50:12 2012
@@ -1401,7 +1401,7 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16
 				FAMILY_DONTKNOW, FAMILY_ROMAN, FAMILY_SWISS, FAMILY_MODERN,
 				FAMILY_SCRIPT, FAMILY_DECORATIVE
 			};
-			if (b < sizeof(eFamilyA))
+            if (b < (sizeof(eFamilyA)/sizeof(eFamilyA[0])))
 				eFamily = eFamilyA[b];
 		}
 		else

Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8graf.cxx Wed Jul 18 12:50:12 2012
@@ -263,7 +263,7 @@ static void SetFill( SfxItemSet& rSet, W
     else
     {
         rSet.Put(XFillStyleItem(XFILL_SOLID));  // necessary for textbox
-        if (nPat <= 1 || nPat > sizeof(nPatA))
+        if (nPat <= 1 || ((sizeof(nPatA)/sizeof(nPatA[0])) <= nPat))
         {
             // Solid Background or unknown
             rSet.Put(XFillColorItem(aEmptyStr, WW8TransCol(rFill.dlpcBg)));

Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par5.cxx Wed Jul 18 12:50:12 2012
@@ -943,10 +943,16 @@ long SwWW8ImplReader::Read_Field(WW8PLCF
     if (bNested)
         return 0;
 
-    sal_uInt16 n = ( aF.nId <= eMax ) ? aF.nId : static_cast< sal_uInt16 >(eMax);
// alle > 91 werden 92
+    sal_uInt16 n = (aF.nId <= eMax) ? aF.nId : static_cast<sal_uInt16>(eMax);
     sal_uInt16 nI = n / 32;                     // # des sal_uInt32
     sal_uLong nMask = 1 << ( n % 32 );          // Maske fuer Bits
 
+    if ((sizeof(nFieldTagAlways)/sizeof(nFieldTagAlways[0])) <= nI)
+    {   // if indexes larger than 95 are needed, then a new configuration
+        // item has to be added, and nFieldTagAlways/nFieldTagBad expanded!
+        return aF.nLen;
+    }
+
     if( nFieldTagAlways[nI] & nMask )       // Flag: Tag it
         return Read_F_Tag( &aF );           // Resultat nicht als Text
 

Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par6.cxx Wed Jul 18 12:50:12 2012
@@ -3539,7 +3539,7 @@ bool SwWW8ImplReader::GetFontParams( sal
             break;
         }
     }
-    if( b < sizeof( eFamilyA ) )
+    if (b < (sizeof(eFamilyA)/sizeof(eFamilyA[0])))
         reFamily = eFamilyA[b];
     else
         reFamily = FAMILY_DONTKNOW;

Modified: incubator/ooo/trunk/main/sw/source/ui/app/docsh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/app/docsh.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/app/docsh.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/app/docsh.cxx Wed Jul 18 12:50:12 2012
@@ -1270,7 +1270,7 @@ uno::Reference< frame::XController >
 /* -----------------------------12.02.01 12:08--------------------------------
 
  ---------------------------------------------------------------------------*/
-static const char* pEventNames[] =
+static const char* s_EventNames[] =
 {
 	"OnPageCountChange",
 	"OnMailMerge",
@@ -1279,6 +1279,7 @@ static const char* pEventNames[] =
 	"OnFieldMergeFinished",
 	"OnLayoutFinished"
 };
+static sal_Int32 const s_nEvents(sizeof(s_EventNames)/sizeof(s_EventNames[0]));
 
 Sequence< OUString >	SwDocShell::GetEventNames()
 {
@@ -1296,12 +1297,12 @@ Sequence< OUString >	SwDocShell::GetEven
 	return aRet;
 }
 
-static sal_Int32 nEvents=13;
-
 rtl::OUString SwDocShell::GetEventName( sal_Int32 nIndex )
 {
-	if ( nIndex<nEvents )
-		return ::rtl::OUString::createFromAscii(pEventNames[nIndex]);
+    if (nIndex < s_nEvents)
+    {
+        return ::rtl::OUString::createFromAscii(s_EventNames[nIndex]);
+    }
 	return rtl::OUString();
 }
 

Modified: incubator/ooo/trunk/main/sw/source/ui/dialog/ascfldlg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/dialog/ascfldlg.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/dialog/ascfldlg.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/dialog/ascfldlg.cxx Wed Jul 18 12:50:12 2012
@@ -117,8 +117,6 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Wind
 		{
 			aBuffer[ nBytesRead ] = '0';
 			aBuffer[ nBytesRead+1 ] = '0';
-			if( 0 != ( nBytesRead & 0x00000001 ) )
-				aBuffer[ nBytesRead + 2 ] = '0';
 		}
 
 		sal_Bool bCR = sal_False, bLF = sal_False, bNoNormalChar = sal_False,

Modified: incubator/ooo/trunk/main/sw/source/ui/misc/num.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/misc/num.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/misc/num.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/misc/num.cxx Wed Jul 18 12:50:12 2012
@@ -312,6 +312,11 @@ void SwNumPositionTabPage::InitControls(
 		nMask <<= 1;
 
 	}
+    if (MAXLEVEL <= nLvl)
+    {
+        OSL_ENSURE(false, "cannot happen.");
+        return;
+    }
 	if(bSameDistBorderNum)
 	{
 		long nDistBorderNum;

Modified: incubator/ooo/trunk/main/sw/source/ui/table/tabledlg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/table/tabledlg.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/table/tabledlg.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/table/tabledlg.cxx Wed Jul 18 12:50:12 2012
@@ -1083,6 +1083,12 @@ void   SwTableColumnPage::ModifyHdl( Per
 			if(pEdit == pFieldArr[i])
 				break;
 
+        if (MET_FIELDS <= i)
+        {
+            OSL_ENSURE(false, "cannot happen.");
+            return;
+        }
+
         SetVisibleWidth(aValueTbl[i], static_cast< SwTwips >(pEdit->DenormalizePercent(pEdit->GetValue(
FUNIT_TWIP ))) );
 		nAktPos = aValueTbl[i];
 

Modified: incubator/ooo/trunk/main/sw/source/ui/utlui/unotools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/utlui/unotools.cxx?rev=1362918&r1=1362917&r2=1362918&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/utlui/unotools.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/utlui/unotools.cxx Wed Jul 18 12:50:12 2012
@@ -432,7 +432,8 @@ void SwOneExampleFrame::CreatePopup(cons
 		sal_Int16 nZoom = 0;
 		aZoom >>= nZoom;
 
-		for(sal_uInt16 i = 0; i < 5; i++ )
+        for (sal_uInt16 i = 0;
+                i < (sizeof(nZoomValues)/sizeof(nZoomValues[0])); ++i)
 		{
 			String sTemp;
 			sTemp = String::CreateFromInt32(nZoomValues[i]);
@@ -453,7 +454,8 @@ void SwOneExampleFrame::CreatePopup(cons
 IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
 {
 	sal_uInt16 nId = pMenu->GetCurItemId();
-	if( nId > ITEM_ZOOM && nId < ITEM_ZOOM + 100 )
+    if ((nId > ITEM_ZOOM) &&
+        (nId <= (ITEM_ZOOM + (sizeof(nZoomValues)/sizeof(nZoomValues[0])))))
 	{
 		sal_Int16 nZoom = nZoomValues[nId - ITEM_ZOOM - 1];
 		uno::Reference< view::XViewSettingsSupplier >  xSettings(_xController, uno::UNO_QUERY);



Mime
View raw message