Kaydet (Commit) 74fa31e1 authored tarafından Chris Sherlock's avatar Chris Sherlock

tdf#43157: convert sfx2 module away from OSL_ASSERT to assert

Change-Id: I3facbef60a0d629db8f3028dd1b9f38e8f17e83e
üst 6c9fb88f
......@@ -296,7 +296,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
return;
}
OSL_ASSERT(nCount > 0);
assert(nCount > 0);
#ifdef DBG_UTIL
// detect parameters that don't match to any formal argument or one of its members
......
......@@ -535,7 +535,7 @@ void ShutdownIcon::terminateDesktop()
ShutdownIcon* ShutdownIcon::getInstance()
{
OSL_ASSERT( pShutdownIcon );
assert( pShutdownIcon );
return pShutdownIcon;
}
......
......@@ -305,7 +305,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
bool bPrivateProtocol = ( aFileObj.GetProtocol() == INetProtocol::PrivSoffice );
bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol;
OSL_ASSERT( !bPrivateProtocol );
assert( !bPrivateProtocol );
}
if ( !rType.isEmpty() )
bStoreTo = true;
......@@ -464,8 +464,8 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
if ( aFileName.isEmpty() )
return eRet;
OSL_ASSERT( !aFilterName.isEmpty() );
OSL_ASSERT( !aFileName.isEmpty() );
assert( !aFilterName.isEmpty() );
assert( !aFileName.isEmpty() );
// Creates a temporary directory to store a predefined file into it.
// This makes it possible to store the file for "send document as e-mail"
......
......@@ -341,7 +341,7 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi
, pImpl(new SfxTemplateDialog_Impl(pBindings, this))
, mpBindings(pBindings)
{
OSL_ASSERT(mpBindings!=nullptr);
assert(mpBindings!=nullptr);
SetStyle(GetStyle() & ~WB_DOCKABLE);
}
......
......@@ -302,7 +302,7 @@ sal_Int32 PlacePanels (
nPanelHeight = iItem->maLayoutSize.Preferred;
break;
default:
OSL_ASSERT(false);
assert(false);
break;
}
......@@ -453,7 +453,7 @@ void DistributeHeights (
if (nRemainingHeightToDistribute == 0)
return;
OSL_ASSERT(nRemainingHeightToDistribute > 0);
assert(nRemainingHeightToDistribute > 0);
// It is possible that not all of the height could be distributed
// because of Maximum heights being smaller than expected.
......@@ -480,7 +480,7 @@ void DistributeHeights (
}
}
OSL_ASSERT(nRemainingHeightToDistribute==0);
assert(nRemainingHeightToDistribute==0);
}
tools::Rectangle PlaceDeckTitle (
......@@ -542,7 +542,7 @@ void SetupVerticalScrollBar(
const sal_Int32 nContentHeight,
const sal_Int32 nVisibleHeight)
{
OSL_ASSERT(nContentHeight > nVisibleHeight);
assert(nContentHeight > nVisibleHeight);
rVerticalScrollBar.SetRangeMin(0);
rVerticalScrollBar.SetRangeMax(nContentHeight-1);
......
......@@ -44,7 +44,7 @@ DeckTitleBar::DeckTitleBar (const OUString& rsTitle,
, maCloserAction(rCloserAction)
, mbIsCloserVisible(false)
{
OSL_ASSERT(pParentWindow != nullptr);
assert(pParentWindow != nullptr);
if (maCloserAction)
SetCloserVisible(true);
......
......@@ -49,7 +49,7 @@ PanelTitleBar::PanelTitleBar(const OUString& rsTitle,
mxFrame(),
msMoreOptionsCommand()
{
OSL_ASSERT(mpPanel != nullptr);
assert(mpPanel != nullptr);
#ifdef DEBUG
SetText(OUString("PanelTitleBar"));
......
......@@ -336,7 +336,7 @@ void SidebarController::NotifyResize()
{
if (!mpTabBar)
{
OSL_ASSERT(mpTabBar!=nullptr);
assert(mpTabBar!=nullptr);
return;
}
......
......@@ -37,8 +37,8 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
// Get the XFrame from the bindings.
if (pSfxBindings==nullptr || pSfxBindings->GetDispatcher()==nullptr)
{
OSL_ASSERT(pSfxBindings!=nullptr);
OSL_ASSERT(pSfxBindings->GetDispatcher()!=nullptr);
assert(pSfxBindings!=nullptr);
assert(pSfxBindings->GetDispatcher()!=nullptr);
}
else
{
......
......@@ -122,7 +122,7 @@ void TabBar::SetDecks(const ResourceManager::DeckContextDescriptorContainer& rDe
std::shared_ptr<DeckDescriptor> xDescriptor = pParentSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId);
if (xDescriptor == nullptr)
{
OSL_ASSERT(xDescriptor!=nullptr);
assert(xDescriptor!=nullptr);
continue;
}
......
......@@ -61,7 +61,7 @@ Theme::~Theme()
Image Theme::GetImage (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
OSL_ASSERT(eType==PT_Image);
assert(eType==PT_Image);
const sal_Int32 nIndex (GetIndex(eItem, eType));
const Theme& rTheme (GetCurrentTheme());
return rTheme.maImages[nIndex];
......@@ -70,7 +70,7 @@ Image Theme::GetImage (const ThemeItem eItem)
Color Theme::GetColor (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
OSL_ASSERT(eType==PT_Color || eType==PT_Paint);
assert(eType==PT_Color || eType==PT_Paint);
const sal_Int32 nIndex (GetIndex(eItem, eType));
const Theme& rTheme (GetCurrentTheme());
if (eType == PT_Color)
......@@ -84,7 +84,7 @@ Color Theme::GetColor (const ThemeItem eItem)
const Paint& Theme::GetPaint (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
OSL_ASSERT(eType==PT_Paint);
assert(eType==PT_Paint);
const sal_Int32 nIndex (GetIndex(eItem, eType));
const Theme& rTheme (GetCurrentTheme());
return rTheme.maPaints[nIndex];
......@@ -98,7 +98,7 @@ const Wallpaper Theme::GetWallpaper (const ThemeItem eItem)
sal_Int32 Theme::GetInteger (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
OSL_ASSERT(eType==PT_Integer);
assert(eType==PT_Integer);
const sal_Int32 nIndex (GetIndex(eItem, eType));
const Theme& rTheme (GetCurrentTheme());
return rTheme.maIntegers[nIndex];
......@@ -107,7 +107,7 @@ sal_Int32 Theme::GetInteger (const ThemeItem eItem)
bool Theme::GetBoolean (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
OSL_ASSERT(eType==PT_Boolean);
assert(eType==PT_Boolean);
const sal_Int32 nIndex (GetIndex(eItem, eType));
const Theme& rTheme (GetCurrentTheme());
return rTheme.maBooleans[nIndex];
......@@ -337,7 +337,7 @@ void Theme::UpdateTheme()
catch(beans::UnknownPropertyException& rException)
{
SAL_WARN("sfx", "unknown property: " << rException.Message);
OSL_ASSERT(false);
assert(false);
}
}
......@@ -884,7 +884,7 @@ sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType)
return eItem - Bool_Rect_-1;
default:
OSL_ASSERT(false);
assert(false);
return 0;
}
}
......@@ -1049,7 +1049,7 @@ void Theme::ProcessNewValue (
break;
}
case PT_Invalid:
OSL_ASSERT(eType != PT_Invalid);
assert(eType != PT_Invalid);
throw RuntimeException();
}
}
......
......@@ -167,7 +167,7 @@ void TitleBar::PaintFocus(vcl::RenderContext& rRenderContext, const tools::Recta
IMPL_LINK(TitleBar, SelectionHandler, ToolBox*, pToolBox, void)
{
(void)pToolBox;
OSL_ASSERT(maToolBox.get()==pToolBox);
assert(maToolBox.get()==pToolBox);
const sal_uInt16 nItemId (maToolBox->GetHighlightItemId());
HandleToolBoxItemClick(nItemId);
......
......@@ -104,7 +104,7 @@ SFX_IMPL_TOOLBOX_CONTROL_ARG(SfxToolBoxControl, SfxStringItem, true);
static vcl::Window* GetTopMostParentSystemWindow( vcl::Window* pWindow )
{
OSL_ASSERT( pWindow );
assert( pWindow );
if ( pWindow )
{
// ->manually search topmost system window
......@@ -118,7 +118,7 @@ static vcl::Window* GetTopMostParentSystemWindow( vcl::Window* pWindow )
pWindow = pWindow->GetParent();
}
pWindow = pTopMostSysWin;
OSL_ASSERT( pWindow );
assert( pWindow );
return pWindow;
}
......
......@@ -633,8 +633,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
aFileName = aFObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::NONE );
}
OSL_ASSERT( !aFilterName.isEmpty() );
OSL_ASSERT( !aFileName.isEmpty() );
assert( !aFilterName.isEmpty() );
assert( !aFileName.isEmpty() );
// Creates a temporary directory to store our predefined file into it.
::utl::TempFile aTempDir( nullptr, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment