summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2017-05-07 09:05:32 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2017-05-07 09:05:32 +1000
commit768f65105b4f45793bd59331732626f072db9639 (patch)
treecf31d61a9ed1406bf46578124841b902f18be1ed
parent34ca5a2fb5085bb38a9ab050f60ac0a2283acd03 (diff)
tdf#43157: convert most of vcl codebase away from OSL_ASSERT to assert
Change-Id: Ifaae7af7169fe6c24d152f8aba51ba3ff3bdb9f8
-rw-r--r--vcl/osx/HtmlFmtFlt.cxx2
-rw-r--r--vcl/osx/a11ywrapper.mm2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/pngread.cxx2
-rw-r--r--vcl/source/gdi/regband.cxx4
-rw-r--r--vcl/source/gdi/region.cxx4
-rw-r--r--vcl/source/gdi/regionband.cxx2
-rw-r--r--vcl/source/image/ImplImageTree.cxx6
-rw-r--r--vcl/source/window/EnumContext.cxx2
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx42
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkPicker.cxx6
-rw-r--r--vcl/unx/kde/UnxFilePicker.cxx4
12 files changed, 40 insertions, 40 deletions
diff --git a/vcl/osx/HtmlFmtFlt.cxx b/vcl/osx/HtmlFmtFlt.cxx
index e068a45b4142..dcb072ed83bf 100644
--- a/vcl/osx/HtmlFmtFlt.cxx
+++ b/vcl/osx/HtmlFmtFlt.cxx
@@ -80,7 +80,7 @@ const std::string TAG_END_BODY = std::string("</body");
Sequence<sal_Int8> SAL_CALL TextHtmlToHTMLFormat(Sequence<sal_Int8>& aTextHtml)
{
- OSL_ASSERT(aTextHtml.getLength() > 0);
+ assert(aTextHtml.getLength() > 0);
if (!(aTextHtml.getLength() > 0))
return Sequence<sal_Int8>();
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 15123c826854..bee877d9c8ba 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -302,7 +302,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) {
} catch (const Exception&) {
}
- OSL_ASSERT( false );
+ assert( false );
return nil;
}
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index bf039f142d58..162061b615f0 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1695,7 +1695,7 @@ void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStre
writeBuffer( &io_rState.getByte(), 1 );
io_rState.flush();
}
- OSL_ASSERT( i_nLength < 9 );
+ assert( i_nLength < 9 );
static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
io_rState.mnBuffer |= static_cast<sal_uInt8>( (i_nCode & msbmask[i_nLength]) << (io_rState.mnNextBitPos - i_nLength) );
io_rState.mnNextBitPos -= i_nLength;
@@ -1943,7 +1943,7 @@ void PDFWriterImpl::putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState&
if( i_nSpan > 63 )
{
sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
- OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels == static_cast<sal_uInt32>(64*(i_nSpan >> 6)) );
+ assert( pTable[nTabIndex].mnEncodedPixels == static_cast<sal_uInt32>(64*(i_nSpan >> 6)) );
putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
}
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 40d4085f56ff..7372bb6e8858 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -1015,7 +1015,7 @@ bool PNGReaderImpl::ImplPreparePass()
void PNGReaderImpl::ImplApplyFilter()
{
- OSL_ASSERT( mnScansize >= mnBPP + 1 );
+ assert( mnScansize >= mnBPP + 1 );
const sal_uInt8* const pScanEnd = mpInflateInBuf + mnScansize;
sal_uInt8 nFilterType = *mpInflateInBuf; // the filter type may change each scanline
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index 08341d6202dc..7d34804866b0 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -863,8 +863,8 @@ bool ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
ImplRegionBand* ImplRegionBand::SplitBand (const sal_Int32 nY)
{
- OSL_ASSERT(nY>mnYTop);
- OSL_ASSERT(nY<=mnYBottom);
+ assert(nY > mnYTop);
+ assert(nY <= mnYBottom);
// Create a copy of the given band (we tell the constructor to copy the points together
// with the seps.)
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index cec2de3f6b37..372d88527501 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -88,7 +88,7 @@ namespace
*/
std::unique_ptr<RegionBand> ImplRectilinearPolygonToBands(const tools::PolyPolygon& rPolyPoly)
{
- OSL_ASSERT(ImplIsPolygonRectilinear (rPolyPoly));
+ assert(ImplIsPolygonRectilinear (rPolyPoly));
// Create a new RegionBand object as container of the bands.
std::unique_ptr<RegionBand> pRegionBand( o3tl::make_unique<RegionBand>() );
@@ -120,7 +120,7 @@ namespace
}
// At this point the line has to be vertical.
- OSL_ASSERT(aStart.X() == aEnd.X());
+ assert(aStart.X() == aEnd.X());
// Sort y-coordinates to simplify the algorithm and store the
// direction separately. The direction is calculated as it is
diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx
index 2e54cd89194e..133a0b9043de 100644
--- a/vcl/source/gdi/regionband.cxx
+++ b/vcl/source/gdi/regionband.cxx
@@ -317,7 +317,7 @@ bool RegionBand::isSingleRectangle() const
void RegionBand::InsertBand(ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert)
{
- OSL_ASSERT(pBandToInsert!=nullptr);
+ assert(pBandToInsert != nullptr);
if(!pPreviousBand)
{
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 508be2cb53f6..5959849b9370 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -135,7 +135,7 @@ std::shared_ptr<SvStream> wrapStream(css::uno::Reference< css::io::XInputStream
// SeekPos implementation for an XInputStream that is not also XSeekable
// (cf. "@@@" at tags/DEV300_m37/svtools/source/misc1/strmadpt.cxx@264807
// l. 593):
- OSL_ASSERT(stream.is());
+ assert(stream.is());
std::shared_ptr<SvStream> s(std::make_shared<SvMemoryStream>());
for (;;)
{
@@ -398,10 +398,10 @@ void ImplImageTree::createStyle()
if (maCurrentStyle != "default")
{
INetURLObject aUrl(getIconThemeFolderUrl());
- OSL_ASSERT(!aUrl.HasError());
+ assert(!aUrl.HasError());
bool ok = aUrl.Append("images_" + maCurrentStyle, INetURLObject::EncodeMechanism::All);
- OSL_ASSERT(ok); (void) ok;
+ assert(ok); (void) ok;
sThemeUrl = aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE) + ".zip";
}
diff --git a/vcl/source/window/EnumContext.cxx b/vcl/source/window/EnumContext.cxx
index f2e46f1cf1ba..87551eab7d5f 100644
--- a/vcl/source/window/EnumContext.cxx
+++ b/vcl/source/window/EnumContext.cxx
@@ -105,7 +105,7 @@ bool EnumContext::operator!= (const EnumContext& rOther)
void EnumContext::AddEntry (const ::rtl::OUString& rsName, const Application eApplication)
{
maApplicationMap[rsName] = eApplication;
- OSL_ASSERT(eApplication<=Application::LAST);
+ assert(eApplication <= Application::LAST);
maApplicationVector[eApplication]=rsName;
}
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 7458d1be8b87..e34010d6d478 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -527,7 +527,7 @@ void SAL_CALL SalGtkFilePicker::appendFilter( const OUString& aTitle, const OUSt
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
if( FilterNameExists( aTitle ) )
throw IllegalArgumentException();
@@ -543,7 +543,7 @@ void SAL_CALL SalGtkFilePicker::setCurrentFilter( const OUString& aTitle )
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
if( aTitle != m_aCurrentFilter )
{
@@ -602,7 +602,7 @@ OUString SAL_CALL SalGtkFilePicker::getCurrentFilter()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
UpdateFilterfromUI();
@@ -615,7 +615,7 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const OUString& /*sGroupTitle
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO m_pImpl->appendFilterGroup( sGroupTitle, aFilters );
// check the names
@@ -644,7 +644,7 @@ void SAL_CALL SalGtkFilePicker::setMultiSelectionMode( sal_Bool bMode )
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(m_pDialog), bMode );
}
@@ -653,7 +653,7 @@ void SAL_CALL SalGtkFilePicker::setDefaultName( const OUString& aName )
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
OString aStr = OUStringToOString( aName, RTL_TEXTENCODING_UTF8 );
GtkFileChooserAction eAction = gtk_file_chooser_get_action( GTK_FILE_CHOOSER( m_pDialog ) );
@@ -714,7 +714,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
GSList* pPathList = gtk_file_chooser_get_uris( GTK_FILE_CHOOSER(m_pDialog) );
@@ -868,7 +868,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
sal_Int16 retVal = 0;
@@ -1232,7 +1232,7 @@ void SAL_CALL SalGtkFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nContr
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
GType tType;
GtkWidget *pWidget;
@@ -1257,7 +1257,7 @@ uno::Any SAL_CALL SalGtkFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nC
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
uno::Any aRetval;
@@ -1280,7 +1280,7 @@ void SAL_CALL SalGtkFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bE
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
GtkWidget *pWidget;
@@ -1303,7 +1303,7 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 nControlId, const OUString&
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
GType tType;
GtkWidget *pWidget;
@@ -1339,7 +1339,7 @@ OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId )
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
GType tType;
OString aTxt;
@@ -1361,7 +1361,7 @@ uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO return m_pImpl->getSupportedImageFormats();
return uno::Sequence<sal_Int16>();
@@ -1371,7 +1371,7 @@ sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO return m_pImpl->getTargetColorDepth();
return 0;
@@ -1381,7 +1381,7 @@ sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableWidth()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
return m_PreviewImageWidth;
}
@@ -1390,7 +1390,7 @@ sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableHeight()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
return m_PreviewImageHeight;
}
@@ -1399,7 +1399,7 @@ void SAL_CALL SalGtkFilePicker::setImage( sal_Int16 /*aImageFormat*/, const uno:
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO m_pImpl->setImage( aImageFormat, aImage );
}
@@ -1499,7 +1499,7 @@ sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState )
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO return m_pImpl->setShowState( bShowState );
if( bool(bShowState) != mbPreviewState )
@@ -1533,7 +1533,7 @@ sal_Bool SAL_CALL SalGtkFilePicker::getShowState()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
return mbPreviewState;
}
@@ -1712,7 +1712,7 @@ void SAL_CALL SalGtkFilePicker::cancel()
{
SolarMutexGuard g;
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
// TODO m_pImpl->cancel();
}
diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
index 060cf23abab1..a52a85b3a7ef 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -199,7 +199,7 @@ SalGtkPicker::~SalGtkPicker()
void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const OUString& aDirectory )
{
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
OString aTxt = unicodetouri(aDirectory);
if( aTxt.isEmpty() ){
@@ -217,7 +217,7 @@ void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const OUString& aDirectory
OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory()
{
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
gchar* pCurrentFolder =
gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) );
@@ -229,7 +229,7 @@ OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory()
void SAL_CALL SalGtkPicker::implsetTitle( const OUString& aTitle )
{
- OSL_ASSERT( m_pDialog != nullptr );
+ assert( m_pDialog != nullptr );
OString aWindowTitle = OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 );
diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx
index 8fbed035a0b3..79667c9d6288 100644
--- a/vcl/unx/kde/UnxFilePicker.cxx
+++ b/vcl/unx/kde/UnxFilePicker.cxx
@@ -235,7 +235,7 @@ UnxFilePicker::~UnxFilePicker()
void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
{
- OSL_ASSERT( m_pNotifyThread );
+ assert( m_pNotifyThread );
osl::MutexGuard aGuard( m_aMutex );
m_pNotifyThread->addFilePickerListener( xListener );
@@ -243,7 +243,7 @@ void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePi
void SAL_CALL UnxFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
{
- OSL_ASSERT( m_pNotifyThread );
+ assert( m_pNotifyThread );
osl::MutexGuard aGuard( m_aMutex );
m_pNotifyThread->removeFilePickerListener( xListener );