summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2012-07-31 16:36:45 +0200
committerPetr Mladek <pmladek@suse.cz>2012-07-31 16:36:45 +0200
commit24ca96d64e9789b3d83098824c7717e36137042d (patch)
treec1cc010746e28fe886e163084f35a3a924170a46
parentResolves: fdo#45521 restore ascii export for getTextFromPam (diff)
downloadbinfilter-24ca96d64e9789b3d83098824c7717e36137042d.tar.gz
binfilter-24ca96d64e9789b3d83098824c7717e36137042d.zip
binfilter: fix some warnings
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-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 7917a8d1e..58b113d5a 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 6cb65c5ef..575e03696 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 2bf4e59be..17c462218 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[];