summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2011-02-10 15:39:08 +0100
committerJulien Nabet <serval2412@yahoo.fr>2011-02-10 15:41:00 +0100
commita4e9a5c61409ff63aa917428a13bebeeae90a7a3 (patch)
treef5945d608a426be74093a7aea051138cf8f4937a
parent7a1ed126b39221c639e8152bbef8e9e1b6b4ae0b (diff)
Some cppcheck cleaning
-rw-r--r--starmath/source/cursor.cxx4
-rw-r--r--starmath/source/mathtype.hxx12
-rw-r--r--sw/source/core/text/itratr.cxx2
-rw-r--r--sw/source/ui/dbui/dbtree.cxx2
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx2
-rw-r--r--sw/source/ui/table/tablemgr.cxx3
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx2
-rw-r--r--sw/source/ui/vba/vbarange.hxx4
-rw-r--r--sw/source/ui/vba/vbatable.hxx2
9 files changed, 16 insertions, 17 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 33ae54944f44..8685ee57571c 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -208,11 +208,11 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
SmNodeList *pLineList = NodeToList(pMergeLine);
//Find iterator to patch
SmNodeList::iterator patchPoint = pLineList->end();
- patchPoint--;
+ --patchPoint;
//Convert second line to list
NodeToList(pLine, pLineList);
//Patch the line list
- patchPoint++;
+ ++patchPoint;
SmCaretPos PosAfterDelete = PatchLineList(pLineList, patchPoint);
//Parse the line
pLine = SmNodeListParser().Parse(pLineList);
diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx
index 881209cdfdaa..3dbcdc6c5c2b 100644
--- a/starmath/source/mathtype.hxx
+++ b/starmath/source/mathtype.hxx
@@ -108,12 +108,12 @@ private:
sal_uInt8 nTag,sal_uInt8 nSelector,sal_uInt8 nVariation,
sal_Bool bSilent);
void HandleNudge();
- int xfLMOVE(sal_uInt8 nTest) {return nTest&0x80;}
- int xfAUTO(sal_uInt8 nTest) {return nTest&0x10;}
- int xfEMBELL(sal_uInt8 nTest) {return nTest&0x20;}
- int xfNULL(sal_uInt8 nTest) {return nTest&0x10;}
- int xfLSPACE(sal_uInt8 nTest) {return nTest&0x40;}
- int xfRULER(sal_uInt8 nTest) {return nTest&0x20;}
+ int xfLMOVE(sal_uInt8 nTest) const {return nTest&0x80;}
+ int xfAUTO(sal_uInt8 nTest) const {return nTest&0x10;}
+ int xfEMBELL(sal_uInt8 nTest) const {return nTest&0x20;}
+ int xfNULL(sal_uInt8 nTest) const {return nTest&0x10;}
+ int xfLSPACE(sal_uInt8 nTest) const {return nTest&0x40;}
+ int xfRULER(sal_uInt8 nTest) const {return nTest&0x20;}
sal_uInt8 HandleNodes(SmNode *pNode,int nLevel=0);
int StartTemplate(sal_uInt16 nSelector,sal_uInt16 nVariation=0);
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 80abec451a8a..2348f7469190 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -372,7 +372,7 @@ public:
SwMinMaxArgs( OutputDevice* pOutI, ViewShell* pShI, ULONG& rMinI, ULONG &rMaxI, ULONG &rAbsI )
: pOut( pOutI ), pSh( pShI ), rMin( rMinI ), rMax( rMaxI ), rAbsMin( rAbsI )
{ nRowWidth = nWordWidth = nWordAdd = 0; nNoLineBreak = STRING_LEN; }
- void Minimum( long nNew ) { if( (long)rMin < nNew ) rMin = nNew; }
+ void Minimum( long nNew ) const { if( (long)rMin < nNew ) rMin = nNew; }
void NewWord() { nWordAdd = nWordWidth = 0; }
};
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 74e92b096b90..0362a0e11158 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -98,7 +98,7 @@ class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener >
BOOL HasContext();
SwWrtShell* GetWrtShell() { return pWrtSh;}
void SetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;}
- Reference< XNameAccess > GetContext() {return xDBContext;}
+ Reference< XNameAccess > GetContext() const {return xDBContext;}
Reference<XConnection> GetConnection(const rtl::OUString& rSourceName);
};
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 35b88f06d9fc..546bee72c095 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -136,7 +136,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( bWeiter && bQuickBalloon)
{
SwRect aFldRect;
- USHORT nStyle = 0; // style of quick help
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD |
SwContentAtPos::SW_INETATTR |
SwContentAtPos::SW_FTN |
@@ -152,6 +151,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( rSh.GetContentAtPos( aPos, aCntntAtPos, FALSE, &aFldRect ) )
{
+ USHORT nStyle = 0; // style of quick help
switch( aCntntAtPos.eCntntAtPos )
{
case SwContentAtPos::SW_TABLEBOXFML:
diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx
index 62a4c27380a1..4a471ffedb21 100644
--- a/sw/source/ui/table/tablemgr.cxx
+++ b/sw/source/ui/table/tablemgr.cxx
@@ -139,13 +139,12 @@ void SwTableFUNC::SetColWidth(USHORT nNum, SwTwips nNewWidth )
// aktuelle Breite setzen
// alle folgenden Verschieben
BOOL bCurrentOnly = FALSE;
- SwTwips nWidth = 0;
if ( aCols.Count() > 0 )
{
if(aCols.Count() != GetColCount())
bCurrentOnly = TRUE;
- nWidth = GetColWidth(nNum);
+ SwTwips nWidth = GetColWidth(nNum);
int nDiff = (int)(nNewWidth - nWidth);
if( !nNum )
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 235ea6615184..649c926f1a4f 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -3177,11 +3177,11 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
nMaxCount = static_cast< sal_Int16 >( aAllLangs.size() );
// build return value
- sal_Int32 nCount = 0;
uno::Sequence< lang::Locale > aLanguages( nMaxCount );
lang::Locale* pLanguage = aLanguages.getArray();
if (nMaxCount > 0)
{
+ sal_Int32 nCount = 0;
const SvtLanguageTable aLangTab;
for (std::set< LanguageType >::const_iterator it = aAllLangs.begin(); it != aAllLangs.end(); ++it)
{
diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx
index 139f3e6b5d12..e2a623630cb8 100644
--- a/sw/source/ui/vba/vbarange.hxx
+++ b/sw/source/ui/vba/vbarange.hxx
@@ -57,10 +57,10 @@ public:
SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException);
SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, const css::uno::Reference< css::text::XText >& rText, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException);
virtual ~SwVbaRange();
- css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; }
+ css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; }
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() throw (css::uno::RuntimeException);
- css::uno::Reference< css::text::XText > getXText() { return mxText; }
+ css::uno::Reference< css::text::XText > getXText() const { return mxText; }
void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; }
void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException);
diff --git a/sw/source/ui/vba/vbatable.hxx b/sw/source/ui/vba/vbatable.hxx
index 4c149d0f5823..16345024381d 100644
--- a/sw/source/ui/vba/vbatable.hxx
+++ b/sw/source/ui/vba/vbatable.hxx
@@ -15,7 +15,7 @@ class SwVbaTable : public SwVbaTable_BASE
css::uno::Reference< css::text::XTextTable > mxTextTable;
public:
SwVbaTable( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextTable >& xTextTable) throw ( css::uno::RuntimeException);
- css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; };
+ css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; };
virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL Range( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Select( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);