diff options
author | Bernhard Widl <bernhard.widl@cib.de> | 2017-06-19 19:04:03 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-06-26 11:26:54 +0200 |
commit | ef151d297c4c490d8694e14f8f556b56cad3325a (patch) | |
tree | e56331717dc07c87fe862dc892a8d151326600e9 | |
parent | 7850e70d5e98bbfeb536d9644b618d0782da30a6 (diff) |
fdo#43157 convert OSL_ASSERT to assert in sw/source/core
Change-Id: I6ffd9832ff1085c84fde8763045f3d1cb02137e2
Reviewed-on: https://gerrit.libreoffice.org/38974
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/rolbck.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/XMLRangeHelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoflatpara.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unorefmk.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 2 |
14 files changed, 19 insertions, 18 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 85add0f5807a..ccda215a50bd 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1312,7 +1312,7 @@ namespace double& rVal, const LocaleDataWrapper* const pLclData ) { - OSL_ASSERT(pLclData); + assert(pLclData); const sal_Unicode nCurrCmdPos = rCommandPos; rtl_math_ConversionStatus eStatus; const sal_Unicode* pEnd; diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 0a7bbc55edee..9abc001f9530 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -2334,8 +2334,8 @@ int CommonSubseq::FindLCS( int *pLcs1, int *pLcs2, int nStt1, int nEnd1, int nLen1 = nEnd1 ? nEnd1 - nStt1 : rCmp.GetLen1(); int nLen2 = nEnd2 ? nEnd2 - nStt2 : rCmp.GetLen2(); - OSL_ASSERT( nLen1 >= 0 ); - OSL_ASSERT( nLen2 >= 0 ); + assert( nLen1 >= 0 ); + assert( nLen2 >= 0 ); std::unique_ptr<int*[]> pLcs( new int*[ nLen1 + 1 ] ); pLcs[ 0 ] = pData.get(); diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index c08c8b4f23cd..e4e9bcde3719 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -78,7 +78,7 @@ OUString SwNumRule::GetOutlineRuleName() const SwNumFormat& SwNumRule::Get( sal_uInt16 i ) const { - OSL_ASSERT( i < MAXLEVEL && meRuleType < RULE_END ); + assert( i < MAXLEVEL && meRuleType < RULE_END ); return maFormats[ i ] ? *maFormats[ i ] : ( meDefaultNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION @@ -90,7 +90,7 @@ const SwNumFormat* SwNumRule::GetNumFormat( sal_uInt16 i ) const { const SwNumFormat * pResult = nullptr; - OSL_ASSERT( i < MAXLEVEL && meRuleType < RULE_END ); + assert( i < MAXLEVEL && meRuleType < RULE_END ); if ( i < MAXLEVEL && meRuleType < RULE_END) { pResult = maFormats[ i ]; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index d6ceddd2a889..efed71ca8367 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2295,7 +2295,7 @@ TableMergeErr SwDoc::MergeTable( SwPaM& rPam ) if (pU && pU->GetRedlSaveCount()) { SwEditShell *const pEditShell(GetEditShell()); - OSL_ASSERT(pEditShell); + assert(pEditShell); ::sw::UndoRedoContext context(*this, *pEditShell); static_cast<SfxUndoAction *>(pU)->UndoWithContext(context); } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 70f9541ccb04..ef503f3187f4 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -97,7 +97,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) SwPaM& SwPamRanges::SetPam( size_t nArrPos, SwPaM& rPam ) { - OSL_ASSERT( nArrPos < Count() ); + assert( nArrPos < Count() ); const SwPamRange& rTmp = maVector[ nArrPos ]; rPam.GetPoint()->nNode = rTmp.nStart; rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 4651be86e9ea..f5cc213155a2 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -549,7 +549,7 @@ SwHistoryTextFlyCnt::~SwHistoryTextFlyCnt() void SwHistoryTextFlyCnt::SetInDoc( SwDoc* pDoc, bool ) { ::sw::IShellCursorSupplier *const pISCS(pDoc->GetIShellCursorSupplier()); - OSL_ASSERT(pISCS); + assert(pISCS); ::sw::UndoRedoContext context(*pDoc, *pISCS); m_pUndo->UndoImpl(context); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index c70a3ccc4d2c..a4e2df354c86 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -2454,7 +2454,7 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) dynamic_cast<SwUndoDelete*>(pEntry->pUndo.get()); SwUndoRedlineDelete *const pUndoRedlineDelete = dynamic_cast<SwUndoRedlineDelete*>(pEntry->pUndo.get()); - OSL_ASSERT(pUndoDelete || pUndoRedlineDelete); + assert(pUndoDelete || pUndoRedlineDelete); if (pUndoRedlineDelete) { // The old content was not empty or he has been merged with the new content diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx index 3c4b828f58d1..d837d841fbb9 100644 --- a/sw/source/core/unocore/XMLRangeHelper.cxx +++ b/sw/source/core/unocore/XMLRangeHelper.cxx @@ -72,7 +72,7 @@ private: void lcl_getXMLStringForCell( const /*::chart::*/XMLRangeHelper::Cell & rCell, OUStringBuffer * output ) { - OSL_ASSERT(output != nullptr); + assert(output != nullptr); if( rCell.empty()) return; diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index f55770676715..6574c92ff75c 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -602,7 +602,7 @@ SwXFieldmark::getCheckboxFieldmark() { // evil #TODO #FIXME casting away the const-ness pCheckboxFm = const_cast<sw::mark::ICheckboxFieldmark*>(dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark())); - OSL_ASSERT( GetBookmark() == nullptr || pCheckboxFm != nullptr ); + assert( GetBookmark() == nullptr || pCheckboxFm != nullptr ); // unclear to me whether GetBookmark() can be null here } return pCheckboxFm; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 91ee7438b020..0622012c867e 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -293,7 +293,7 @@ GetNestedTextContent(SwTextNode & rTextNode, sal_Int32 const nIndex, { ::sw::Meta *const pMeta( static_cast<SwFormatMeta &>(pTextAttr->GetAttr()).GetMeta()); - OSL_ASSERT(pMeta); + assert(pMeta); xRet.set(pMeta->MakeUnoObject(), uno::UNO_QUERY); } return xRet; diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index d77a8f7b8547..2d615bc0c1be 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -471,7 +471,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(co return xRet; const uno::Reference<lang::XUnoTunnel> xFPTunnel(xPara, uno::UNO_QUERY); - OSL_ASSERT(xFPTunnel.is()); + SAL_WARN_IF(!xFPTunnel.is(), "sw.core", "invalid argument"); SwXFlatParagraph* const pFlatParagraph(sw::UnoTunnelGetImplementation<SwXFlatParagraph>(xFPTunnel)); if ( !pFlatParagraph ) @@ -516,7 +516,8 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(c return xRet; const uno::Reference<lang::XUnoTunnel> xFPTunnel(xPara, uno::UNO_QUERY); - OSL_ASSERT(xFPTunnel.is()); + + SAL_WARN_IF(!xFPTunnel.is(), "sw.core", "invalid argument"); SwXFlatParagraph* const pFlatParagraph(sw::UnoTunnelGetImplementation<SwXFlatParagraph>(xFPTunnel)); if ( !pFlatParagraph ) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 123f4405fa40..926d114d34c0 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1972,7 +1972,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark( std::vector<SwTextAttr *>::const_iterator const iter( std::find_if(newMarks.begin(), newMarks.end(), NotContainedIn<SwTextAttr *>(oldMarks))); - OSL_ASSERT(newMarks.end() != iter); + assert(newMarks.end() != iter); if (newMarks.end() != iter) { pTextAttr = *iter; diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index a9a4df177278..675b98813150 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -254,7 +254,7 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam, std::vector<SwTextAttr *>::const_iterator const iter( std::find_if(newMarks.begin(), newMarks.end(), NotContainedIn<SwTextAttr *>(oldMarks))); - OSL_ASSERT(newMarks.end() != iter); + assert(newMarks.end() != iter); if (newMarks.end() != iter) { pTextAttr = *iter; @@ -263,7 +263,7 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam, else { SwTextNode *pTextNd = rPam.GetNode().GetTextNode(); - OSL_ASSERT(pTextNd); + assert(pTextNd); pTextAttr = pTextNd ? rPam.GetNode().GetTextNode()->GetTextAttrForCharAt( rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK) : nullptr; } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 830575f7d37b..68c319125969 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1664,7 +1664,7 @@ SwXText::convertToTextFrame( } SwTextNode *const pTextNode(aStartPam.GetNode().GetTextNode()); - OSL_ASSERT(pTextNode); + assert(pTextNode); if (!pTextNode || !pTextNode->Len()) // don't remove if it contains text! { { // has to be in a block to remove the SwIndexes before |