[Libreoffice-commits] .: 10 commits - editeng/source sc/inc sc/source sd/source svtools/source
Tor Lillqvist
tml at kemper.freedesktop.org
Fri Mar 2 02:09:38 PST 2012
editeng/source/outliner/outleeng.cxx | 2 +-
sc/inc/dpcachetable.hxx | 1 +
sc/source/core/data/dpgroup.cxx | 1 +
sc/source/core/data/fillinfo.cxx | 5 ++++-
sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 2 +-
sc/source/filter/xml/xmlnexpi.hxx | 1 +
sc/source/ui/docshell/docsh6.cxx | 5 -----
sd/source/core/drawdoc2.cxx | 2 +-
sd/source/filter/xml/sdxmlwrp.cxx | 2 +-
svtools/source/dialogs/addresstemplate.cxx | 3 ++-
10 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit 2c1868bb28878a00f2d97918bab88ba845d1f5cd
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:56:09 2012 +0200
WaE: use of logical '&&' with constant operand
Surely a bit test is what is intended here.
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 6f80756..b42802b 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -56,7 +56,7 @@ OutlinerEditEng::~OutlinerEditEng()
void OutlinerEditEng::PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
{
- if( GetControlWord() && EE_CNTRL_OUTLINER )
+ if( GetControlWord() & EE_CNTRL_OUTLINER )
{
PaintFirstLineInfo aInfo( nPara, rStartPos, nBaseLineY, rOrigin, nOrientation, pOutDev );
pOwner->maPaintFirstLineHdl.Call( &aInfo );
commit 40a5db084d3ef5074225e1cb54186bdac355223c
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:51:19 2012 +0200
WaE: equality comparison with extraneous parentheses
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 3887747..dd9c0c9 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -811,7 +811,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
bool bTransform = false;
- if( (nRet == 0) )
+ if( nRet == 0 )
{
if( !sBuildId.isEmpty() )
{
commit 17c60594fad636edcc26fb4c4b884aa1d5c84eb2
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:45:11 2012 +0200
WaE: use of logical '||' with constant operand
A sal_Bool variable is logical-ored with sal_False, wtf? The only way
this can have any meaning is if the sal_Bool variable actually has
some other value than sal_False (0) or sal_True (1); in that case the
logical or will turn it into a sal_True. But I doubt that is the case
here. The code has been like this since initial import in 2000.
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index fb928e8..54a37e8 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -989,7 +989,7 @@ IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl)
pNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, sal_True, sal_True);
}
- SetChanged(bChanged || sal_False);
+ SetChanged(bChanged);
if( mpDocSh )
mpDocSh->SetWaitCursor( sal_False );
commit c48cc19e1345fa7445190cef62224dbfed8433d0
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:34:06 2012 +0200
Re-introduce variable thought unused in 2004 and use it as presumably intended
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 8a7f238..e138075 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -192,7 +192,8 @@ public:
// loop throuzh the given names
const AliasProgrammaticPair* pFields = _rFields.getConstArray();
- for (;pFields != pFields; ++pFields)
+ const AliasProgrammaticPair* pFieldsEnd = pFields + _rFields.getLength();
+ for (;pFields != pFieldsEnd; ++pFields)
{
StringBagIterator aKnownPos = aKnownNames.find( pFields->ProgrammaticName );
if ( aKnownNames.end() != aKnownPos )
commit e50b50974353d49f027415a98bd3fc9938a7c98b
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:19:34 2012 +0200
WaE: unused function
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 9d054bb..372415e 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -81,11 +81,6 @@ struct ScStylePair
SfxStyleSheetBase *pDest;
};
-inline OUString C2U(const char* s)
-{
- return OUString::createFromAscii(s);
-}
-
}
// STATIC DATA -----------------------------------------------------------
commit 99a579d00def43c6d8e30fd8da2644aa85bcbbc4
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:18:16 2012 +0200
WaE: abstract but has non-virtual destructor
diff --git a/sc/source/filter/xml/xmlnexpi.hxx b/sc/source/filter/xml/xmlnexpi.hxx
index d480e78..bdcbec0 100644
--- a/sc/source/filter/xml/xmlnexpi.hxx
+++ b/sc/source/filter/xml/xmlnexpi.hxx
@@ -49,6 +49,7 @@ public:
class Inserter
{
public:
+ virtual ~Inserter() {}
virtual void insert(ScMyNamedExpression* pExp) = 0;
};
commit 928633e77240eb787ed6d34645d4da5b85255ece
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:16:29 2012 +0200
WaE: equality comparison with extraneous parentheses
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 7eadefb..ccb7367 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -536,7 +536,7 @@ void ScXMLChangeTrackingImportHelper::CreateGeneratedActions(ScMyGeneratedList&
ScMyGeneratedList::iterator aEndItr(rList.end());
while (aItr != aEndItr)
{
- if (((*aItr)->nID == 0))
+ if ((*aItr)->nID == 0)
{
ScBaseCell* pCell = NULL;
if ((*aItr)->pCellInfo)
commit 31440ba30eca93f4db2e6d44f57bb25124403856
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:14:58 2012 +0200
WaE: has virtual functions but non-virtual destructor
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 6fbb67b..e52211d 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -278,6 +278,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo
class ScDPGroupDateFilter : public ScDPCacheTable::FilterBase
{
public:
+ virtual ~ScDPGroupDateFilter() {}
ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart,
const Date* pNullDate, const ScDPNumGroupInfo* pNumInfo);
commit 351e3d492778d3bb0f9a1fd758674c58c50c402d
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:14:27 2012 +0200
WaE: has virtual functions but non-virtual destructor
diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx
index 2fc86a8..00e9db2 100644
--- a/sc/inc/dpcachetable.hxx
+++ b/sc/inc/dpcachetable.hxx
@@ -80,6 +80,7 @@ public:
class FilterBase
{
public:
+ virtual ~FilterBase() {}
/** returns true if the matching condition is met for a single cell
value, or false otherwise. */
virtual bool match( const ScDPItemData& rCellData ) const = 0;
commit aa8e8c6bed0824d4840ed35a676dd570264fc543
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 2 11:03:21 2012 +0200
WaE: expression result unused
Ifdef out a couple of weird leftover lines that effectively do
nothing. The code was changed to be like this in 2004. Could some
Calc expert have a look please and clean up? Also, if the intent
really is that bEmbed is always false, a couple of lines below it is
pointless to check if it is true anyway.
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index ff5db74..63c453e 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -513,13 +513,16 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
// nWidth wird nicht mehr einzeln gesetzt
bool bEmbed = false; //bIsEmbedded &&
+#if 0 // Huh? Is this intentional or accidental? Clang warns
+ // "expression result unused", so ifdef out these lines. The
+ // code has been like this since 2004.
nTab >= aEmbedRange.aStart.Tab() &&
nTab <= aEmbedRange.aEnd.Tab() &&
nX >= aEmbedRange.aStart.Col() &&
nX <= aEmbedRange.aEnd.Col() &&
nCurRow >= aEmbedRange.aStart.Row() &&
nCurRow <= aEmbedRange.aEnd.Row();
-
+#endif
if (bScenario)
{
pInfo->pBackground = ScGlobal::GetButtonBrushItem();
More information about the Libreoffice-commits
mailing list