[Libreoffice-commits] core.git: 8 commits - lotuswordpro/source sc/source sw/qa sw/source writerfilter/source
Caolán McNamara
caolanm at redhat.com
Fri Jun 6 13:28:54 PDT 2014
lotuswordpro/source/filter/xfilter/xfcellstyle.cxx | 2 +-
lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx | 2 +-
lotuswordpro/source/filter/xfilter/xftextstyle.cxx | 2 +-
sc/source/filter/xml/xmlexprt.cxx | 2 +-
sc/source/ui/dbgui/filtdlg.cxx | 2 +-
sw/qa/extras/uiwriter/uiwriter.cxx | 10 ++++++++++
sw/source/core/table/swtable.cxx | 2 +-
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 2 ++
8 files changed, 18 insertions(+), 6 deletions(-)
New commits:
commit cae83eb8b6906bba4abf9b625b84364e5f6e36ca
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 21:27:52 2014 +0100
commit id with ccc in it breaks regression test
Change-Id: I1a222fdd5e837a4d0071f8b4d03b80c1d104f235
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3b7cfcf..11fa7df 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -229,6 +229,16 @@ void SwUiWriterTest::testExportRTF()
aWrt.Write(xWrt);
OString aData(static_cast<const sal_Char*>(aStream.GetBuffer()), aStream.GetSize());
+
+ //Amusingly eventually there was a commit id with "ccc" in it, and so the rtf contained
+ //{\*\generator LibreOfficeDev/4.4.0.0.alpha0$Linux_X86_64 LibreOffice_project/f70664ccc6837f2cc21a29bb4f44e41e100efe6b}
+ //so the test fell over. so strip the generator tag
+ sal_Int32 nGeneratorStart = aData.indexOf("{\\*\\generator ");
+ CPPUNIT_ASSERT(nGeneratorStart != -1);
+ sal_Int32 nGeneratorEnd = aData.indexOf('}', nGeneratorStart + 1);
+ CPPUNIT_ASSERT(nGeneratorEnd != -1);
+ aData = aData.replaceAt(nGeneratorStart, nGeneratorEnd-nGeneratorStart+1, "");
+
CPPUNIT_ASSERT(aData.startsWith("{\\rtf1"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aData.indexOf("aaa"));
CPPUNIT_ASSERT(aData.indexOf("bbb") != -1);
commit 483626d8372309d1562a74ce659288f0905b4198
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 21:04:06 2014 +0100
coverity#1209548 Unchecked dynamic_cast
Change-Id: I0adb2380d6804fef43812be3b9a6f32706fd7a4a
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 0312a43..772043e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -289,6 +289,8 @@ void DomainMapper_Impl::RemoveDummyParaForTableInSection()
SetIsDummyParaAddedForTableInSection(false);
PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_SECTION);
SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
+ if (!pSectionContext)
+ return;
uno::Reference< text::XTextCursor > xCursor = GetTopTextAppend()->createTextCursorByRange(pSectionContext->GetStartingRange());
uno::Reference<container::XEnumerationAccess> xEnumerationAccess(xCursor, uno::UNO_QUERY);
commit 8a0230e78ce2a752749b62f0761849a72b367551
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 21:00:01 2014 +0100
coverity#735444 Logically dead code
Change-Id: I32b6475812be6dfd9912f7fc6646b349cdbfbbe1
diff --git a/lotuswordpro/source/filter/xfilter/xftextstyle.cxx b/lotuswordpro/source/filter/xfilter/xftextstyle.cxx
index cf4f6cc..644a322 100644
--- a/lotuswordpro/source/filter/xfilter/xftextstyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xftextstyle.cxx
@@ -84,7 +84,7 @@ bool XFTextStyle::Equal(IXFStyle *pStyle)
return false;
}
- XFTextStyle *pOther = (XFTextStyle*)pStyle;
+ XFTextStyle *pOther = dynamic_cast<XFTextStyle*>(pStyle);
if( !pOther )
{
return false;
commit 6d462764cff1e41114599c51eea7fa6e53489e59
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 20:59:20 2014 +0100
coverity#735442 Logically dead code
Change-Id: I8e182a18e70f230e67f2f452bbfca442e5585212
diff --git a/lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx b/lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx
index fd97d5c..7a96d6f 100644
--- a/lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx
@@ -79,7 +79,7 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle)
{
if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleNumber )
return false;
- XFNumberStyle *pOther = (XFNumberStyle*)pStyle;
+ XFNumberStyle *pOther = dynamic_cast<XFNumberStyle*>(pStyle);
if( !pOther )
return false;
commit 9656d6c488a0df551a3c9aab4fea23a3b23a97c0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 20:58:31 2014 +0100
coverity#735441 Logically dead code
Change-Id: I790904fb030d2bfc96cd967b2b4b449e62f8c536
diff --git a/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx b/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx
index 42bf245..b0d4881 100644
--- a/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfcellstyle.cxx
@@ -124,7 +124,7 @@ bool XFCellStyle::Equal(IXFStyle *pStyle)
if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleTableCell )
return false;
- XFCellStyle *pOther = static_cast<XFCellStyle*>(pStyle);
+ XFCellStyle *pOther = dynamic_cast<XFCellStyle*>(pStyle);
if( !pOther )
return false;
commit 05aa604f029a4d09c4991c04b7bd90165dd759cf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 20:50:05 2014 +0100
coverity#735910 Dereference after null check
Change-Id: Ifc85be1fc2c0e6d6764c0f1c4a237623d6d13a7b
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index c3a7ce4..2f2666e 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1459,7 +1459,7 @@ SwTableBox* SwTable::GetTblBox( sal_uLong nSttIdx )
if ( pTblNd && pTblNd->GetTable().GetFrmFmt() )
pModify = pTblNd->GetTable().GetFrmFmt();
- SwFrm* pFrm = SwIterator<SwFrm,SwModify>::FirstElement( *pModify );
+ SwFrm* pFrm = pModify ? SwIterator<SwFrm,SwModify>::FirstElement(*pModify) : NULL;
while ( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
if ( pFrm )
commit cf624463024112689ff8593fd6fd82a488c07566
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 20:47:46 2014 +0100
coverity#735806 Dereference after null check
Change-Id: Ie7a05e694585bcc624bd69b4400d84a05fbc48fb
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index b6ff4e1..7824f09 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -294,7 +294,7 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet )
}
else if ( i == 0 )
{
- nFieldSelPos = GetFieldSelPos( pViewData->GetCurX() );
+ nFieldSelPos = pViewData ? GetFieldSelPos(pViewData->GetCurX()) : 0;
rEntry.nField = nFieldSelPos ? (theQueryData.nCol1 +
static_cast<SCCOL>(nFieldSelPos) - 1) : static_cast<SCCOL>(0);
rEntry.bDoQuery=true;
commit 105021a1f3d103803dab2d8f277eea2a46e993f5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 6 20:45:59 2014 +0100
coverity#735798 Dereference after null check
Change-Id: I57accad3d086f0c4ac4592b1f4dbd9852596196b
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index a76033f..33eca25 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2934,7 +2934,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
GetColumnRowHeader(bHasColumnHeader, aColumnHeaderRange, bHasRowHeader, aRowHeaderRange, sPrintRanges);
if( !sPrintRanges.isEmpty() )
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT_RANGES, sPrintRanges );
- else if (!pDoc->IsPrintEntireSheet(static_cast<SCTAB>(nTable)))
+ else if (pDoc && !pDoc->IsPrintEntireSheet(static_cast<SCTAB>(nTable)))
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
SvXMLElementExport aElemT(*this, sElemTab, true, true);
More information about the Libreoffice-commits
mailing list