diff options
author | Michael Stahl <mst@openoffice.org> | 2012-08-02 12:12:56 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-08-02 12:12:56 +0200 |
commit | 7ee71d080fe8e52c09da9edd5b4db27a9f763ff4 (patch) | |
tree | 8603ac5b0de29c6bb1e0d6f145e8a23a5d6059df | |
parent | remove useless extern declaration (diff) | |
download | binfilter-7ee71d080fe8e52c09da9edd5b4db27a9f763ff4.tar.gz binfilter-7ee71d080fe8e52c09da9edd5b4db27a9f763ff4.zip |
binfilter: fix some warnings
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | binfilter/bf_sc/source/core/data/sc_pivot.cxx | 4 | ||||
-rw-r--r-- | binfilter/bf_svx/source/items/svx_xmlcnitm.cxx | 10 | ||||
-rw-r--r-- | binfilter/bf_sw/source/core/swg/sw_rdnum.cxx | 11 | ||||
-rw-r--r-- | binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx | 5 | ||||
-rw-r--r-- | binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx | 3 | ||||
-rw-r--r-- | binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx | 2 | ||||
-rw-r--r-- | binfilter/bf_sw/source/filter/xml/xmlithlp.hxx | 2 |
7 files changed, 22 insertions, 15 deletions
diff --git a/binfilter/bf_sc/source/core/data/sc_pivot.cxx b/binfilter/bf_sc/source/core/data/sc_pivot.cxx index b56e261f3..9cd71d499 100644 --- a/binfilter/bf_sc/source/core/data/sc_pivot.cxx +++ b/binfilter/bf_sc/source/core/data/sc_pivot.cxx @@ -702,7 +702,7 @@ static const USHORT nFuncMaskArr[PIVOT_MAXFUNC+1] = /*?*/ DBG_ASSERT(nIndex < PIVOT_MAXFIELD, "no data field (GPF in old versions!)"); /*?*/ if ( nIndex < PIVOT_MAXFIELD ) /*?*/ { -/*?*/ memcpy(&aColArr[nIndex], &aColArr[nIndex+1], (PIVOT_MAXFIELD - nIndex - 1) * sizeof(PivotField)); +/*?*/ memmove(&aColArr[nIndex], &aColArr[nIndex+1], (PIVOT_MAXFIELD - nIndex - 1) * sizeof(PivotField)); /*?*/ aColArr[nColCount-1] = aField; /*?*/ pDataList = pColList[nColCount-1]; /*?*/ } @@ -722,7 +722,7 @@ static const USHORT nFuncMaskArr[PIVOT_MAXFUNC+1] = /*?*/ DBG_ASSERT(nIndex < PIVOT_MAXFIELD, "no data field (GPF in old versions!)"); /*?*/ if ( nIndex < PIVOT_MAXFIELD ) /*?*/ { -/*?*/ memcpy(&aRowArr[nIndex], &aRowArr[nIndex+1], (PIVOT_MAXFIELD - nIndex - 1) * sizeof(PivotField)); +/*?*/ memmove(&aRowArr[nIndex], &aRowArr[nIndex+1], (PIVOT_MAXFIELD - nIndex - 1) * sizeof(PivotField)); /*?*/ aRowArr[nRowCount-1] = aField; /*?*/ pDataList = pRowList[nRowCount-1]; /*?*/ } diff --git a/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx b/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx index 264f02506..f1449541c 100644 --- a/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx +++ b/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <memory> + #include <com/sun/star/xml/AttributeData.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -106,7 +108,7 @@ using rtl::OUString; /*NBFF*/ } /*NBFF*/ else /*NBFF*/ { -/*NBFF*/ SvXMLAttrContainerData* pNewImpl = new SvXMLAttrContainerData; +/*NBFF*/ ::std::auto_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData); /*NBFF*/ /*NBFF*/ try /*NBFF*/ { @@ -156,17 +158,15 @@ using rtl::OUString; /*NBFF*/ if( nAttr == nCount ) /*NBFF*/ { /*NBFF*/ delete pImpl; -/*NBFF*/ pImpl = pNewImpl; -/*NBFF*/ return false; +/*NBFF*/ pImpl = pNewImpl.release(); /*NBFF*/ } /*NBFF*/ else /*NBFF*/ { -/*NBFF*/ delete pNewImpl; +/*NBFF*/ return false; /*NBFF*/ } /*NBFF*/ } /*NBFF*/ catch(...) /*NBFF*/ { -/*NBFF*/ delete pNewImpl; /*NBFF*/ return false; /*NBFF*/ } /*NBFF*/ } diff --git a/binfilter/bf_sw/source/core/swg/sw_rdnum.cxx b/binfilter/bf_sw/source/core/swg/sw_rdnum.cxx index 89c4e2b26..c241e19a0 100644 --- a/binfilter/bf_sw/source/core/swg/sw_rdnum.cxx +++ b/binfilter/bf_sw/source/core/swg/sw_rdnum.cxx @@ -156,13 +156,16 @@ SwNumRule* SwSwgReader::InNumRule() SwNumFmt aFmt; if( r.cur() != SWG_NUMFMT ) { - Error(); delete pRule; return NULL; + Error(); + delete pRule; + return NULL; } aFmt.SetBulletFont( NULL ); InNumFmt( aFmt ); if( !r ) { - delete pRule; return NULL; + delete pRule; + return NULL; } pRule->Set( (USHORT) cFmt[ i ], aFmt ); } @@ -179,8 +182,8 @@ SwNumRule* SwSwgReader::InNumRule() { SwNumFmt aFmt( pRule->Get( i ) ); aFmt.SetIncludeUpperLevels( MAXLEVEL ); - aFmt.SetAbsLSpace( aOldLft[ i ] ); - aFmt.SetFirstLineOffset( aOldFI[ i ] ); + aFmt.SetAbsLSpace( aOldLft[ (i < 5) ? i : 4 ] ); + aFmt.SetFirstLineOffset( aOldFI[ (i < 5) ? i : 4 ] ); aFmt.SetNumberingType(SVX_NUM_ARABIC); if( i ) aFmt.SetSuffix( aEmptyStr ); diff --git a/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx b/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx index 09404ccbe..9c530820e 100644 --- a/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx +++ b/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx @@ -1179,7 +1179,7 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, BOOL bConditional) : Reference < XNameAccess > xFamilies = xFamilySupplier->getStyleFamilies(); Any aAny; - sal_uInt16 nMapId(0); + sal_uInt16 nMapId(PROPERTY_MAP_CHAR_STYLE); switch( eFamily ) { case SFX_STYLE_FAMILY_CHAR: @@ -1218,6 +1218,9 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, BOOL bConditional) : } break; default: + { + OSL_ASSERT(false); + } break; } pPropImpl = new SwStyleProperties_Impl(aSwMapProvider.GetPropertyMap(nMapId)); diff --git a/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx b/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx index 5ee17ee56..f20815fae 100644 --- a/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx +++ b/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx @@ -525,7 +525,8 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue( DEF_LINE_WIDTH_4 ) ) return sal_False; - sal_uInt16 nSize = sizeof( aDBorderWidths ); + sal_uInt16 const nSize = + sizeof(aDBorderWidths)/sizeof(aDBorderWidths[0]); sal_uInt16 i=0; for( i=0; i < nSize; i += 4 ) { diff --git a/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx b/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx index 9ac633494..d16114d61 100644 --- a/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx +++ b/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx @@ -116,7 +116,7 @@ const sal_uInt16 aSBorderWidths[] = SBORDER_ENTRY( 3 ), SBORDER_ENTRY( 4 ) }; -const sal_uInt16 aDBorderWidths[5*11] = +const sal_uInt16 aDBorderWidths[4*11] = { DBORDER_ENTRY( 0 ), DBORDER_ENTRY( 7 ), diff --git a/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx b/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx index 0c70ee695..fb764f12d 100644 --- a/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx +++ b/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx @@ -90,7 +90,7 @@ void lcl_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos, SvxGraphicPosition eVert ); extern const sal_uInt16 aSBorderWidths[]; -extern const sal_uInt16 aDBorderWidths[5*11]; +extern const sal_uInt16 aDBorderWidths[4*11]; extern const struct SvXMLEnumMapEntry psXML_BorderStyles[]; extern const struct SvXMLEnumMapEntry psXML_NamedBorderWidths[]; |