[Libreoffice-commits] .: writerfilter/qa writerfilter/source
Julien Nabet
serval2412 at kemper.freedesktop.org
Sun Jun 12 14:02:06 PDT 2011
writerfilter/qa/cppunittests/doctok/testdoctok.cxx | 6 ++---
writerfilter/source/dmapper/DomainMapper.cxx | 2 -
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 4 +--
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 4 +--
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 9 +++----
writerfilter/source/dmapper/GraphicImport.cxx | 2 -
writerfilter/source/doctok/Dff.cxx | 6 ++---
writerfilter/source/doctok/WW8DocumentImpl.cxx | 18 +++++++--------
writerfilter/source/doctok/WW8ResourceModelImpl.cxx | 2 -
9 files changed, 26 insertions(+), 27 deletions(-)
New commits:
commit 4e3aa62b7f39e9ce33df2cb0f98ef677ebcdd734
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Jun 12 23:01:56 2011 +0200
Some cppcheck cleaning
diff --git a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
index 015639d..7ddabe1 100644
--- a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
+++ b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
@@ -130,7 +130,7 @@ namespace testdoctok
pDocument = WW8DocumentFactory::createDocument(pStream);
}
- catch (doctok::Exception e)
+ catch (doctok::Exception)
{
clog << "Exception!!" << endl;
}
@@ -169,7 +169,7 @@ namespace testdoctok
++nResult;
}
}
- catch (doctok::Exception e)
+ catch (doctok::Exception)
{
clog << "Exception!!" << endl;
}
@@ -190,7 +190,7 @@ namespace testdoctok
pDocument->resolve(*pStream);
}
- catch (doctok::Exception e)
+ catch (doctok::Exception)
{
clog << "Exception!!" << endl;
}
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index c8a6551..b1f1a95 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1913,7 +1913,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
{
//get value from style sheet and invert it
sal_Int16 nStyleValue = 0;
- double fDoubleValue;
uno::Any aStyleVal = m_pImpl->GetPropertyFromStyleSheet(ePropertyId);
if( !aStyleVal.hasValue() )
{
@@ -1922,6 +1921,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
}
else if(aStyleVal.getValueTypeClass() == uno::TypeClass_FLOAT )
{
+ double fDoubleValue = 0;
//only in case of awt::FontWeight
aStyleVal >>= fDoubleValue;
nIntValue = fDoubleValue > 100. ? 0 : 1;
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index c68e957..91c3c75 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -715,13 +715,13 @@ void DomainMapperTableHandler::endTable()
m_xTableRange = xTable->getAnchor( );
}
- catch (lang::IllegalArgumentException e)
+ catch (lang::IllegalArgumentException)
{
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->chars("failed to import table!");
#endif
}
- catch ( uno::Exception e )
+ catch ( uno::Exception &e )
{
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("exception");
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index f70af75..cc13001 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -425,7 +425,7 @@ void DomainMapperTableManager::endOfRowAction()
dmapper_logger->attribute("span", *aGridSpanIter);
dmapper_logger->endElement();
- aGridSpanIter++;
+ ++aGridSpanIter;
}
}
dmapper_logger->endElement();
@@ -464,7 +464,7 @@ void DomainMapperTableManager::endOfRowAction()
pSeparators[nBorder].Position = nRelPos + nLastRelPos;
pSeparators[nBorder].IsVisible = sal_True;
nLastRelPos = nLastRelPos + nRelPos;
- aSpansIter++;
+ ++aSpansIter;
}
TablePropertyMapPtr pPropMap( new TablePropertyMap );
pPropMap->Insert( PROP_TABLE_COLUMN_SEPARATORS, false, uno::makeAny( aSeparators ) );
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bc2fa9a..759f8e7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -309,9 +309,8 @@ void DomainMapper_Impl::SetIsLastParagraphInSection( bool bIsLast )
void DomainMapper_Impl::PushProperties(ContextType eId)
{
- SectionPropertyMap* pSectionContext = 0;
PropertyMapPtr pInsert(eId == CONTEXT_SECTION ?
- (pSectionContext = new SectionPropertyMap( m_bIsFirstSection )) :
+ (new SectionPropertyMap( m_bIsFirstSection )) :
eId == CONTEXT_PARAGRAPH ? new ParagraphPropertyMap : new PropertyMap);
if(eId == CONTEXT_SECTION)
{
@@ -2576,7 +2575,7 @@ void DomainMapper_Impl::CloseFieldCommand()
{
if (aPartIt->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\l")))
{
- aPartIt++;
+ ++aPartIt;
if (aPartIt == aItEnd)
break;
@@ -2591,7 +2590,7 @@ void DomainMapper_Impl::CloseFieldCommand()
else if (aPartIt->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\o")) ||
aPartIt->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\t")))
{
- aPartIt++;
+ ++aPartIt;
if (aPartIt == aItEnd)
break;
@@ -2601,7 +2600,7 @@ void DomainMapper_Impl::CloseFieldCommand()
sURL = *aPartIt;
}
- aPartIt++;
+ ++aPartIt;
}
if (sURL.getLength() > 0)
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 13c0e6e..6ba4525 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -909,7 +909,7 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
uno::makeAny( aSize.Width ) );
}
}
- catch( const beans::UnknownPropertyException e )
+ catch( const beans::UnknownPropertyException )
{
// It isn't a graphic image
}
diff --git a/writerfilter/source/doctok/Dff.cxx b/writerfilter/source/doctok/Dff.cxx
index d45790e..53dffce 100644
--- a/writerfilter/source/doctok/Dff.cxx
+++ b/writerfilter/source/doctok/Dff.cxx
@@ -216,7 +216,7 @@ sal_uInt32 DffRecord::getShapeType()
Records_t aRecords = findRecords(0xf00a);
- if (aRecords.size() > 0)
+ if (!aRecords.empty())
{
DffFSP * pDffFSP = dynamic_cast<DffFSP*>((*aRecords.begin()).get());
nResult = pDffFSP->get_shptype();
@@ -231,7 +231,7 @@ sal_uInt32 DffRecord::getShapeId()
Records_t aRecords = findRecords(0xf00a);
- if (aRecords.size() > 0)
+ if (!aRecords.empty())
{
DffFSP * pDffFSP = dynamic_cast<DffFSP*>((*aRecords.begin()).get());
nResult = pDffFSP->get_shpid();
@@ -285,7 +285,7 @@ sal_uInt32 DffRecord::getShapeBid()
{
Records_t aRecords = findRecords(0xf00b);
- if (aRecords.size() > 0)
+ if (!aRecords.empty())
{
DffOPTHandler aHandler;
DffOPT * pOpts = dynamic_cast<DffOPT*>((*aRecords.begin()).get());
diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx
index 2a6c5a5..f7b79a3 100644
--- a/writerfilter/source/doctok/WW8DocumentImpl.cxx
+++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx
@@ -196,7 +196,7 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
mpDataStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
("Data")));
}
- catch (ExceptionNotFound e)
+ catch (ExceptionNotFound)
{
}
@@ -205,7 +205,7 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
mpCompObjStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
("\1CompObj")));
}
- catch (ExceptionNotFound e)
+ catch (ExceptionNotFound)
{
}
@@ -646,13 +646,13 @@ void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable,
mCpAndFcs.insert(aCpAndFc);
}
- catch (ExceptionNotFound e)
+ catch (ExceptionNotFound &e)
{
clog << e.getText() << endl;
}
}
}
- catch (ExceptionNotFound e)
+ catch (ExceptionNotFound &e)
{
clog << e.getText() << endl;
}
@@ -859,7 +859,7 @@ writerfilter::Reference<Properties>::Pointer_t WW8DocumentImpl::getProperties
pResult = pFKP->getProperties(rCpAndFc.getFc());
}
- catch (ExceptionOutOfBounds e)
+ catch (ExceptionOutOfBounds)
{
}
}
@@ -999,7 +999,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getListTable() const
pResult = writerfilter::Reference<Table>::Pointer_t(pList);
}
- catch (ExceptionOutOfBounds aException) {
+ catch (ExceptionOutOfBounds) {
}
}
@@ -1023,7 +1023,7 @@ writerfilter::Reference<Table>::Pointer_t WW8DocumentImpl::getLFOTable() const
pResult = writerfilter::Reference<Table>::Pointer_t(pLFOs);
}
- catch (Exception e)
+ catch (Exception &e)
{
clog << e.getText() << endl;
}
@@ -1755,7 +1755,7 @@ void WW8DocumentImpl::resolve(Stream & rStream)
if (pStyleSheet.get() != NULL)
rStream.table(NS_rtf::LN_STYLESHEET, pStyleSheet);
}
- catch (Exception e)
+ catch (Exception &e)
{
clog << e.getText() << endl;
}
@@ -2203,7 +2203,7 @@ BookmarkHelper::getBookmark(const CpAndFc & rCpAndFc)
pResult = writerfilter::Reference<Properties>::Pointer_t
(new Bookmark(getBKF(rCpAndFc), aName));
}
- catch (ExceptionNotFound e)
+ catch (ExceptionNotFound &e)
{
clog << e.getText() << endl;
}
diff --git a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx b/writerfilter/source/doctok/WW8ResourceModelImpl.cxx
index 74f61d6..f4d807a 100644
--- a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx
+++ b/writerfilter/source/doctok/WW8ResourceModelImpl.cxx
@@ -189,7 +189,7 @@ void WW8PropertiesReference::resolve(Properties & rHandler)
++(*pIt);
}
}
- catch (ExceptionOutOfBounds e)
+ catch (ExceptionOutOfBounds)
{
}
}
More information about the Libreoffice-commits
mailing list