diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-26 17:44:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 08:55:56 +0100 |
commit | 7af733d9ef65fddd12ef5fae82808ba2f7f608df (patch) | |
tree | 360afc7f8c5b7963730885255f631c9896f683b4 | |
parent | 05f5c4d4d6addf5321a40595f598e55dce376f6f (diff) |
tweak assert so comment appears in abort message
Change-Id: Ibf78e5cd1620f0b61cae030e3870be4a6f87e71d
-rw-r--r-- | include/basegfx/raster/bpixelraster.hxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpparastyle.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfdrawline.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfdrawobj.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfframe.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfimage.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/core/api/Section.cxx | 2 | ||||
-rw-r--r-- | unoidl/source/sourceprovider-parser.y | 20 | ||||
-rw-r--r-- | unoidl/source/unoidl-check.cxx | 4 | ||||
-rw-r--r-- | unoidl/source/unoidl-read.cxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 20 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/fontsubset/cff.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bmpfast.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atklistener.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 3 |
19 files changed, 39 insertions, 42 deletions
diff --git a/include/basegfx/raster/bpixelraster.hxx b/include/basegfx/raster/bpixelraster.hxx index cac92e7a9cba..8d250495cf53 100644 --- a/include/basegfx/raster/bpixelraster.hxx +++ b/include/basegfx/raster/bpixelraster.hxx @@ -81,14 +81,14 @@ namespace basegfx // data access read only const BPixel& getBPixel(sal_uInt32 nIndex) const { - assert(nIndex < mnCount); //Access out of range + assert(nIndex < mnCount && "Access out of range"); return mpContent[nIndex]; } // data access read/write BPixel& getBPixel(sal_uInt32 nIndex) { - assert(nIndex < mnCount); //Access out of range + assert(nIndex < mnCount && "Access out of range"); return mpContent[nIndex]; } }; diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index a44d0ae8c73f..825648a5c91e 100644 --- a/lotuswordpro/source/filter/lwpparastyle.cxx +++ b/lotuswordpro/source/filter/lwpparastyle.cxx @@ -611,14 +611,12 @@ void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTabOverRid LwpObjectID& rTabRackID = pTabOverRide->GetTabRackID(); if(rTabRackID.IsNull()) { - //assert(false); return; } LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(rTabRackID.obj().get()); if(!pTabRack) { - //assert(false); return; } diff --git a/lotuswordpro/source/filter/xfilter/xfdrawline.cxx b/lotuswordpro/source/filter/xfilter/xfdrawline.cxx index 3ac859b58ec2..cfdc590c4f21 100644 --- a/lotuswordpro/source/filter/xfilter/xfdrawline.cxx +++ b/lotuswordpro/source/filter/xfilter/xfdrawline.cxx @@ -70,7 +70,7 @@ void XFDrawLine::ToXml(IXFStream *pStrm) if( !GetStyleName().isEmpty() ) pAttrList->AddAttribute( "draw:style-name", GetStyleName() ); - assert(!m_strName.isEmpty()); //name should not be null. + assert(!m_strName.isEmpty() && "name should not be null."); if( !m_strName.isEmpty() ) pAttrList->AddAttribute( "draw:name", m_strName ); //anchor type: diff --git a/lotuswordpro/source/filter/xfilter/xfdrawobj.cxx b/lotuswordpro/source/filter/xfilter/xfdrawobj.cxx index f769e2eb1ec3..c66391360480 100644 --- a/lotuswordpro/source/filter/xfilter/xfdrawobj.cxx +++ b/lotuswordpro/source/filter/xfilter/xfdrawobj.cxx @@ -82,7 +82,7 @@ void XFDrawObject::ToXml(IXFStream *pStrm) if( !GetStyleName().isEmpty() ) pAttrList->AddAttribute( "draw:style-name", GetStyleName() ); - assert(!m_strName.isEmpty()); //name should not be null. + assert(!m_strName.isEmpty() && "name should not be null."); if( !m_strName.isEmpty() ) pAttrList->AddAttribute( "draw:name", m_strName ); //anchor type: diff --git a/lotuswordpro/source/filter/xfilter/xfframe.cxx b/lotuswordpro/source/filter/xfilter/xfframe.cxx index 2af0994cc62f..6cb2dde102fc 100644 --- a/lotuswordpro/source/filter/xfilter/xfframe.cxx +++ b/lotuswordpro/source/filter/xfilter/xfframe.cxx @@ -140,7 +140,7 @@ void XFFrame::StartFrame(IXFStream *pStrm) if( !GetStyleName().isEmpty() ) pAttrList->AddAttribute( "draw:style-name", GetStyleName() ); - assert(!m_strName.isEmpty()); //name should not be null. + assert(!m_strName.isEmpty() && "name should not be null."); if( !m_strName.isEmpty() && m_isTextBox == false) pAttrList->AddAttribute( "draw:name", m_strName ); //anchor type: diff --git a/lotuswordpro/source/filter/xfilter/xfimage.cxx b/lotuswordpro/source/filter/xfilter/xfimage.cxx index 6315833c4043..b8ae90fbe48e 100644 --- a/lotuswordpro/source/filter/xfilter/xfimage.cxx +++ b/lotuswordpro/source/filter/xfilter/xfimage.cxx @@ -93,7 +93,7 @@ void XFImage::ToXml(IXFStream *pStrm) if( !GetStyleName().isEmpty() ) pAttrList->AddAttribute( "draw:style-name", GetStyleName() ); - assert(!m_strName.isEmpty()); //name should not be null. + assert(!m_strName.isEmpty() && "name should not be null."); if( !m_strName.isEmpty() ) pAttrList->AddAttribute( "draw:name", m_strName ); //anchor type: diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index ba60ccfc8599..c12a9619d646 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3084,7 +3084,7 @@ const char* getErrorBarStyle(sal_Int32 nErrorBarStyle) case cssc::ErrorBarStyle::FROM_DATA: return "cust"; default: - assert(false); // can't happen + assert(false && "can't happen"); } return NULL; } diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index a287bc1cf8fb..e70bb3bb96d5 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -199,7 +199,7 @@ void OSection::init() { uno::Reference< report::XReportDefinition> xReport = getReportDefinition(); ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport); - assert(pModel); //"No model set at the report definition!" + assert(pModel && "No model set at the report definition!"); if ( pModel ) { uno::Reference<report::XSection> const xSection(this); diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index dba0b2947213..133f131590c8 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -100,7 +100,7 @@ OUString flagName(unoidl::detail::SourceProviderFlags flag) { case unoidl::detail::FLAG_TRANSIENT: return OUString("transient"); default: - assert(false); for (;;) { std::abort(); } // this cannot happen + assert(false && "this cannot happen"); for (;;) { std::abort(); } } } @@ -480,7 +480,7 @@ Found findEntity( argT = unoidl::detail::SourceProviderType::TYPE_INTERFACE; break; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); } argType = unoidl::detail::SourceProviderType( @@ -725,7 +725,7 @@ Found findEntity( n, e); break; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); } } } else { @@ -789,7 +789,7 @@ Found findEntity( + " that is not a polymorphic struct type template")); return FOUND_ERROR; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); } } if (typedefedType != 0) { @@ -1954,7 +1954,7 @@ typedefDefn: case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL: break; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); default: assert(t.entity->entity.is() || t.entity->pad.is()); unpub @@ -1973,7 +1973,7 @@ typedefDefn: } break; case unoidl::detail::SourceProviderType::TYPE_PARAMETER: - assert(false); // this cannot happen + assert(false && "this cannot happen"); default: break; } @@ -3924,7 +3924,7 @@ type: ok = true; break; case unoidl::Entity::SORT_TYPEDEF: - assert(false); // this cannot happen + assert(false && "this cannot happen"); // fall through default: break; @@ -3946,7 +3946,7 @@ type: ok = true; break; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); } if (!ok) { error(@1, yyscanner, "non-type entity " + name); @@ -4020,7 +4020,7 @@ type: case unoidl::detail::SourceProviderEntity::KIND_PUBLISHED_INTERFACE_DECL: break; case unoidl::detail::SourceProviderEntity::KIND_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); } if (!ok) { error(@1, yyscanner, "non-type entity " + name); @@ -4110,7 +4110,7 @@ OUString SourceProviderType::getName() const { return n + ">"; } default: - assert(false); for (;;) { std::abort(); } // this cannot happen + assert(false && "this cannot happen"); for (;;) { std::abort(); } } } diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index 688a62ce64ba..3cf9bcc6b6d3 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -135,7 +135,7 @@ OUString showDirection( case unoidl::InterfaceTypeEntity::Method::Parameter::DIRECTION_IN_OUT: return OUString("[inout]"); default: - assert(false); for (;;) { std::abort(); } // this cannot happen + assert(false && "this cannot happen"); for (;;) { std::abort(); } } } @@ -193,7 +193,7 @@ void checkMap( } switch (entA->getSort()) { case unoidl::Entity::SORT_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); case unoidl::Entity::SORT_ENUM_TYPE: { rtl::Reference<unoidl::EnumTypeEntity> ent2A( diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx index 1deb4d75f376..ea995d68fc8c 100644 --- a/unoidl/source/unoidl-read.cxx +++ b/unoidl/source/unoidl-read.cxx @@ -248,7 +248,7 @@ void scanMap( .first); switch (ent->getSort()) { case unoidl::Entity::SORT_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); case unoidl::Entity::SORT_ENUM_TYPE: case unoidl::Entity::SORT_CONSTANT_GROUP: break; @@ -609,7 +609,7 @@ void writeEntity( static_cast<unoidl::PublishableEntity *>(i->second.entity.get())); switch (ent->getSort()) { case unoidl::Entity::SORT_MODULE: - assert(false); // this cannot happen + assert(false && "this cannot happen"); case unoidl::Entity::SORT_ENUM_TYPE: { rtl::Reference<unoidl::EnumTypeEntity> ent2( diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 594f8ae38898..b0254ed8950c 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -99,7 +99,7 @@ std::vector<OUString> getContents(OUString const & url) { } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -133,7 +133,7 @@ bool utl::UCBContentHelper::IsDocument(OUString const & url) { } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -154,7 +154,7 @@ css::uno::Any utl::UCBContentHelper::GetProperty( } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -173,7 +173,7 @@ bool utl::UCBContentHelper::IsFolder(OUString const & url) { } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -195,7 +195,7 @@ bool utl::UCBContentHelper::GetTitle( } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -217,7 +217,7 @@ bool utl::UCBContentHelper::Kill(OUString const & url) { } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -274,7 +274,7 @@ bool utl::UCBContentHelper::MakeFolder( } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -306,7 +306,7 @@ sal_Int64 utl::UCBContentHelper::GetSize(OUString const & url) { } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -335,7 +335,7 @@ bool utl::UCBContentHelper::IsYounger( } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); @@ -425,7 +425,7 @@ bool utl::UCBContentHelper::IsSubPath( } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { - assert(false); // this cannot happen + assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { css::uno::Any e(cppu::getCaughtException()); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index a1c59ef0819b..f9fee0b6220e 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -626,7 +626,7 @@ void Application::InitSettings() { ImplSVData* pSVData = ImplGetSVData(); - assert(!pSVData->maAppData.mpSettings); // initialization should not happen twice! + assert(!pSVData->maAppData.mpSettings && "initialization should not happen twice!"); pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener; pSVData->maAppData.mpSettings = new AllSettings(); diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index 2d3ce6102307..5730fcc1d476 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -977,7 +977,7 @@ void CffSubsetterContext::convertOneTypeOp( void) read2push(); } else { popAll2Write( nType2Op); - assert( false); // TODO? + assert(false && "TODO?"); } break; } diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index b81a6c001221..7bfb28b7139e 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -593,7 +593,7 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, nDstLinestep = -nDstLinestep; } - assert(rDstBuffer.mnHeight <= rSrcBuffer.mnHeight); // not sure about that? + assert(rDstBuffer.mnHeight <= rSrcBuffer.mnHeight && "not sure about that?"); for (int y = rDstBuffer.mnHeight; --y >= 0;) { ImplBlendLines<8>( aDstLine, rSrcLine, aMskLine, rDstBuffer.mnWidth ); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 12aa2323d5d9..9cf4725d5b33 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -779,7 +779,7 @@ bool Dialog::ImplStartExecuteModal() << "\"cancelled in silent mode"); return false; default: - assert(false); // this cannot happen + assert(false && "this cannot happen"); // fall through case Application::DIALOG_CANCEL_FATAL: std::abort(); diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx index 511ff0ab0f42..45c06022f990 100644 --- a/vcl/unx/gtk/a11y/atklistener.cxx +++ b/vcl/unx/gtk/a11y/atklistener.cxx @@ -138,7 +138,7 @@ void AtkListener::updateChildList(accessibility::XAccessibleContext* pContext) catch (lang::IndexOutOfBoundsException const&) { sal_Int32 nChildren2 = pContext->getAccessibleChildCount(); - assert(nChildren2 <= n); // consistency? + assert(nChildren2 <= n && "consistency?"); m_aChildList.resize(std::min(nChildren2, n)); break; } diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index b1e7e238fcb6..c56339519dc1 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -824,7 +824,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, } } - assert(gdkDrawable); //rhbz#1050162 + assert(gdkDrawable && "rhbz#1050162"); if (gdkDrawable == 0) return false; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index f02a6951092e..4475819a2acb 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -794,7 +794,6 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink( } OUString sParent; // AutoStyles should not have parents! sName = GetAutoStylePool().Find( XML_STYLE_FAMILY_TEXT_TEXT, sParent, xPropStates ); - // assert(!sName.isEmpty()); // AutoStyle could not be found rbHasAutoStyle = true; } @@ -1068,7 +1067,7 @@ void XMLTextParagraphExport::exportListChange( rPrevInfo.BelongsToSameList( rNextInfo ) && rPrevInfo.GetLevel() >= rNextInfo.GetLevel() ) { - assert(pListElements && pListElements->size() >= 2); //list elements missing + assert(pListElements && pListElements->size() >= 2 && "list elements missing"); bEndElement = pListElements && pListElements->size() >= 2; } |