summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2012-07-27 17:26:52 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-27 17:26:52 +0200
commit12109de90e395affcab4686cff3c2170469fc998 (patch)
tree16c81e7169b981f20ce72987150be94bd666e05c
parentsds chart binfilter import (diff)
downloadbinfilter-12109de90e395affcab4686cff3c2170469fc998.tar.gz
binfilter-12109de90e395affcab4686cff3c2170469fc998.zip
binfilter: fix some warnings
-rw-r--r--binfilter/bf_sc/source/core/data/sc_pivot.cxx4
-rw-r--r--binfilter/bf_svx/source/items/svx_xmlcnitm.cxx10
-rw-r--r--binfilter/bf_sw/source/core/swg/sw_rdnum.cxx11
-rw-r--r--binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx5
-rw-r--r--binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx3
-rw-r--r--binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx2
-rw-r--r--binfilter/bf_sw/source/filter/xml/xmlithlp.hxx2
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 dbe1fc6bf..47d7e3077 100644
--- a/binfilter/bf_sc/source/core/data/sc_pivot.cxx
+++ b/binfilter/bf_sc/source/core/data/sc_pivot.cxx
@@ -692,7 +692,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];
/*?*/ }
@@ -712,7 +712,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 2cece09f7..5192ec217 100644
--- a/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx
+++ b/binfilter/bf_svx/source/items/svx_xmlcnitm.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <memory>
+
#include <com/sun/star/xml/AttributeData.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -97,7 +99,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*/ {
@@ -147,17 +149,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 6e937d675..8ac860694 100644
--- a/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx
+++ b/binfilter/bf_sw/source/core/unocore/sw_unostyle.cxx
@@ -1170,7 +1170,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:
@@ -1209,6 +1209,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 ea59809ac..9903dff24 100644
--- a/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx
+++ b/binfilter/bf_sw/source/filter/xml/sw_xmlimpit.cxx
@@ -516,7 +516,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 1a11bfb5a..0ad4a1f29 100644
--- a/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx
+++ b/binfilter/bf_sw/source/filter/xml/sw_xmlithlp.cxx
@@ -107,7 +107,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 9f8946d39..a83f6e582 100644
--- a/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx
+++ b/binfilter/bf_sw/source/filter/xml/xmlithlp.hxx
@@ -81,7 +81,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[];