summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-02 10:40:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-03 10:51:57 +0200
commit054c0e7177cbef26942f8ca7cb7b1422ceea721c (patch)
tree7390a1be5ee0797b7f43d7d433822315fd75c6dd
parent0f499af8c2c22ccc8f1c19edeeb2bdac8cbcb7f0 (diff)
loplugin:simplifypointertobool improve
to look for the x.get() != null pattern, which can be simplified to x I'll do the x.get() == nullptr pattern in a separate patch, to reduce the chances of a mistake Change-Id: I45e0d178e75359857cdf50d712039cb526016555 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--accessibility/source/standard/vclxaccessiblecombobox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibledropdowncombobox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibledropdownlistbox.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblelistbox.cxx2
-rw-r--r--basic/qa/cppunit/basictest.cxx2
-rw-r--r--comphelper/source/misc/configuration.cxx8
-rw-r--r--compilerplugins/clang/simplifypointertobool.cxx35
-rw-r--r--compilerplugins/clang/test/simplifypointertobool.cxx39
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx2
-rw-r--r--cppcanvas/source/tools/canvasgraphichelper.cxx3
-rw-r--r--cppcanvas/source/wrapper/basegfxfactory.cxx9
-rw-r--r--cppcanvas/source/wrapper/implbitmap.cxx6
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.cxx3
-rw-r--r--cppcanvas/source/wrapper/vclfactory.cxx3
-rw-r--r--cppuhelper/source/servicemanager.cxx22
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.hxx2
-rw-r--r--include/oox/ole/axcontrol.hxx2
-rw-r--r--oox/source/ppt/pptshape.cxx4
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx2
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/qa/extras/scpdfexport.cxx4
-rw-r--r--sc/qa/unit/bugfix-test.cxx2
-rw-r--r--sc/qa/unit/copy_paste_test.cxx4
-rw-r--r--sc/qa/unit/ucalc_formula.cxx4
-rw-r--r--sc/source/core/data/document10.cxx2
-rw-r--r--sc/source/filter/excel/xecontent.cxx2
-rw-r--r--sc/source/filter/excel/xilink.cxx2
-rw-r--r--sc/source/filter/inc/richstring.hxx2
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx2
-rw-r--r--sd/source/core/EffectMigration.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx4
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx2
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx2
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx2
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx4
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx2
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx24
-rw-r--r--sd/source/ui/sidebar/MasterPageContainerQueue.cxx4
-rw-r--r--sd/source/ui/sidebar/PanelBase.cxx2
-rw-r--r--sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsFocusManager.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsPageSelector.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx8
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx4
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx4
-rw-r--r--sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx2
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorter.cxx8
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx50
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx4
-rw-r--r--sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx2
-rw-r--r--sd/source/ui/view/FormShellManager.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/ViewShellManager.cxx4
-rw-r--r--sd/source/ui/view/drviews1.cxx4
-rw-r--r--sd/source/ui/view/drviews4.cxx14
-rw-r--r--sd/source/ui/view/grviewsh.cxx2
-rw-r--r--sd/source/ui/view/viewshe2.cxx34
-rw-r--r--sd/source/ui/view/viewshel.cxx76
-rw-r--r--sdext/source/presenter/PresenterAccessibility.cxx2
-rw-r--r--sdext/source/presenter/PresenterButton.cxx10
-rw-r--r--sdext/source/presenter/PresenterController.cxx8
-rw-r--r--sdext/source/presenter/PresenterHelpView.cxx4
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx10
-rw-r--r--sdext/source/presenter/PresenterPaneBase.cxx4
-rw-r--r--sdext/source/presenter/PresenterPaneBorderPainter.cxx6
-rw-r--r--sdext/source/presenter/PresenterPaneContainer.cxx16
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx4
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx2
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx4
-rw-r--r--sdext/source/presenter/PresenterScrollBar.cxx6
-rw-r--r--sdext/source/presenter/PresenterSlidePreview.cxx2
-rw-r--r--sdext/source/presenter/PresenterSlideShowView.cxx10
-rw-r--r--sdext/source/presenter/PresenterSlideSorter.cxx56
-rw-r--r--sdext/source/presenter/PresenterTheme.cxx28
-rw-r--r--sdext/source/presenter/PresenterTimer.cxx2
-rw-r--r--sdext/source/presenter/PresenterToolBar.cxx37
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx4
-rw-r--r--sdext/source/presenter/PresenterWindowManager.cxx20
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx4
-rw-r--r--sfx2/source/view/viewprn.cxx2
-rw-r--r--slideshow/source/engine/effectrewinder.cxx2
-rw-r--r--slideshow/source/engine/eventqueue.cxx6
-rw-r--r--store/source/storbase.hxx4
-rw-r--r--svl/source/items/style.cxx2
-rw-r--r--svtools/source/brwbox/brwbox2.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx2
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx14
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx10
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx6
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx14
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx2
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx2
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.cxx2
-rw-r--r--writerfilter/source/ooxml/Handler.cxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx6
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx10
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx8
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySet.cxx16
113 files changed, 466 insertions, 405 deletions
diff --git a/accessibility/source/standard/vclxaccessiblecombobox.cxx b/accessibility/source/standard/vclxaccessiblecombobox.cxx
index 9dc476ff2121..e537f7199eaa 100644
--- a/accessibility/source/standard/vclxaccessiblecombobox.cxx
+++ b/accessibility/source/standard/vclxaccessiblecombobox.cxx
@@ -34,7 +34,7 @@ VCLXAccessibleComboBox::VCLXAccessibleComboBox (VCLXWindow* pVCLWindow)
bool VCLXAccessibleComboBox::IsValid() const
{
- return GetWindow().get() != nullptr;
+ return GetWindow();
}
// XServiceInfo
diff --git a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
index 76b3be98b0d4..97fcebb04a2b 100644
--- a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
@@ -37,7 +37,7 @@ VCLXAccessibleDropDownComboBox::VCLXAccessibleDropDownComboBox (VCLXWindow* pVCL
bool VCLXAccessibleDropDownComboBox::IsValid() const
{
- return GetWindow().get() != nullptr;
+ return GetWindow();
}
void VCLXAccessibleDropDownComboBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
diff --git a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
index d67d8dda5c47..2bee1b51f8fc 100644
--- a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
@@ -37,7 +37,7 @@ VCLXAccessibleDropDownListBox::VCLXAccessibleDropDownListBox (VCLXWindow* pVCLWi
bool VCLXAccessibleDropDownListBox::IsValid() const
{
- return GetWindow().get() != nullptr;
+ return GetWindow();
}
diff --git a/accessibility/source/standard/vclxaccessiblelistbox.cxx b/accessibility/source/standard/vclxaccessiblelistbox.cxx
index bb811becb31f..26602167379a 100644
--- a/accessibility/source/standard/vclxaccessiblelistbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistbox.cxx
@@ -34,7 +34,7 @@ VCLXAccessibleListBox::VCLXAccessibleListBox (VCLXWindow* pVCLWindow)
bool VCLXAccessibleListBox::IsValid() const
{
- return GetWindow().get() != nullptr;
+ return GetWindow();
}
// XServiceInfo
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index 635da6e5ec0c..4122885ba10c 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -101,7 +101,7 @@ SbxVariableRef MacroSnippet::Run()
bool MacroSnippet::Compile()
{
- CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod.get() != nullptr );
+ CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod );
mpMod->Compile();
return !mbError;
}
diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx
index 6c5b5c41dac3..24657ab011f5 100644
--- a/comphelper/source/misc/configuration.cxx
+++ b/comphelper/source/misc/configuration.cxx
@@ -140,7 +140,7 @@ void comphelper::detail::ConfigurationWrapper::setPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, css::uno::Any const & value)
{
- assert(batch.get() != nullptr);
+ assert(batch);
batch->setPropertyValue(path, value);
}
@@ -156,7 +156,7 @@ void comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(
std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path, css::uno::Any const & value)
{
- assert(batch.get() != nullptr);
+ assert(batch);
batch->setPropertyValue(path, value);
}
@@ -176,7 +176,7 @@ comphelper::detail::ConfigurationWrapper::getGroupReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path)
{
- assert(batch.get() != nullptr);
+ assert(batch);
return batch->getGroup(path);
}
@@ -196,7 +196,7 @@ comphelper::detail::ConfigurationWrapper::getSetReadWrite(
std::shared_ptr< ConfigurationChanges > const & batch,
OUString const & path)
{
- assert(batch.get() != nullptr);
+ assert(batch);
return batch->getSet(path);
}
diff --git a/compilerplugins/clang/simplifypointertobool.cxx b/compilerplugins/clang/simplifypointertobool.cxx
index 46a80a770757..4f8abb52c74f 100644
--- a/compilerplugins/clang/simplifypointertobool.cxx
+++ b/compilerplugins/clang/simplifypointertobool.cxx
@@ -45,6 +45,7 @@ public:
}
bool VisitImplicitCastExpr(ImplicitCastExpr const*);
+ bool VisitBinaryOperator(BinaryOperator const*);
bool PreTraverseUnaryLNot(UnaryOperator* expr)
{
@@ -303,7 +304,8 @@ bool SimplifyPointerToBool::VisitImplicitCastExpr(ImplicitCastExpr const* castEx
return true;
if (castExpr->getCastKind() != CK_PointerToBoolean)
return true;
- auto memberCallExpr = dyn_cast<CXXMemberCallExpr>(castExpr->getSubExpr()->IgnoreParens());
+ auto memberCallExpr
+ = dyn_cast<CXXMemberCallExpr>(castExpr->getSubExpr()->IgnoreParenImpCasts());
if (!memberCallExpr)
return true;
auto methodDecl = memberCallExpr->getMethodDecl();
@@ -416,6 +418,37 @@ bool SimplifyPointerToBool::VisitImplicitCastExpr(ImplicitCastExpr const* castEx
return true;
}
+bool SimplifyPointerToBool::VisitBinaryOperator(BinaryOperator const* binOp)
+{
+ if (ignoreLocation(binOp))
+ return true;
+ auto opCode = binOp->getOpcode();
+ //TODO if (opCode != BO_EQ && opCode != BO_NE)
+ // return true;
+ if (opCode != BO_NE)
+ return true;
+ const Expr* possibleMemberCall = nullptr;
+ if (isa<CXXNullPtrLiteralExpr>(binOp->getLHS()->IgnoreParenImpCasts()))
+ possibleMemberCall = binOp->getRHS();
+ else if (isa<CXXNullPtrLiteralExpr>(binOp->getRHS()->IgnoreParenImpCasts()))
+ possibleMemberCall = binOp->getLHS();
+ else
+ return true;
+ auto memberCallExpr = dyn_cast<CXXMemberCallExpr>(possibleMemberCall);
+ if (!memberCallExpr)
+ return true;
+ auto methodDecl = memberCallExpr->getMethodDecl();
+ if (!methodDecl || !methodDecl->getIdentifier() || methodDecl->getName() != "get")
+ return true;
+ if (!loplugin::isSmartPointerType(memberCallExpr->getImplicitObjectArgument()))
+ return true;
+ report(DiagnosticsEngine::Warning,
+ std::string("simplify, convert to ") + (opCode == BO_EQ ? "'!x'" : "'x'"),
+ binOp->getExprLoc())
+ << binOp->getSourceRange();
+ return true;
+}
+
loplugin::Plugin::Registration<SimplifyPointerToBool> simplifypointertobool("simplifypointertobool",
true);
diff --git a/compilerplugins/clang/test/simplifypointertobool.cxx b/compilerplugins/clang/test/simplifypointertobool.cxx
index e4bf14c40f45..05f78d52ed78 100644
--- a/compilerplugins/clang/test/simplifypointertobool.cxx
+++ b/compilerplugins/clang/test/simplifypointertobool.cxx
@@ -8,6 +8,7 @@
*/
#include <memory>
+#include "com/sun/star/uno/XInterface.hpp"
void foo();
@@ -30,6 +31,44 @@ void test2(std::shared_ptr<int> p)
// expected-error@+1 {{simplify, drop the get() [loplugin:simplifypointertobool]}}
if (p.get())
foo();
+ // TODOexpected-error@+1 {{simplify, convert to '!x' [loplugin:simplifypointertobool]}}
+ if (p.get() == nullptr)
+ foo();
+ // TODOexpected-error@+1 {{simplify, convert to '!x' [loplugin:simplifypointertobool]}}
+ if (p == nullptr)
+ foo();
+ // TODOexpected-error@+1 {{simplify, convert to 'x' [loplugin:simplifypointertobool]}}
+ if (p != nullptr)
+ foo();
+ // TODOexpected-error@+1 {{simplify, convert to '!x' [loplugin:simplifypointertobool]}}
+ if (nullptr == p.get())
+ foo();
+ // expected-error@+1 {{simplify, convert to 'x' [loplugin:simplifypointertobool]}}
+ if (p.get() != nullptr)
+ foo();
+ // expected-error@+1 {{simplify, convert to 'x' [loplugin:simplifypointertobool]}}
+ if (nullptr != p.get())
+ foo();
+}
+
+void test2(int* p)
+{
+ // TODOexpected-error@+1 {{simplify, convert to '!x' [loplugin:simplifypointertobool]}}
+ if (p == nullptr)
+ foo();
+ // TODOexpected-error@+1 {{simplify, convert to 'x' [loplugin:simplifypointertobool]}}
+ if (p != nullptr)
+ foo();
+}
+
+void test2(css::uno::Reference<css::uno::XInterface> const& p)
+{
+ // expected-error@+1 {{simplify, drop the get() [loplugin:simplifypointertobool]}}
+ if (p.get())
+ foo();
+ // TODOexpected-error@+1 {{simplify, convert to '!x' [loplugin:simplifypointertobool]}}
+ if (p.get() == nullptr)
+ foo();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 4109e21635d1..8e7b03559447 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2853,7 +2853,7 @@ namespace cppcanvas::internal
{
SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::ImplRenderer::ImplRenderer(mtf)" );
- OSL_ENSURE( rCanvas.get() != nullptr && rCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"ImplRenderer::ImplRenderer(): Invalid canvas" );
OSL_ENSURE( rCanvas->getUNOCanvas()->getDevice().is(),
"ImplRenderer::ImplRenderer(): Invalid graphic device" );
diff --git a/cppcanvas/source/tools/canvasgraphichelper.cxx b/cppcanvas/source/tools/canvasgraphichelper.cxx
index 2ccc1f0cbae5..f7a91d38d361 100644
--- a/cppcanvas/source/tools/canvasgraphichelper.cxx
+++ b/cppcanvas/source/tools/canvasgraphichelper.cxx
@@ -37,8 +37,7 @@ namespace cppcanvas::internal
maClipPolyPolygon(),
mpCanvas( rParentCanvas )
{
- OSL_ENSURE( mpCanvas.get() != nullptr &&
- mpCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( mpCanvas && mpCanvas->getUNOCanvas().is(),
"CanvasGraphicHelper::CanvasGraphicHelper: no valid canvas" );
::canvas::tools::initRenderState( maRenderState );
diff --git a/cppcanvas/source/wrapper/basegfxfactory.cxx b/cppcanvas/source/wrapper/basegfxfactory.cxx
index 0549c4e12175..8f11c6bb4a49 100644
--- a/cppcanvas/source/wrapper/basegfxfactory.cxx
+++ b/cppcanvas/source/wrapper/basegfxfactory.cxx
@@ -37,8 +37,7 @@ namespace cppcanvas
PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2DPolygon& rPoly )
{
- OSL_ENSURE( rCanvas.get() != nullptr &&
- rCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createPolyPolygon(): Invalid canvas" );
if( rCanvas.get() == nullptr )
@@ -57,8 +56,7 @@ namespace cppcanvas
BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2ISize& rSize )
{
- OSL_ENSURE( rCanvas.get() != nullptr &&
- rCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createBitmap(): Invalid canvas" );
if( rCanvas.get() == nullptr )
@@ -76,8 +74,7 @@ namespace cppcanvas
BitmapSharedPtr BaseGfxFactory::createAlphaBitmap( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2ISize& rSize )
{
- OSL_ENSURE( rCanvas.get() != nullptr &&
- rCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createBitmap(): Invalid canvas" );
if( rCanvas.get() == nullptr )
diff --git a/cppcanvas/source/wrapper/implbitmap.cxx b/cppcanvas/source/wrapper/implbitmap.cxx
index 8ce319539523..4ca8980a1b15 100644
--- a/cppcanvas/source/wrapper/implbitmap.cxx
+++ b/cppcanvas/source/wrapper/implbitmap.cxx
@@ -53,8 +53,7 @@ namespace cppcanvas::internal
{
CanvasSharedPtr pCanvas( getCanvas() );
- OSL_ENSURE( pCanvas.get() != nullptr &&
- pCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::draw: invalid canvas" );
if( pCanvas.get() == nullptr ||
@@ -75,8 +74,7 @@ namespace cppcanvas::internal
{
CanvasSharedPtr pCanvas( getCanvas() );
- OSL_ENSURE( pCanvas.get() != nullptr &&
- pCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::drawAlphaModulated(): invalid canvas" );
if( pCanvas.get() == nullptr ||
diff --git a/cppcanvas/source/wrapper/implpolypolygon.cxx b/cppcanvas/source/wrapper/implpolypolygon.cxx
index 1e8fc7c8b5f5..54f0fe30818c 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.cxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.cxx
@@ -88,8 +88,7 @@ namespace cppcanvas::internal
{
CanvasSharedPtr pCanvas( getCanvas() );
- OSL_ENSURE( pCanvas.get() != nullptr &&
- pCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::draw: invalid canvas" );
if( pCanvas.get() == nullptr ||
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index c90d91b23de8..9d286ec7d8d3 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -56,8 +56,7 @@ namespace cppcanvas
BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr& rCanvas,
const ::BitmapEx& rBmpEx )
{
- OSL_ENSURE( rCanvas.get() != nullptr &&
- rCanvas->getUNOCanvas().is(),
+ OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"VCLFactory::createBitmap(): Invalid canvas" );
if( rCanvas.get() == nullptr )
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 2ba6ae51a888..f06405f7794b 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -487,7 +487,7 @@ public:
cppuhelper::ServiceManager::Data::Implementation > const &
implementation):
manager_(manager), implementation_(implementation)
- { assert(manager.is()); assert(implementation.get() != nullptr); }
+ { assert(manager.is()); assert(implementation); }
SingletonFactory(const SingletonFactory&) = delete;
const SingletonFactory& operator=(const SingletonFactory&) = delete;
@@ -539,7 +539,7 @@ public:
cppuhelper::ServiceManager::Data::Implementation > const &
implementation):
manager_(manager), implementation_(implementation)
- { assert(manager.is()); assert(implementation.get() != nullptr); }
+ { assert(manager.is()); assert(implementation); }
ImplementationWrapper(const ImplementationWrapper&) = delete;
const ImplementationWrapper& operator=(const ImplementationWrapper&) = delete;
@@ -723,7 +723,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
for (const auto& [rName, rImpls] : data_.singletons)
{
assert(!rImpls.empty());
- assert(rImpls[0].get() != nullptr);
+ assert(rImpls[0]);
SAL_INFO_IF(
rImpls.size() > 1, "cppuhelper",
"Arbitrarily choosing " << rImpls[0]->name
@@ -742,7 +742,7 @@ void cppuhelper::ServiceManager::loadImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context,
std::shared_ptr< Data::Implementation > const & implementation)
{
- assert(implementation.get() != nullptr);
+ assert(implementation);
{
osl::MutexGuard g(rBHelper.rMutex);
if (implementation->status == Data::Implementation::STATUS_LOADED) {
@@ -839,7 +839,7 @@ void cppuhelper::ServiceManager::disposing() {
osl::MutexGuard g(rBHelper.rMutex);
for (const auto& rEntry : data_.namedImplementations)
{
- assert(rEntry.second.get() != nullptr);
+ assert(rEntry.second);
if (!rEntry.second->singletons.empty()) {
osl::MutexGuard g2(rEntry.second->mutex);
if (rEntry.second->disposeSingleton.is()) {
@@ -849,7 +849,7 @@ void cppuhelper::ServiceManager::disposing() {
}
for (const auto& rEntry : data_.dynamicImplementations)
{
- assert(rEntry.second.get() != nullptr);
+ assert(rEntry.second);
if (!rEntry.second->singletons.empty()) {
osl::MutexGuard g2(rEntry.second->mutex);
if (rEntry.second->disposeSingleton.is()) {
@@ -1587,7 +1587,7 @@ bool cppuhelper::ServiceManager::insertExtraData(Data const & extra) {
cont->removeByName(name + "/arguments");
} catch (const css::container::NoSuchElementException &) {}
assert(!rImpls.empty());
- assert(rImpls[0].get() != nullptr);
+ assert(rImpls[0]);
SAL_INFO_IF(
rImpls.size() > 1, "cppuhelper",
"Arbitrarily choosing " << rImpls[0]->name
@@ -1626,7 +1626,7 @@ void cppuhelper::ServiceManager::removeRdbFiles(
data_.namedImplementations.begin());
j != data_.namedImplementations.end();)
{
- assert(j->second.get() != nullptr);
+ assert(j->second);
if (j->second->rdbFile == rUri) {
clear.push_back(j->second);
//TODO: The below leaves data_ in an inconsistent state upon
@@ -1660,7 +1660,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory(
if (i == data_.dynamicImplementations.end()) {
return isDisposed();
}
- assert(i->second.get() != nullptr);
+ assert(i->second);
clear = i->second;
if (removeListener) {
comp = i->second->component;
@@ -1697,7 +1697,7 @@ void cppuhelper::ServiceManager::removeImplementation(const OUString & name) {
"Remove non-inserted implementation " + name,
static_cast< cppu::OWeakObject * >(this));
}
- assert(i->second.get() != nullptr);
+ assert(i->second);
clear = i->second;
//TODO: The below leaves data_ in an inconsistent state upon exceptions:
removeFromImplementationMap(
@@ -1739,7 +1739,7 @@ cppuhelper::ServiceManager::findServiceImplementation(
<< " among multiple implementations for " << i->first);
impl = i->second[0];
}
- assert(impl.get() != nullptr);
+ assert(impl);
loaded = impl->status == Data::Implementation::STATUS_LOADED;
}
if (!loaded) {
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index ca62420b4d2d..6ac118cc91ba 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -428,7 +428,7 @@ namespace pcr
_out_rpLine = line->pLine;
else
_out_rpLine.reset();
- return ( nullptr != _out_rpLine.get() );
+ return bool(_out_rpLine);
}
void OBrowserListBox::EnablePropertyControls( const OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable )
diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx
index 1afc7a7728b2..11b9a7b5cdf6 100644
--- a/extensions/source/propctrlr/propcontroller.hxx
+++ b/extensions/source/propctrlr/propcontroller.hxx
@@ -227,7 +227,7 @@ namespace pcr
// stop the inspection
void stopInspection( bool _bCommitModified );
- bool haveView() const { return m_xPropView.get() != nullptr; }
+ bool haveView() const { return bool(m_xPropView); }
OPropertyEditor& getPropertyBox() { return m_xPropView->getPropertyBox(); }
// does the inspection of the objects as indicated by our model
diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
index db14305cae9d..f8e0a5e5a7db 100644
--- a/include/oox/ole/axcontrol.hxx
+++ b/include/oox/ole/axcontrol.hxx
@@ -913,7 +913,7 @@ public:
ControlModelBase* createModelFromGuid( const OUString& rClassId );
/** Returns true, if the internal control model exists. */
- bool hasModel() const { return mxModel.get() != nullptr; }
+ bool hasModel() const { return bool(mxModel); }
/** Returns read-only access to the internal control model. */
const ControlModelBase* getModel() const { return mxModel.get(); }
/** Returns read/write access to the internal control model. */
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index edf527b67049..b28c9d07b223 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -348,7 +348,7 @@ void PPTShape::addShape(
} else
setMasterTextListStyle( aMasterTextListStyle );
- Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, bClearText, mpPlaceholder.get() != nullptr, aTransformation, getFillProperties() ) );
+ Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, bClearText, bool(mpPlaceholder), aTransformation, getFillProperties() ) );
if (!rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && mnSubType == XML_title)
{
try
@@ -369,7 +369,7 @@ void PPTShape::addShape(
}
// Apply text properties on placeholder text inside this placeholder shape
- if (meShapeLocation == Slide && mpPlaceholder.get() != nullptr && getTextBody() && getTextBody()->isEmpty())
+ if (meShapeLocation == Slide && mpPlaceholder && getTextBody() && getTextBody()->isEmpty())
{
Reference < XText > xText(mxShape, UNO_QUERY);
if (xText.is())
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index ab5dfdb8524c..0684814bc7cc 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -501,7 +501,7 @@ ShapeContextHandler::getShape()
mxWpgContext.clear();
}
}
- else if (mpShape.get() != nullptr)
+ else if (mpShape)
{
basegfx::B2DHomMatrix aTransformation;
mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes, aTransformation, mpShape->getFillProperties() );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6e277f10a284..03ea2b9d4336 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1357,7 +1357,7 @@ public:
/// If set, joining cells into shared formula groups will be delayed until reset again
/// (RegroupFormulaCells() will be called as needed).
void DelayFormulaGrouping( bool delay );
- bool IsDelayedFormulaGrouping() const { return pDelayedFormulaGrouping.get() != nullptr; }
+ bool IsDelayedFormulaGrouping() const { return bool(pDelayedFormulaGrouping); }
/// To be used only by SharedFormulaUtil::joinFormulaCells().
void AddDelayedFormulaGroupingCell( const ScFormulaCell* cell );
diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index 070721dcd091..7b9610061bdb 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -232,7 +232,7 @@ void ScPDFExportTest::testExportRange_Tdf120161()
SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent);
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh.get() != nullptr);
+ CPPUNIT_ASSERT(xDocSh);
// put some content into the first row with default font
ScDocument& rDoc = xDocSh->GetDocument();
@@ -291,7 +291,7 @@ void ScPDFExportTest::testExportFitToPage_Tdf103516()
SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(mxComponent);
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh.get() != nullptr);
+ CPPUNIT_ASSERT(xDocSh);
// put some content into the table
ScDocument& rDoc = xDocSh->GetDocument();
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 2b2523319cec..bf09da9872f2 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -164,7 +164,7 @@ void ScFiltersTest::testTdf91979()
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh.get() != nullptr);
+ CPPUNIT_ASSERT(xDocSh);
// Get the document controller
ScTabViewShell* pViewShell = xDocSh->GetBestViewShell(false);
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index e81c0eee0957..49d949b2035d 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -117,7 +117,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh.get() != nullptr);
+ CPPUNIT_ASSERT(xDocSh);
// Get the document controller
pViewShell = xDocSh->GetBestViewShell(false);
@@ -185,7 +185,7 @@ void ScCopyPasteTest::testTdf84411()
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh.get() != nullptr);
+ CPPUNIT_ASSERT(xDocSh);
uno::Reference< frame::XModel2 > xModel2 ( xDocSh->GetModel(), UNO_QUERY );
CPPUNIT_ASSERT( xModel2.is() );
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 920350424fb8..eb8e0f555a52 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -6591,7 +6591,7 @@ void Test::testExternalRef()
// have been cached.
ScExternalRefCache::TableTypeRef pCacheTab = pRefMgr->getCacheTable(
nFileId, aExtSh1Name, false);
- CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 1 should exist.", pCacheTab.get() != nullptr);
+ CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 1 should exist.", pCacheTab);
ScRange aCachedRange = getCachedRange(pCacheTab);
CPPUNIT_ASSERT_MESSAGE("Unexpected cached data range.",
aCachedRange.aStart.Col() == 0 && aCachedRange.aEnd.Col() == 1 &&
@@ -6603,7 +6603,7 @@ void Test::testExternalRef()
// Sheet3's row 5 is not referenced; it should not be cached.
pCacheTab = pRefMgr->getCacheTable(nFileId, aExtSh3Name, false);
- CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 3 should exist.", pCacheTab.get() != nullptr);
+ CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 3 should exist.", pCacheTab);
aCachedRange = getCachedRange(pCacheTab);
CPPUNIT_ASSERT_MESSAGE("Unexpected cached data range.",
aCachedRange.aStart.Col() == 0 && aCachedRange.aEnd.Col() == 1 &&
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index b04ac76e06ab..85158474cb0a 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -383,7 +383,7 @@ void ScDocument::DelayFormulaGrouping( bool delay )
}
else
{
- if( pDelayedFormulaGrouping.get() != nullptr && pDelayedFormulaGrouping->IsValid())
+ if( pDelayedFormulaGrouping && pDelayedFormulaGrouping->IsValid())
RegroupFormulaCells( *pDelayedFormulaGrouping );
pDelayedFormulaGrouping.reset();
}
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 3d95f28269c2..e8aedefa8f42 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -530,7 +530,7 @@ void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm )
FSNS( XML_r, XML_id ), !sId.isEmpty()
? sId.toUtf8().getStr()
: nullptr,
- XML_location, mxTextMark.get() != nullptr
+ XML_location, mxTextMark
? XclXmlUtils::ToOString( *mxTextMark ).getStr()
: nullptr,
// OOXTODO: XML_tooltip, from record HLinkTooltip 800h wzTooltip
diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
index 0c2297cf8458..9d4e1c8342a3 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -545,7 +545,7 @@ bool XclImpExtName::CreateOleData(ScDocument& rDoc, const OUString& rUrl,
bool XclImpExtName::HasFormulaTokens() const
{
- return (mxArray.get() != nullptr);
+ return bool(mxArray);
}
// Cached external cells ======================================================
diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx
index 71de809efeb7..3db609828a86 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -55,7 +55,7 @@ public:
/** Returns the text data of this portion. */
const OUString& getText() const { return maText; }
/** Returns true, if the portion contains font formatting. */
- bool hasFont() const { return mxFont.get() != nullptr; }
+ bool hasFont() const { return bool(mxFont); }
/** Converts the portion and replaces or appends to the passed XText. */
void convert(
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 29972fac20a6..b9d556c783a9 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1541,7 +1541,7 @@ sal_Bool SAL_CALL ScExternalDocLinkObj::hasByName(const OUString &aName)
// #i116940# be consistent with getByName: allow only table names which have a cache already
ScExternalRefCache::TableTypeRef pTable = mpRefMgr->getCacheTable(mnFileId, aName, false);
- return (pTable.get() != nullptr);
+ return bool(pTable);
}
sal_Int32 SAL_CALL ScExternalDocLinkObj::getCount()
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 35bddcd3116e..58cf4c30b016 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -684,7 +684,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect
}
}
- if( pGroup.get() != nullptr )
+ if( pGroup )
{
const bool bLaserEffect = (eEffect >= AnimationEffect_LASER_FROM_LEFT) && (eEffect <= AnimationEffect_LASER_FROM_LOWERRIGHT);
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
index e2c3816daa1b..a8c81225130b 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
@@ -421,7 +421,7 @@ SdPage* AccessibleSlideSorterObject::GetPage() const
{
::sd::slidesorter::model::SharedPageDescriptor pDescriptor(
mrSlideSorter.GetModel().GetPageDescriptor(mnPageNumber));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->GetPage();
else
return nullptr;
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 305f8abaa3d4..99f38b4d3d79 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -387,7 +387,7 @@ Reference<XAccessible> SAL_CALL
const Point aTestPoint (aPoint.X, aPoint.Y);
::sd::slidesorter::model::SharedPageDescriptor pHitDescriptor (
mrSlideSorter.GetController().GetPageAt(aTestPoint));
- if (pHitDescriptor.get() != nullptr)
+ if (pHitDescriptor)
xAccessible = mpImpl->GetAccessibleChild(
(pHitDescriptor->GetPage()->GetPageNum()-1)/2);
@@ -737,7 +737,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces
{
::sd::slidesorter::model::SharedPageDescriptor pDescriptor(
mrSlideSorter.GetModel().GetPageDescriptor(nIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
maPageObjects[nIndex] = new AccessibleSlideSorterObject(
&mrAccessibleSlideSorter,
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 9444d21ed192..8eceb1c0c5a6 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -509,7 +509,7 @@ sal_Int8 CustomAnimationList::ExecuteDrop(const ExecuteDropEvent& rEvt)
const bool bMovingEffect = ( mxDndEffectDragging != nullptr );
const bool bMoveNotSelf = !xDndEffectInsertBefore || (mxDndEffectDragging && mxTreeView->iter_compare(*xDndEffectInsertBefore, *mxDndEffectDragging) != 0);
- const bool bHaveSequence = ( mpMainSequence.get() != nullptr );
+ const bool bHaveSequence(mpMainSequence);
if( bMovingEffect && bMoveNotSelf && bHaveSequence )
{
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index a55f93beecbc..8af4b358e074 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -2506,7 +2506,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
SdrPathObj* pPathObj = xTag->getPathObj();
CustomAnimationEffectPtr pEffect = xTag->getEffect();
- if( (pPathObj != nullptr) && pEffect.get() != nullptr )
+ if( (pPathObj != nullptr) && pEffect )
{
SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
if( pManager )
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 60c77e0d0890..75cd52b55f39 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -399,7 +399,7 @@ void MotionPathTag::updatePathAttributes()
void MotionPathTag::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( !(mpPathObj && !mbInUpdatePath && rHint.GetId() == SfxHintId::ThisIsAnSdrHint && (mpEffect.get() != nullptr)) )
+ if( !(mpPathObj && !mbInUpdatePath && rHint.GetId() == SfxHintId::ThisIsAnSdrHint && mpEffect) )
return;
if( mxPolyPoly != mpPathObj->GetPathPoly() )
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 03f8afb3b21a..fd32ba6c9026 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -100,7 +100,7 @@ void SAL_CALL FullScreenPane::disposing()
{
mpWindow.disposeAndClear();
- if (mpWorkWindow.get() != nullptr)
+ if (mpWorkWindow)
{
Link<VclWindowEvent&,void> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler));
mpWorkWindow->RemoveEventListener(aWindowEventHandler);
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 6ca637ea6694..631cc072edb3 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -168,7 +168,7 @@ Reference<rendering::XCanvas> Pane::CreateCanvas()
{
::cppcanvas::SpriteCanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::createSpriteCanvas(*mpWindow));
- if (pCanvas.get() != nullptr)
+ if (pCanvas)
xCanvas.set(pCanvas->getUNOSpriteCanvas());
}
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 4fce3397eae0..66774bd1e5ef 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -82,7 +82,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
{
// Make the frame window transparent and make the parent able to
// draw behind it.
- if (pParentWindow.get() != nullptr)
+ if (pParentWindow)
pParentWindow->EnableChildTransparentMode();
}
@@ -386,7 +386,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
const cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::createCanvas(rxCanvas));
- if (pCanvas.get() != nullptr)
+ if (pCanvas)
{
BitmapEx aBitmapEx(bmpid);
cppcanvas::BitmapSharedPtr xBitmap(
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index bb4a75209767..f8281e6319bb 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -98,7 +98,7 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas (
cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::createCanvas(rxCanvas));
- if (pCanvas.get() != nullptr)
+ if (pCanvas)
return cppcanvas::VCLFactory::createBitmap(
pCanvas,
CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap();
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index 21fb595e9624..767c1e332133 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -245,7 +245,7 @@ MasterPageContainer::Token MasterPageContainer::PutMasterPage (
void MasterPageContainer::AcquireToken (Token aToken)
{
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
++pDescriptor->mnUseCount;
}
@@ -361,7 +361,7 @@ OUString MasterPageContainer::GetURLForToken (
const ::osl::MutexGuard aGuard (mpImpl->maMutex);
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->msURL;
else
return OUString();
@@ -373,7 +373,7 @@ OUString MasterPageContainer::GetPageNameForToken (
const ::osl::MutexGuard aGuard (mpImpl->maMutex);
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->msPageName;
else
return OUString();
@@ -385,7 +385,7 @@ OUString MasterPageContainer::GetStyleNameForToken (
const ::osl::MutexGuard aGuard (mpImpl->maMutex);
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->msStyleName;
else
return OUString();
@@ -399,7 +399,7 @@ SdPage* MasterPageContainer::GetPageObjectForToken (
SdPage* pPageObject = nullptr;
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pPageObject = pDescriptor->mpMasterPage;
if (pPageObject == nullptr)
@@ -421,7 +421,7 @@ MasterPageContainer::Origin MasterPageContainer::GetOriginForToken (Token aToken
const ::osl::MutexGuard aGuard (mpImpl->maMutex);
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->meOrigin;
else
return UNKNOWN;
@@ -432,7 +432,7 @@ sal_Int32 MasterPageContainer::GetTemplateIndexForToken (Token aToken)
const ::osl::MutexGuard aGuard (mpImpl->maMutex);
SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->mnTemplateIndex;
else
return -1;
@@ -675,7 +675,7 @@ bool MasterPageContainer::Implementation::HasToken (Token aToken) const
{
return aToken>=0
&& o3tl::make_unsigned(aToken)<maContainer.size()
- && maContainer[aToken].get()!=nullptr;
+ && maContainer[aToken];
}
SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (Token aToken) const
@@ -691,7 +691,7 @@ void MasterPageContainer::Implementation::InvalidatePreview (Token aToken)
const ::osl::MutexGuard aGuard (maMutex);
SharedMasterPageDescriptor pDescriptor (GetDescriptor(aToken));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->maSmallPreview = Image();
pDescriptor->maLargePreview = Image();
@@ -712,7 +712,7 @@ Image MasterPageContainer::Implementation::GetPreviewForToken (
// When the preview is missing but inexpensively creatable then do that
// now.
- if (pDescriptor.get()!=nullptr)
+ if (pDescriptor)
{
if (ePreviewState == PS_CREATABLE)
if (UpdateDescriptor(pDescriptor, false,false, true))
@@ -760,7 +760,7 @@ MasterPageContainer::PreviewState MasterPageContainer::Implementation::GetPrevie
PreviewState eState (PS_NOT_AVAILABLE);
SharedMasterPageDescriptor pDescriptor = GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
if (pDescriptor->maLargePreview.GetSizePixel().Width() != 0)
eState = PS_AVAILABLE;
@@ -783,7 +783,7 @@ MasterPageContainer::PreviewState MasterPageContainer::Implementation::GetPrevie
bool MasterPageContainer::Implementation::RequestPreview (Token aToken)
{
SharedMasterPageDescriptor pDescriptor = GetDescriptor(aToken);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return mpRequestQueue->RequestPreview(pDescriptor);
else
return false;
diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
index 417702dd909d..b1067c9a6bee 100644
--- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
@@ -117,7 +117,7 @@ void MasterPageContainerQueue::LateInit()
bool MasterPageContainerQueue::RequestPreview (const SharedMasterPageDescriptor& rpDescriptor)
{
bool bSuccess (false);
- if (rpDescriptor.get() != nullptr
+ if (rpDescriptor
&& rpDescriptor->maLargePreview.GetSizePixel().Width() == 0)
{
sal_Int32 nPriority (CalculatePriority(rpDescriptor));
@@ -215,7 +215,7 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void
mpRequestQueue->erase(mpRequestQueue->begin());
- if (aRequest.mpDescriptor.get() != nullptr)
+ if (aRequest.mpDescriptor)
{
mnRequestsServedCount += 1;
if ( ! mpWeakContainer.expired())
diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx
index 061d4ea3f3bb..70a20ea4e017 100644
--- a/sd/source/ui/sidebar/PanelBase.cxx
+++ b/sd/source/ui/sidebar/PanelBase.cxx
@@ -69,7 +69,7 @@ bool PanelBase::ProvideWrappedControl()
if (mpWrappedControl)
mpWrappedControl->Show();
}
- return mpWrappedControl.get() != nullptr;
+ return bool(mpWrappedControl);
}
ISidebarReceiver::~ISidebarReceiver()
diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
index ec0c2a3d22e2..d3fba2087432 100644
--- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx
@@ -100,7 +100,7 @@ IMPL_LINK_NOARG(QueueProcessor, ProcessRequestHdl, Timer *, void)
void QueueProcessor::ProcessRequests()
{
- assert(mpCacheContext.get()!=nullptr);
+ assert(mpCacheContext);
// Never process more than one request at a time in order to prevent the
// lock up of the edit view.
@@ -147,7 +147,7 @@ void QueueProcessor::ProcessOneRequest (
::osl::MutexGuard aGuard (maMutex);
// Create a new preview bitmap and store it in the cache.
- if (mpCache != nullptr && mpCacheContext.get() != nullptr)
+ if (mpCache != nullptr && mpCacheContext)
{
const SdPage* pSdPage = dynamic_cast<const SdPage*>(mpCacheContext->GetPage(aKey));
if (pSdPage != nullptr)
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 638b405bdd09..2588124b867c 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -346,7 +346,7 @@ bool SlideSorterController::Command (
// focused page as top left position of the context menu.
model::SharedPageDescriptor pDescriptor (
GetFocusManager().GetFocusedPageDescriptor());
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
::tools::Rectangle aBBox (
mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox (
@@ -803,7 +803,7 @@ void SlideSorterController::PageNameHasChanged (int nPageIndex, const OUString&
{
// Request a repaint for the page object whose name has changed.
model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
mrView.RequestRepaint(pDescriptor);
// Get a pointer to the corresponding accessible object and notify
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 7b08dd24b1ff..c45e782be567 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -353,7 +353,7 @@ void Clipboard::SelectPageRange (sal_Int32 nFirstIndex, sal_Int32 nPageCount)
{
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetModel().GetPageDescriptor(nFirstIndex + i));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
rSelector.SelectPage(pDescriptor);
// The first page of the new selection is made the current page.
diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
index 8ae3afdad243..1d9970bb201b 100644
--- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
@@ -88,7 +88,7 @@ void CurrentSlideManager::NotifyCurrentSlideChange (const sal_Int32 nSlideIndex)
void CurrentSlideManager::ReleaseCurrentSlide()
{
- if (mpCurrentSlide.get() != nullptr)
+ if (mpCurrentSlide)
mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, false);
mpCurrentSlide.reset();
@@ -106,7 +106,7 @@ void CurrentSlideManager::AcquireCurrentSlide (const sal_Int32 nSlideIndex)
// given XDrawPage may or may not be member of the slide sorter
// document.
mpCurrentSlide = mrSlideSorter.GetModel().GetPageDescriptor(mnCurrentSlideIndex);
- if (mpCurrentSlide.get() != nullptr)
+ if (mpCurrentSlide)
mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, true);
}
}
@@ -163,7 +163,7 @@ void CurrentSlideManager::SwitchCurrentSlide (
void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescriptor& rpDescriptor)
{
- OSL_ASSERT(rpDescriptor.get() != nullptr);
+ OSL_ASSERT(rpDescriptor);
ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
if (pBase != nullptr)
@@ -182,7 +182,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri
void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescriptor& rpDescriptor)
{
- OSL_ASSERT(rpDescriptor.get() != nullptr);
+ OSL_ASSERT(rpDescriptor);
ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
if (pBase != nullptr)
@@ -200,7 +200,7 @@ void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescripto
void CurrentSlideManager::SetCurrentSlideAtXController (const SharedPageDescriptor& rpDescriptor)
{
- OSL_ASSERT(rpDescriptor.get() != nullptr);
+ OSL_ASSERT(rpDescriptor);
try
{
@@ -230,7 +230,7 @@ void CurrentSlideManager::HandleModelChange()
if (mnCurrentSlideIndex >= 0)
{
mpCurrentSlide = mrSlideSorter.GetModel().GetPageDescriptor(mnCurrentSlideIndex);
- if (mpCurrentSlide.get() != nullptr)
+ if (mpCurrentSlide)
mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, true);
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
index 0169bff7fbdc..60f0bd48d763 100644
--- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
@@ -143,7 +143,7 @@ model::SharedPageDescriptor FocusManager::GetFocusedPageDescriptor() const
bool FocusManager::SetFocusedPage (const model::SharedPageDescriptor& rpDescriptor)
{
- if (rpDescriptor.get() != nullptr)
+ if (rpDescriptor)
{
FocusHider aFocusHider (*this);
mnPageIndex = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
@@ -170,7 +170,7 @@ bool FocusManager::IsFocusShowing() const
void FocusManager::HideFocusIndicator (const model::SharedPageDescriptor& rpDescriptor)
{
- if (rpDescriptor.get() != nullptr)
+ if (rpDescriptor)
{
mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, false);
diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
index f3aa7ad19edd..b9d428297c8a 100644
--- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
@@ -125,7 +125,7 @@ void PageSelector::SetCoreSelection()
void PageSelector::SelectPage (int nPageIndex)
{
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
SelectPage(pDescriptor);
}
@@ -133,7 +133,7 @@ void PageSelector::SelectPage (const SdPage* pPage)
{
const sal_Int32 nPageIndex (mrModel.GetIndex(pPage));
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get()!=nullptr && pDescriptor->GetPage()==pPage)
+ if (pDescriptor && pDescriptor->GetPage()==pPage)
SelectPage(pDescriptor);
}
@@ -163,7 +163,7 @@ void PageSelector::SelectPage (const SharedPageDescriptor& rpDescriptor)
void PageSelector::DeselectPage (int nPageIndex)
{
model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
DeselectPage(pDescriptor);
}
@@ -213,7 +213,7 @@ void PageSelector::CheckConsistency() const
bool PageSelector::IsPageSelected(int nPageIndex)
{
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->HasState(PageDescriptor::ST_Selected);
else
return false;
@@ -222,7 +222,7 @@ bool PageSelector::IsPageSelected(int nPageIndex)
bool PageSelector::IsPageVisible(int nPageIndex)
{
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor->HasState(PageDescriptor::ST_Visible);
else
return false;
@@ -270,7 +270,7 @@ std::shared_ptr<PageSelector::PageSelection> PageSelector::GetPageSelection() co
for (int nIndex=0; nIndex<nPageCount; nIndex++)
{
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex));
- if (pDescriptor.get()!=nullptr && pDescriptor->HasState(PageDescriptor::ST_Selected))
+ if (pDescriptor && pDescriptor->HasState(PageDescriptor::ST_Selected))
pSelection->push_back(pDescriptor->GetPage());
}
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 1efdd922277a..0bf400aad1f7 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -588,7 +588,7 @@ void SelectionFunction::GotoNextPage (int nOffset)
{
model::SharedPageDescriptor pDescriptor
= mrController.GetCurrentSlideManager()->GetCurrentSlide();
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
SdPage* pPage = pDescriptor->GetPage();
OSL_ASSERT(pPage!=nullptr);
@@ -610,11 +610,11 @@ void SelectionFunction::GotoPage (int nIndex)
mrController.GetFocusManager().SetFocusedPage(nIndex);
model::SharedPageDescriptor pNextPageDescriptor (
mrSlideSorter.GetModel().GetPageDescriptor (nIndex));
- if (pNextPageDescriptor.get() != nullptr)
+ if (pNextPageDescriptor)
mpModeHandler->SetCurrentPage(pNextPageDescriptor);
else
{
- OSL_ASSERT(pNextPageDescriptor.get() != nullptr);
+ OSL_ASSERT(pNextPageDescriptor);
}
ResetShiftKeySelectionAnchor();
}
@@ -930,7 +930,7 @@ void SelectionFunction::ModeHandler::SwitchView (const model::SharedPageDescript
if (pViewShell==nullptr || !pViewShell->IsMainViewShell())
return;
- if (rpDescriptor.get()!=nullptr && rpDescriptor->GetPage()!=nullptr)
+ if (rpDescriptor && rpDescriptor->GetPage()!=nullptr)
{
mrSlideSorter.GetModel().GetDocument()->SetSelected(rpDescriptor->GetPage(), true);
pViewShell->GetFrameView()->SetSelectedPage(
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index d8f8207aaf69..4847ff3114bd 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -231,7 +231,7 @@ void SelectionManager::SelectionHasChanged ()
OSL_ASSERT(mrController.GetCurrentSlideManager());
SharedPageDescriptor pDescriptor(mrController.GetCurrentSlideManager()->GetCurrentSlide());
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pViewShell->UpdatePreview(pDescriptor->GetPage());
// Tell the selection change listeners that the selection has changed.
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 27febd5dde42..bb8814fb6fa7 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -952,7 +952,7 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool)
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
SdPage* pCurrentPage = nullptr;
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pCurrentPage = pDescriptor->GetPage();
return (pCurrentPage!=nullptr && aNewName == pCurrentPage->GetName())
@@ -980,7 +980,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUStri
{
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pPageToRename = pDescriptor->GetPage();
if (pPageToRename != nullptr)
diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
index 0fe7fbdcbcaf..4afc516a9b84 100644
--- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
+++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
@@ -200,7 +200,7 @@ sal_Int32 SlideSorterModel::GetIndex (const Reference<drawing::XDrawPage>& rxSli
aNumber >>= nNumber;
nNumber -= 1;
SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false));
- if (pDescriptor.get() != nullptr
+ if (pDescriptor
&& pDescriptor->GetXDrawPage() == rxSlide)
{
return nNumber;
@@ -244,7 +244,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const
// First try to guess the right index.
sal_Int16 nNumber ((pPage->GetPageNum()-1)/2);
SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false));
- if (pDescriptor.get() != nullptr
+ if (pDescriptor
&& pDescriptor->GetPage() == pPage)
{
return nNumber;
diff --git a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
index f434d8c5270d..a67f057e7e19 100644
--- a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
+++ b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
@@ -184,7 +184,7 @@ void PageEnumerationImpl::AdvanceToNextValidElement()
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(mnIndex));
// Test for the predicate being fulfilled.
- if (pDescriptor.get()!=nullptr && maPredicate(pDescriptor))
+ if (pDescriptor && maPredicate(pDescriptor))
{
// This predicate is valid.
break;
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index a0ef078f9953..5d933dcd379f 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -208,19 +208,19 @@ SlideSorter::~SlideSorter()
model::SlideSorterModel& SlideSorter::GetModel() const
{
- assert(mpSlideSorterModel.get()!=nullptr);
+ assert(mpSlideSorterModel);
return *mpSlideSorterModel;
}
view::SlideSorterView& SlideSorter::GetView() const
{
- assert(mpSlideSorterView.get()!=nullptr);
+ assert(mpSlideSorterView);
return *mpSlideSorterView;
}
controller::SlideSorterController& SlideSorter::GetController() const
{
- assert(mpSlideSorterController.get()!=nullptr);
+ assert(mpSlideSorterController);
return *mpSlideSorterController;
}
@@ -364,7 +364,7 @@ void SlideSorter::RelocateToWindow (vcl::Window* pParentWindow)
// view shell. (One is created earlier while the constructor of the base
// class is executed. But because at that time the correct
// accessibility object can not be constructed we do that now.)
- if (mpContentWindow.get() !=nullptr)
+ if (mpContentWindow)
{
mpContentWindow->Hide();
mpContentWindow->Show();
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index aae9af937627..4836ba3dd1b5 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -182,7 +182,7 @@ void SlideSorterViewShell::Init (bool bIsMainViewShell)
pActiveWindow->Show();
mpSlideSorter->GetModel().UpdatePageList();
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
mpContentWindow->SetViewShell(this);
}
@@ -239,7 +239,7 @@ css::uno::Reference<css::accessibility::XAccessible>
if (mpView == nullptr || mpSlideSorter == nullptr)
return nullptr;
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
::accessibility::AccessibleSlideSorterView *pAccessibleView =
new ::accessibility::AccessibleSlideSorterView(
@@ -267,7 +267,7 @@ void SlideSorterViewShell::SwitchViewFireFocus(const css::uno::Reference< css::a
SlideSorter& SlideSorterViewShell::GetSlideSorter() const
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
return *mpSlideSorter;
}
@@ -326,7 +326,7 @@ SdPage* SlideSorterViewShell::GetActualPage()
{
model::SharedPageDescriptor pDescriptor (
mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide());
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pCurrentPage = pDescriptor->GetPage();
}
@@ -336,32 +336,32 @@ SdPage* SlideSorterViewShell::GetActualPage()
void SlideSorterViewShell::GetMenuState ( SfxItemSet& rSet)
{
ViewShell::GetMenuState(rSet);
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetSlotManager()->GetMenuState(rSet);
}
void SlideSorterViewShell::GetClipboardState ( SfxItemSet& rSet)
{
ViewShell::GetMenuState(rSet);
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetSlotManager()->GetClipboardState(rSet);
}
void SlideSorterViewShell::ExecCtrl (SfxRequest& rRequest)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().ExecCtrl(rRequest);
}
void SlideSorterViewShell::GetCtrlState (SfxItemSet& rSet)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetCtrlState(rSet);
}
void SlideSorterViewShell::FuSupport (SfxRequest& rRequest)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().FuSupport(rRequest);
}
@@ -370,7 +370,7 @@ void SlideSorterViewShell::FuSupport (SfxRequest& rRequest)
*/
void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
switch (rRequest.GetSlot())
{
case SID_MODIFYPAGE:
@@ -394,19 +394,19 @@ void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest)
void SlideSorterViewShell::GetStatusBarState (SfxItemSet& rSet)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetStatusBarState(rSet);
}
void SlideSorterViewShell::FuPermanent (SfxRequest& rRequest)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().FuPermanent(rRequest);
}
void SlideSorterViewShell::GetAttrState (SfxItemSet& rSet)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetAttrState(rSet);
}
@@ -428,7 +428,7 @@ void SlideSorterViewShell::ArrangeGUIElements()
{
if (IsActive())
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->ArrangeGUIElements(maViewPos, maViewSize);
mbIsArrangeGUIElementsPending = false;
}
@@ -482,14 +482,14 @@ void SlideSorterViewShell::Command (
const CommandEvent& rEvent,
::sd::Window* pWindow)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
if ( ! mpSlideSorter->GetController().Command (rEvent, pWindow))
ViewShell::Command (rEvent, pWindow);
}
void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
if (pFrameView != nullptr)
{
view::SlideSorterView& rView (mpSlideSorter->GetView());
@@ -525,7 +525,7 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView)
void SlideSorterViewShell::WriteFrameViewData()
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
if (mpFrameView == nullptr)
return;
@@ -563,7 +563,7 @@ void SlideSorterViewShell::SetZoom (long int )
void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
Size aPageSize (mpSlideSorter->GetView().GetLayouter().GetPageObjectSize());
::tools::Rectangle aRect(rZoomRect);
@@ -611,7 +611,7 @@ void SlideSorterViewShell::StartDrag (
const Point& rDragPt,
vcl::Window* pWindow )
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetClipboard().StartDrag (
rDragPt,
pWindow);
@@ -624,7 +624,7 @@ sal_Int8 SlideSorterViewShell::AcceptDrop (
sal_uInt16 nPage,
SdrLayerID nLayer)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
return mpSlideSorter->GetController().GetClipboard().AcceptDrop (
rEvt,
rTargetHelper,
@@ -640,7 +640,7 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop (
sal_uInt16 nPage,
SdrLayerID nLayer)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
return mpSlideSorter->GetController().GetClipboard().ExecuteDrop (
rEvt,
rTargetHelper,
@@ -652,28 +652,28 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop (
std::shared_ptr<SlideSorterViewShell::PageSelection>
SlideSorterViewShell::GetPageSelection() const
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
return mpSlideSorter->GetController().GetPageSelector().GetPageSelection();
}
void SlideSorterViewShell::SetPageSelection (
const std::shared_ptr<PageSelection>& rSelection)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetPageSelector().SetPageSelection(rSelection, true);
}
void SlideSorterViewShell::AddSelectionChangeListener (
const Link<LinkParamNone*,void>& rCallback)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback);
}
void SlideSorterViewShell::RemoveSelectionChangeListener (
const Link<LinkParamNone*,void>& rCallback)
{
- assert(mpSlideSorter.get()!=nullptr);
+ assert(mpSlideSorter);
mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback);
}
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 6b090fbe5f5a..46f1c00435ce 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -445,7 +445,7 @@ void SlideSorterView::DeterminePageObjectVisibilities()
for (long nIndex=aUnion.Min(); nIndex<=aUnion.Max(); nIndex++)
{
pDescriptor = mrModel.GetPageDescriptor(nIndex);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
SetState(
pDescriptor,
PageDescriptor::ST_Visible,
@@ -484,7 +484,7 @@ void SlideSorterView::UpdatePreciousFlags()
for (int nIndex=0; nIndex<=nPageCount; ++nIndex)
{
pDescriptor = mrModel.GetPageDescriptor(nIndex);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pCache->SetPreciousFlag(
pDescriptor->GetPage(),
diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
index 96e0c4d57b40..ce27cec28dc3 100644
--- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
@@ -45,7 +45,7 @@ ViewCacheContext::~ViewCacheContext()
void ViewCacheContext::NotifyPreviewCreation(cache::CacheKey aKey)
{
const model::SharedPageDescriptor pDescriptor (GetDescriptor(aKey));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
// Force a repaint that will trigger their re-creation.
mrSlideSorter.GetView().RequestRepaint(pDescriptor);
diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx
index 9b4ff79b717b..522efec6fcfd 100644
--- a/sd/source/ui/view/FormShellManager.cxx
+++ b/sd/source/ui/view/FormShellManager.cxx
@@ -73,7 +73,7 @@ FormShellManager::~FormShellManager()
Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler));
mrBase.GetEventMultiplexer()->RemoveEventListener(aLink);
- if (mpSubShellFactory.get() != nullptr)
+ if (mpSubShellFactory)
{
ViewShell* pShell = mrBase.GetMainViewShell().get();
if (pShell != nullptr)
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index c4b4c208a8bb..df1091cced75 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -266,7 +266,7 @@ ViewShellBase::~ViewShellBase()
xSlideShow.clear();
// Tell the controller that the ViewShellBase is not available anymore.
- if (mpImpl->mpController.get() != nullptr)
+ if (mpImpl->mpController)
mpImpl->mpController->ReleaseViewShellBase();
// We have to hide the main window to prevent SFX complaining after a
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index eb9b0ff40a27..3b9308d8c5f0 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -1017,14 +1017,14 @@ void ViewShellManager::Implementation::DestroyViewShell (
maShellFactories.erase(aRange.first, aRange.second);
// Release the shell.
- if (rDescriptor.mpFactory.get() != nullptr)
+ if (rDescriptor.mpFactory)
rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell);
}
void ViewShellManager::Implementation::DestroySubShell (
const ShellDescriptor& rDescriptor)
{
- OSL_ASSERT(rDescriptor.mpFactory.get() != nullptr);
+ OSL_ASSERT(rDescriptor.mpFactory);
rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell);
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index afe8b0f9d9fa..c99163f62817 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -575,7 +575,7 @@ void DrawViewShell::UpdateHRuler()
Invalidate( SID_RULER_OBJECT );
Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->ForceUpdate();
}
@@ -589,7 +589,7 @@ void DrawViewShell::UpdateVRuler()
Invalidate( SID_RULER_PAGE_POS );
Invalidate( SID_RULER_OBJECT );
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->ForceUpdate();
}
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index e88e8683ae3f..9839d3d799e5 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -310,7 +310,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
{
bool bInsideOtherWindow = false;
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
aOutputArea = ::tools::Rectangle(Point(0,0),
mpContentWindow->GetOutputSizePixel());
@@ -791,19 +791,19 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect,
long nVOffs = 0;
sal_uInt16 nCnt;
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetLines();
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetLines();
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
{
nHOffs = mpHorizontalRuler->GetNullOffset() +
mpHorizontalRuler->GetPageOffset();
}
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
{
nVOffs = mpVerticalRuler->GetNullOffset() +
mpVerticalRuler->GetPageOffset();
@@ -820,9 +820,9 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect,
nCnt++;
}
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetLines(nCnt, pHLines);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetLines(nCnt, pVLines);
}
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
index 9ab5501c14e6..b914b2da8cbd 100644
--- a/sd/source/ui/view/grviewsh.cxx
+++ b/sd/source/ui/view/grviewsh.cxx
@@ -67,7 +67,7 @@ void GraphicViewShell::ChangeEditMode (
void GraphicViewShell::ArrangeGUIElements()
{
- if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible())
+ if (mpLayerTabBar && mpLayerTabBar->IsVisible())
{
Size aSize = mpLayerTabBar->GetSizePixel();
const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel());
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 9ce31a6cba29..47ac53f680c0 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -71,7 +71,7 @@ namespace sd {
*/
void ViewShell::UpdateScrollBars()
{
- if (mpHorizontalScrollBar.get() != nullptr)
+ if (mpHorizontalScrollBar)
{
long nW = static_cast<long>(mpContentWindow->GetVisibleWidth() * 32000);
long nX = static_cast<long>(mpContentWindow->GetVisibleX() * 32000);
@@ -84,7 +84,7 @@ void ViewShell::UpdateScrollBars()
mpHorizontalScrollBar->SetPageSize(nPage);
}
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
{
long nH = static_cast<long>(mpContentWindow->GetVisibleHeight() * 32000);
long nY = static_cast<long>(mpContentWindow->GetVisibleY() * 32000);
@@ -317,13 +317,13 @@ void ViewShell::SetZoom(long nZoom)
Fraction aUIScale(nZoom, 100);
aUIScale *= GetDoc()->GetUIScale();
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetZoom(aUIScale);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetZoom(aUIScale);
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
mpContentWindow->SetZoomIntegral(nZoom);
@@ -369,13 +369,13 @@ void ViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect)
Point aPos = GetActiveWindow()->GetWinViewPos();
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetZoom(aUIScale);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetZoom(aUIScale);
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
Point aNewPos = mpContentWindow->GetWinViewPos();
aNewPos.setX( aPos.X() );
@@ -409,7 +409,7 @@ void ViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect)
void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
const Point& rWinPos, bool bUpdate)
{
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
mpContentWindow->SetViewOrigin(rViewOrigin);
mpContentWindow->SetViewSize(rViewSize);
@@ -438,7 +438,7 @@ void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
*/
void ViewShell::InvalidateWindows()
{
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
mpContentWindow->Invalidate();
}
@@ -447,7 +447,7 @@ void ViewShell::InvalidateWindows()
*/
void ViewShell::DrawMarkRect(const ::tools::Rectangle& rRect) const
{
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
mpContentWindow->InvertTracking(rRect, ShowTrackFlags::Object | ShowTrackFlags::TrackWindow);
}
@@ -822,7 +822,7 @@ void ViewShell::SetRuler(bool bRuler)
{
mbHasRulers = ( bRuler && !GetDocSh()->IsPreview() ); // no rulers on preview mode
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
{
if (mbHasRulers)
{
@@ -834,7 +834,7 @@ void ViewShell::SetRuler(bool bRuler)
}
}
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
{
if (mbHasRulers)
{
@@ -853,13 +853,13 @@ void ViewShell::SetRuler(bool bRuler)
void ViewShell::SetScrollBarsVisible(bool bVisible)
{
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
mpVerticalScrollBar->Show( bVisible );
- if (mpHorizontalScrollBar.get() != nullptr)
+ if (mpHorizontalScrollBar)
mpHorizontalScrollBar->Show( bVisible );
- if (mpScrollBarBox.get() != nullptr)
+ if (mpScrollBarBox)
mpScrollBarBox->Show(bVisible);
}
@@ -916,7 +916,7 @@ void ViewShell::VisAreaChanged(const ::tools::Rectangle& /*rRect*/)
void ViewShell::SetWinViewPos(const Point& rWinPos)
{
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
{
mpContentWindow->SetWinViewPos(rWinPos);
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index ca99e3f7a214..9ba96ff29a87 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -111,7 +111,7 @@ namespace sd {
bool ViewShell::IsPageFlipMode() const
{
- return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow.get() != nullptr &&
+ return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow &&
mpContentWindow->GetVisibleHeight() >= 1.0;
}
@@ -149,7 +149,7 @@ ViewShell::~ViewShell()
mpLayerTabBar.disposeAndClear();
- if (mpImpl->mpSubShellFactory.get() != nullptr)
+ if (mpImpl->mpSubShellFactory)
GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(
this,mpImpl->mpSubShellFactory);
@@ -299,9 +299,9 @@ void ViewShell::Activate(bool bIsMDIActivate)
is sent sometimes asynchronous, it can happen, that the wrong window
gets the focus. */
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetActive();
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetActive();
if (bIsMDIActivate)
@@ -376,9 +376,9 @@ void ViewShell::Deactivate(bool bIsMDIActivate)
GetCurrentFunction()->Deactivate();
}
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetActive(false);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetActive(false);
SfxShell::Deactivate(bIsMDIActivate);
@@ -762,7 +762,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
void ViewShell::SetupRulers()
{
- if(!(mbHasRulers && (mpContentWindow.get() != nullptr) && !SlideShow::IsRunning(GetViewShellBase())))
+ if(!(mbHasRulers && mpContentWindow && !SlideShow::IsRunning(GetViewShellBase())))
return;
long nHRulerOfs = 0;
@@ -770,7 +770,7 @@ void ViewShell::SetupRulers()
if ( mpVerticalRuler.get() == nullptr )
{
mpVerticalRuler.reset(CreateVRuler(GetActiveWindow()));
- if ( mpVerticalRuler.get() != nullptr )
+ if ( mpVerticalRuler )
{
nHRulerOfs = mpVerticalRuler->GetSizePixel().Width();
mpVerticalRuler->SetActive();
@@ -780,7 +780,7 @@ void ViewShell::SetupRulers()
if ( mpHorizontalRuler.get() == nullptr )
{
mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow()));
- if ( mpHorizontalRuler.get() != nullptr )
+ if ( mpHorizontalRuler )
{
mpHorizontalRuler->SetWinPos(nHRulerOfs);
mpHorizontalRuler->SetActive();
@@ -899,26 +899,26 @@ SvBorder ViewShell::GetBorder()
SvBorder aBorder;
// Horizontal scrollbar.
- if (mpHorizontalScrollBar.get()!=nullptr
+ if (mpHorizontalScrollBar
&& mpHorizontalScrollBar->IsVisible())
{
aBorder.Bottom() = maScrBarWH.Height();
}
// Vertical scrollbar.
- if (mpVerticalScrollBar.get()!=nullptr
+ if (mpVerticalScrollBar
&& mpVerticalScrollBar->IsVisible())
{
aBorder.Right() = maScrBarWH.Width();
}
// Place horizontal ruler below tab bar.
- if (mbHasRulers && mpContentWindow.get() != nullptr)
+ if (mbHasRulers && mpContentWindow)
{
SetupRulers();
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
aBorder.Top() = mpHorizontalRuler->GetSizePixel().Height();
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
aBorder.Left() = mpVerticalRuler->GetSizePixel().Width();
}
@@ -940,11 +940,11 @@ void ViewShell::ArrangeGUIElements()
long nBottom = maViewPos.Y() + maViewSize.Height();
// Horizontal scrollbar.
- if (mpHorizontalScrollBar.get()!=nullptr
+ if (mpHorizontalScrollBar
&& mpHorizontalScrollBar->IsVisible())
{
nBottom -= maScrBarWH.Height();
- if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible())
+ if (mpLayerTabBar && mpLayerTabBar->IsVisible())
nBottom -= mpLayerTabBar->GetSizePixel().Height();
mpHorizontalScrollBar->SetPosSizePixel (
Point(nLeft, nBottom),
@@ -952,7 +952,7 @@ void ViewShell::ArrangeGUIElements()
}
// Vertical scrollbar.
- if (mpVerticalScrollBar.get()!=nullptr
+ if (mpVerticalScrollBar
&& mpVerticalScrollBar->IsVisible())
{
nRight -= maScrBarWH.Width();
@@ -962,11 +962,11 @@ void ViewShell::ArrangeGUIElements()
}
// Filler in the lower right corner.
- if (mpScrollBarBox.get() != nullptr)
+ if (mpScrollBarBox)
{
- if (mpHorizontalScrollBar.get()!=nullptr
+ if (mpHorizontalScrollBar
&& mpHorizontalScrollBar->IsVisible()
- && mpVerticalScrollBar.get()!=nullptr
+ && mpVerticalScrollBar
&& mpVerticalScrollBar->IsVisible())
{
mpScrollBarBox->Show();
@@ -977,20 +977,20 @@ void ViewShell::ArrangeGUIElements()
}
// Place horizontal ruler below tab bar.
- if (mbHasRulers && mpContentWindow.get() != nullptr)
+ if (mbHasRulers && mpContentWindow)
{
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
{
Size aRulerSize = mpHorizontalRuler->GetSizePixel();
aRulerSize.setWidth( nRight - nLeft );
mpHorizontalRuler->SetPosSizePixel (
Point(nLeft,nTop), aRulerSize);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpHorizontalRuler->SetBorderPos(
mpVerticalRuler->GetSizePixel().Width()-1);
nTop += aRulerSize.Height();
}
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
{
Size aRulerSize = mpVerticalRuler->GetSizePixel();
aRulerSize.setHeight( nBottom - nTop );
@@ -1021,7 +1021,7 @@ void ViewShell::ArrangeGUIElements()
Size(maViewSize.Width()-maScrBarWH.Width(),
maViewSize.Height()-maScrBarWH.Height()));
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
mpContentWindow->UpdateMapOrigin();
UpdateScrollBars();
@@ -1032,10 +1032,10 @@ void ViewShell::ArrangeGUIElements()
void ViewShell::SetUIUnit(FieldUnit eUnit)
{
// Set unit at horizontal and vertical rulers.
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetUnit(eUnit);
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->SetUnit(eUnit);
}
@@ -1044,7 +1044,7 @@ void ViewShell::SetUIUnit(FieldUnit eUnit)
*/
void ViewShell::SetDefTabHRuler( sal_uInt16 nDefTab )
{
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->SetDefTabDist( nDefTab );
}
@@ -1499,23 +1499,23 @@ void ViewShell::ShowUIControls (bool bVisible)
{
if (mbHasRulers)
{
- if (mpHorizontalRuler.get() != nullptr)
+ if (mpHorizontalRuler)
mpHorizontalRuler->Show( bVisible );
- if (mpVerticalRuler.get() != nullptr)
+ if (mpVerticalRuler)
mpVerticalRuler->Show( bVisible );
}
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
mpVerticalScrollBar->Show( bVisible );
- if (mpHorizontalScrollBar.get() != nullptr)
+ if (mpHorizontalScrollBar)
mpHorizontalScrollBar->Show( bVisible );
- if (mpScrollBarBox.get() != nullptr)
+ if (mpScrollBarBox)
mpScrollBarBox->Show(bVisible);
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
mpContentWindow->Show( bVisible );
}
@@ -1525,14 +1525,14 @@ bool ViewShell::RelocateToParentWindow (vcl::Window* pParentWindow)
mpParentWindow->SetBackground (Wallpaper());
- if (mpContentWindow.get() != nullptr)
+ if (mpContentWindow)
mpContentWindow->SetParent(pParentWindow);
- if (mpHorizontalScrollBar.get() != nullptr)
+ if (mpHorizontalScrollBar)
mpHorizontalScrollBar->SetParent(mpParentWindow);
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
mpVerticalScrollBar->SetParent(mpParentWindow);
- if (mpScrollBarBox.get() != nullptr)
+ if (mpScrollBarBox)
mpScrollBarBox->SetParent(mpParentWindow);
return true;
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx
index 2c494c058a2b..e82a0755b17c 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -1635,7 +1635,7 @@ bool PresenterAccessible::AccessibleParagraph::GetWindowState (const sal_Int16 n
switch (nType)
{
case AccessibleStateType::EDITABLE:
- return mpParagraph.get()!=nullptr;
+ return bool(mpParagraph);
case AccessibleStateType::ACTIVE:
return true;
diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx
index f663e97e943c..77964c5e8965 100644
--- a/sdext/source/presenter/PresenterButton.cxx
+++ b/sdext/source/presenter/PresenterButton.cxx
@@ -266,7 +266,7 @@ void SAL_CALL PresenterButton::mouseReleased (const css::awt::MouseEvent&)
if (meState == PresenterBitmapDescriptor::ButtonDown)
{
- OSL_ASSERT(mpPresenterController.get()!=nullptr);
+ OSL_ASSERT(mpPresenterController);
mpPresenterController->DispatchUnoCommand(msAction);
meState = PresenterBitmapDescriptor::Normal;
@@ -299,7 +299,7 @@ void SAL_CALL PresenterButton::disposing (const css::lang::EventObject& rEvent)
css::geometry::IntegerSize2D PresenterButton::CalculateButtonSize()
{
- if (mpFont.get()!=nullptr && !mpFont->mxFont.is() && mxCanvas.is())
+ if (mpFont && !mpFont->mxFont.is() && mxCanvas.is())
mpFont->PrepareFont(mxCanvas);
if (mpFont.get()==nullptr || !mpFont->mxFont.is())
return geometry::IntegerSize2D(-1,-1);
@@ -364,11 +364,11 @@ Reference<rendering::XBitmap> PresenterButton::GetBitmap (
const SharedBitmapDescriptor& mpIcon,
const PresenterBitmapDescriptor::Mode eMode)
{
- if (mpIcon.get() != nullptr)
+ if (mpIcon)
return mpIcon->GetBitmap(eMode);
else
{
- OSL_ASSERT(mpIcon.get()!=nullptr);
+ OSL_ASSERT(mpIcon);
return nullptr;
}
}
@@ -404,7 +404,7 @@ void PresenterButton::SetupButtonBitmaps()
mxMouseOverBitmap = mxCanvas->getDevice()->createCompatibleAlphaBitmap(maButtonSize);
xCanvas.set(mxMouseOverBitmap, UNO_QUERY);
- if (mpMouseOverFont.get()!=nullptr && !mpMouseOverFont->mxFont.is() && mxCanvas.is())
+ if (mpMouseOverFont && !mpMouseOverFont->mxFont.is() && mxCanvas.is())
mpMouseOverFont->PrepareFont(mxCanvas);
if (xCanvas.is())
RenderButton(
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 8d378d15f2f7..12787a546d18 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -503,7 +503,7 @@ void PresenterController::HideView (const OUString& rsViewURL)
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindViewURL(rsViewURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
mxConfigurationController->requestResourceDeactivation(
ResourceId::createWithAnchor(
@@ -765,7 +765,7 @@ void SAL_CALL PresenterController::notifyConfigurationChange (
mpWindowManager->Update();
// Request the repainting of the area previously
// occupied by the view.
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
GetPaintManager()->Invalidate(pDescriptor->mxBorderWindow);
}
}
@@ -953,7 +953,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
case awt::Key::F1:
// Toggle the help view.
- if (mpWindowManager.get() != nullptr)
+ if (mpWindowManager)
{
if (mpWindowManager->GetViewMode() != PresenterWindowManager::VM_Help)
mpWindowManager->SetViewMode(PresenterWindowManager::VM_Help);
@@ -1053,7 +1053,7 @@ void PresenterController::InitializeMainPane (const Reference<XPane>& rxPane)
mpWindowManager->SetParentPane(rxPane);
mpWindowManager->SetTheme(mpTheme);
- if (mpPaneBorderPainter.get() != nullptr)
+ if (mpPaneBorderPainter)
mpPaneBorderPainter->SetTheme(mpTheme);
// Add key listener
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index 9f0a55de4068..ecff22e648d6 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -155,7 +155,7 @@ PresenterHelpView::PresenterHelpView (
if (mpPresenterController.is())
{
mpFont = mpPresenterController->GetViewFont(mxViewId->getResourceURL());
- if (mpFont.get() != nullptr)
+ if (mpFont)
{
mpFont->PrepareFont(mxCanvas);
}
@@ -464,7 +464,7 @@ void PresenterHelpView::ProvideCanvas()
void PresenterHelpView::Resize()
{
- if (!(mpCloseButton.get() != nullptr && mxWindow.is()))
+ if (!(mpCloseButton && mxWindow.is()))
return;
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index c271875fe14a..a9fa7446b693 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -258,7 +258,7 @@ void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesP
Layout();
- if (mpScrollBar.get() != nullptr)
+ if (mpScrollBar)
{
mpScrollBar->SetThumbPosition(0, false);
UpdateScrollBar();
@@ -405,13 +405,13 @@ void PresenterNotesView::Layout()
mnSeparatorYLocation = aWindowBox.Height - nToolBarHeight - gnSpaceBelowSeparator;
aNewTextBoundingBox.Y2 = mnSeparatorYLocation - gnSpaceAboveSeparator;
// Place the close button.
- if (mpCloseButton.get() != nullptr)
+ if (mpCloseButton)
mpCloseButton->SetCenter(geometry::RealPoint2D(
(aWindowBox.Width + aToolBarSize.Width) / 2,
aWindowBox.Height - aToolBarSize.Height/2));
}
// Check whether the vertical scroll bar is necessary.
- if (mpScrollBar.get() != nullptr)
+ if (mpScrollBar)
{
bool bShowVerticalScrollbar (false);
try
@@ -514,7 +514,7 @@ void PresenterNotesView::PaintToolBar (const awt::Rectangle& rUpdateBox)
Sequence<double>(4),
rendering::CompositeOperation::SOURCE);
- if (mpBackground.get() != nullptr)
+ if (mpBackground)
{
// Paint the background.
mpPresenterController->GetCanvasHelper()->Paint(
@@ -544,7 +544,7 @@ void PresenterNotesView::PaintText (const awt::Rectangle& rUpdateBox)
if (aBox.Width <= 0 || aBox.Height <= 0)
return;
- if (mpBackground.get() != nullptr)
+ if (mpBackground)
{
// Paint the background.
mpPresenterController->GetCanvasHelper()->Paint(
diff --git a/sdext/source/presenter/PresenterPaneBase.cxx b/sdext/source/presenter/PresenterPaneBase.cxx
index 29e7e4b046d8..6ec411b99c1b 100644
--- a/sdext/source/presenter/PresenterPaneBase.cxx
+++ b/sdext/source/presenter/PresenterPaneBase.cxx
@@ -47,7 +47,7 @@ PresenterPaneBase::PresenterPaneBase (
msTitle(),
mxComponentContext(rxContext)
{
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
mxPresenterHelper = mpPresenterController->GetPresenterHelper();
}
@@ -98,7 +98,7 @@ void PresenterPaneBase::SetTitle (const OUString& rsTitle)
{
msTitle = rsTitle;
- OSL_ASSERT(mpPresenterController.get()!=nullptr);
+ OSL_ASSERT(mpPresenterController);
OSL_ASSERT(mpPresenterController->GetPaintManager() != nullptr);
mpPresenterController->GetPaintManager()->Invalidate(mxBorderWindow);
diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
index ba57bb09b40b..53d60faa2315 100644
--- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx
+++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
@@ -260,7 +260,7 @@ awt::Point SAL_CALL PresenterPaneBorderPainter::getCalloutOffset (
{
const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(
mpRenderer->GetRendererPaneStyle(rsPaneBorderStyleName));
- if (pRendererPaneStyle != nullptr && pRendererPaneStyle->mpBottomCallout.get() != nullptr)
+ if (pRendererPaneStyle != nullptr && pRendererPaneStyle->mpBottomCallout)
{
return awt::Point (
0,
@@ -771,7 +771,7 @@ RendererPaneStyle::RendererPaneStyle (
mpFont = rpTheme->GetFont(rsStyleName);
OUString sAnchor ("Left");
- if (mpFont.get() != nullptr)
+ if (mpFont)
{
sAnchor = mpFont->msAnchor;
mnFontXOffset = mpFont->mnXOffset;
@@ -887,7 +887,7 @@ SharedBitmapDescriptor RendererPaneStyle::GetBitmap(
const OUString& rsBitmapName)
{
SharedBitmapDescriptor pDescriptor (rpTheme->GetBitmap(rsStyleName, rsBitmapName));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
return pDescriptor;
else
return mpEmpty;
diff --git a/sdext/source/presenter/PresenterPaneContainer.cxx b/sdext/source/presenter/PresenterPaneContainer.cxx
index 7c9c1a5fc2e9..a102304258fb 100644
--- a/sdext/source/presenter/PresenterPaneContainer.cxx
+++ b/sdext/source/presenter/PresenterPaneContainer.cxx
@@ -59,7 +59,7 @@ void PresenterPaneContainer::PreparePane (
return;
SharedPaneDescriptor pPane (FindPaneURL(rxPaneId->getResourceURL()));
- if (pPane.get() != nullptr)
+ if (pPane)
return;
// No entry found for the given pane id. Create a new one.
@@ -110,7 +110,7 @@ PresenterPaneContainer::SharedPaneDescriptor
PreparePane(xPaneId, OUString(), OUString(), OUString(),
false, ViewInitializationFunction());
pDescriptor = FindPaneURL(sPaneURL);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
Reference<awt::XWindow> xWindow (rxPane->getWindow());
pDescriptor->mxContentWindow = xWindow;
@@ -138,7 +138,7 @@ PresenterPaneContainer::SharedPaneDescriptor
sPaneURL = rxPaneId->getResourceURL();
SharedPaneDescriptor pDescriptor (FindPaneURL(sPaneURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->mxBorderWindow = rxBorderWindow;
return pDescriptor;
@@ -165,7 +165,7 @@ PresenterPaneContainer::SharedPaneDescriptor
}
pDescriptor = FindPaneURL(sPaneURL);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->mxView = rxView;
try
@@ -187,7 +187,7 @@ PresenterPaneContainer::SharedPaneDescriptor
PresenterPaneContainer::RemovePane (const Reference<XResourceId>& rxPaneId)
{
SharedPaneDescriptor pDescriptor (FindPaneId(rxPaneId));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
if (pDescriptor->mxContentWindow.is())
pDescriptor->mxContentWindow->removeEventListener(this);
@@ -217,7 +217,7 @@ PresenterPaneContainer::SharedPaneDescriptor
}
pDescriptor = FindPaneURL(sPaneURL);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->mxView = nullptr;
}
@@ -282,7 +282,7 @@ PresenterPaneContainer::SharedPaneDescriptor PresenterPaneContainer::FindViewURL
OUString PresenterPaneContainer::GetPaneURLForViewURL (const OUString& rsViewURL)
{
SharedPaneDescriptor pDescriptor (FindViewURL(rsViewURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
if (pDescriptor->mxPaneId.is())
return pDescriptor->mxPaneId->getResourceURL();
return OUString();
@@ -315,7 +315,7 @@ void SAL_CALL PresenterPaneContainer::disposing (
{
SharedPaneDescriptor pDescriptor (
FindContentWindow(Reference<awt::XWindow>(rEvent.Source, UNO_QUERY)));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
RemovePane(pDescriptor->mxPaneId);
}
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index a22bfa246c1b..e2e2a8c0de0a 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -151,7 +151,7 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource (
mpPresenterController->GetPaneContainer());
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
pPaneContainer->FindPaneURL(sPaneURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->SetActivationState(true);
if (pDescriptor->mxBorderWindow.is())
@@ -277,7 +277,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
pContainer->StoreBorderWindow(rxPaneId, xPane->GetBorderWindow()));
pContainer->StorePane(xPane);
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->mbIsSprite = bIsSpritePane;
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 66bf66c6fcf4..9ea7790ce6eb 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -398,7 +398,7 @@ void PresenterProtocolHandler::Dispatch::disposing()
{
if (mbIsListeningToWindowManager)
{
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
mpPresenterController->GetWindowManager()->RemoveLayoutListener(this);
mbIsListeningToWindowManager = false;
}
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index bbb754050e8f..d04e4aff6855 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -560,7 +560,7 @@ void PresenterScreen::ShutdownPresenterScreen()
xPaneFactoryComponent->dispose();
mxPaneFactory = nullptr;
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
{
mpPresenterController->dispose();
mpPresenterController.clear();
@@ -784,7 +784,7 @@ void PresenterScreen::SetupView(
aViewDescriptor = iDescriptor->second;
// Prepare the pane.
- OSL_ASSERT(mpPaneContainer.get() != nullptr);
+ OSL_ASSERT(mpPaneContainer);
mpPaneContainer->PreparePane(
xPaneId,
rsViewURL,
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx
index 46f1490e38f3..be498680fafa 100644
--- a/sdext/source/presenter/PresenterScrollBar.cxx
+++ b/sdext/source/presenter/PresenterScrollBar.cxx
@@ -520,7 +520,7 @@ void PresenterScrollBar::UpdateWidthOrHeight (
sal_Int32& rSize,
const SharedBitmapDescriptor& rpDescriptor)
{
- if (rpDescriptor.get() != nullptr)
+ if (rpDescriptor)
{
Reference<rendering::XBitmap> xBitmap (rpDescriptor->GetNormalBitmap());
if (xBitmap.is())
@@ -620,7 +620,7 @@ void PresenterVerticalScrollBar::UpdateBorders()
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
double nBottom = aWindowBox.Height;
- if (mpNextButtonDescriptor.get() != nullptr)
+ if (mpNextButtonDescriptor)
{
Reference<rendering::XBitmap> xBitmap (mpNextButtonDescriptor->GetNormalBitmap());
if (xBitmap.is())
@@ -631,7 +631,7 @@ void PresenterVerticalScrollBar::UpdateBorders()
nBottom -= aSize.Height + gnScrollBarGap;
}
}
- if (mpPrevButtonDescriptor.get() != nullptr)
+ if (mpPrevButtonDescriptor)
{
Reference<rendering::XBitmap> xBitmap (mpPrevButtonDescriptor->GetNormalBitmap());
if (xBitmap.is())
diff --git a/sdext/source/presenter/PresenterSlidePreview.cxx b/sdext/source/presenter/PresenterSlidePreview.cxx
index 9e22850de7cc..f95d9a050947 100644
--- a/sdext/source/presenter/PresenterSlidePreview.cxx
+++ b/sdext/source/presenter/PresenterSlidePreview.cxx
@@ -80,7 +80,7 @@ PresenterSlidePreview::PresenterSlidePreview (
mxWindow->setVisible(true);
}
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
mnSlideAspectRatio = mpPresenterController->GetSlideAspectRatio();
Reference<lang::XMultiComponentFactory> xFactory = rxContext->getServiceManager();
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index 609b2d8566eb..9cf7b5c5c85d 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -79,7 +79,7 @@ PresenterSlideShowView::PresenterSlideShowView (
mbIsEndSlideVisible(false),
mxCurrentSlide()
{
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
{
mnPageAspectRatio = mpPresenterController->GetSlideAspectRatio();
mpBackground = mpPresenterController->GetViewBackground(mxViewId->getResourceURL());
@@ -250,7 +250,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
const css::uno::Reference<css::drawing::XDrawPage>& rxSlide)
{
mxCurrentSlide = rxSlide;
- if (mpPresenterController.get() != nullptr
+ if (mpPresenterController
&& mxSlideShowController.is()
&& ! mpPresenterController->GetCurrentSlide().is()
&& ! mxSlideShowController->isPaused())
@@ -265,7 +265,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
// backwards.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL()));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
msTitleTemplate = pDescriptor->msTitleTemplate;
pDescriptor->msTitleTemplate = msClickToExitPresentationTitle;
@@ -279,7 +279,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
// Restore the title template.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL()));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
pDescriptor->msTitleTemplate = msTitleTemplate;
pDescriptor->msTitle.clear();
@@ -523,7 +523,7 @@ void SAL_CALL PresenterSlideShowView::mousePressed (const awt::MouseEvent& rEven
// the PresenterController so that it switches to the next slide and
// ends the presentation.
if (mbIsEndSlideVisible)
- if (mpPresenterController.get() != nullptr)
+ if (mpPresenterController)
mpPresenterController->HandleMouseClick(rEvent);
}
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index 029b0e05f3b0..1bbb30147d4f 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -304,7 +304,7 @@ PresenterSlideSorter::PresenterSlideSorter (
{
PresenterTheme::SharedFontDescriptor pFont (
mpPresenterController->GetTheme()->GetFont("ButtonFont"));
- if (pFont.get() != nullptr)
+ if (pFont)
maSeparatorColor = pFont->mnColor;
}
@@ -508,8 +508,8 @@ void SAL_CALL PresenterSlideSorter::mouseReleased (const css::awt::MouseEvent& r
break;
case 2:
- OSL_ASSERT(mpPresenterController.get()!=nullptr);
- OSL_ASSERT(mpPresenterController->GetWindowManager().get()!=nullptr);
+ OSL_ASSERT(mpPresenterController);
+ OSL_ASSERT(mpPresenterController->GetWindowManager());
mpPresenterController->GetWindowManager()->SetSlideSorterState(false);
GotoSlide(nSlideIndex);
break;
@@ -693,7 +693,7 @@ geometry::RealRectangle2D PresenterSlideSorter::PlaceScrollBars (
bool bIsScrollBarNeeded (false);
Reference<container::XIndexAccess> xSlides (mxSlideShowController, UNO_QUERY_THROW);
bIsScrollBarNeeded = mpLayout->IsScrollBarNeeded(xSlides->getCount());
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
{
if (bIsScrollBarNeeded)
{
@@ -746,7 +746,7 @@ void PresenterSlideSorter::PlaceCloseButton (
// centered over the callout. Otherwise it is centered with respect to
// the whole window.
sal_Int32 nCloseButtonCenter (rCenterBox.Width/2);
- if (rpPane.get() != nullptr && rpPane->mxPane.is())
+ if (rpPane && rpPane->mxPane.is())
{
const sal_Int32 nCalloutCenter (-nLeftBorderWidth);
const sal_Int32 nDistanceFromWindowCenter (abs(nCalloutCenter - rCenterBox.Width/2));
@@ -1383,7 +1383,7 @@ void PresenterSlideSorter::Layout::UpdateScrollBars()
{
sal_Int32 nTotalRowCount = sal_Int32(ceil(double(mnSlideCount) / double(mnColumnCount)));
- if (mpVerticalScrollBar.get() != nullptr)
+ if (mpVerticalScrollBar)
{
mpVerticalScrollBar->SetTotalSize(
nTotalRowCount * maPreviewSize.Height
@@ -1485,7 +1485,7 @@ void PresenterSlideSorter::MouseOverManager::SetCanvas (
const Reference<rendering::XCanvas>& rxCanvas)
{
mxCanvas = rxCanvas;
- if (mpFont.get() != nullptr)
+ if (mpFont)
mpFont->PrepareFont(mxCanvas);
}
@@ -1504,7 +1504,7 @@ void PresenterSlideSorter::MouseOverManager::SetSlide (
if (nSlideIndex >= 0)
{
- if (mxSlides.get() != nullptr)
+ if (mxSlides)
{
msText.clear();
@@ -1654,7 +1654,7 @@ geometry::IntegerSize2D PresenterSlideSorter::MouseOverManager::CalculateLabelSi
{
// Height is specified by the label bitmaps.
sal_Int32 nHeight (32);
- if (mpCenterLabelBitmap.get() != nullptr)
+ if (mpCenterLabelBitmap)
{
Reference<rendering::XBitmap> xBitmap (mpCenterLabelBitmap->GetNormalBitmap());
if (xBitmap.is())
@@ -1676,15 +1676,15 @@ void PresenterSlideSorter::MouseOverManager::PaintButtonBackground (
{
// Get the bitmaps for painting the label background.
Reference<rendering::XBitmap> xLeftLabelBitmap;
- if (mpLeftLabelBitmap.get() != nullptr)
+ if (mpLeftLabelBitmap)
xLeftLabelBitmap = mpLeftLabelBitmap->GetNormalBitmap();
Reference<rendering::XBitmap> xCenterLabelBitmap;
- if (mpCenterLabelBitmap.get() != nullptr)
+ if (mpCenterLabelBitmap)
xCenterLabelBitmap = mpCenterLabelBitmap->GetNormalBitmap();
Reference<rendering::XBitmap> xRightLabelBitmap;
- if (mpRightLabelBitmap.get() != nullptr)
+ if (mpRightLabelBitmap)
xRightLabelBitmap = mpRightLabelBitmap->GetNormalBitmap();
PresenterUIPainter::PaintHorizontalBitmapComposite (
@@ -1747,31 +1747,31 @@ PresenterSlideSorter::CurrentSlideFrameRenderer::CurrentSlideFrameRenderer (
mpBottomRight = aContainer.GetBitmap("BottomRight");
// Determine size of frame.
- if (mpTop.get() != nullptr)
+ if (mpTop)
mnTopFrameSize = mpTop->mnHeight;
- if (mpLeft.get() != nullptr)
+ if (mpLeft)
mnLeftFrameSize = mpLeft->mnWidth;
- if (mpRight.get() != nullptr)
+ if (mpRight)
mnRightFrameSize = mpRight->mnWidth;
- if (mpBottom.get() != nullptr)
+ if (mpBottom)
mnBottomFrameSize = mpBottom->mnHeight;
- if (mpTopLeft.get() != nullptr)
+ if (mpTopLeft)
{
mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopLeft->mnHeight);
mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpTopLeft->mnWidth);
}
- if (mpTopRight.get() != nullptr)
+ if (mpTopRight)
{
mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopRight->mnHeight);
mnRightFrameSize = ::std::max(mnRightFrameSize, mpTopRight->mnWidth);
}
- if (mpBottomLeft.get() != nullptr)
+ if (mpBottomLeft)
{
mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpBottomLeft->mnWidth);
mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomLeft->mnHeight);
}
- if (mpBottomRight.get() != nullptr)
+ if (mpBottomRight)
{
mnRightFrameSize = ::std::max(mnRightFrameSize, mpBottomRight->mnWidth);
mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomRight->mnHeight);
@@ -1789,7 +1789,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
const Reference<rendering::XPolyPolygon2D> xClip (
PresenterGeometryHelper::CreatePolygon(rClipBox, rxCanvas->getDevice()));
- if (mpTop.get() != nullptr)
+ if (mpTop)
{
PaintBitmapTiled(
mpTop->GetNormalBitmap(),
@@ -1800,7 +1800,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.Width,
mpTop->mnHeight);
}
- if (mpLeft.get() != nullptr)
+ if (mpLeft)
{
PaintBitmapTiled(
mpLeft->GetNormalBitmap(),
@@ -1811,7 +1811,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
mpLeft->mnWidth,
rSlideBoundingBox.Height);
}
- if (mpRight.get() != nullptr)
+ if (mpRight)
{
PaintBitmapTiled(
mpRight->GetNormalBitmap(),
@@ -1822,7 +1822,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
mpRight->mnWidth,
rSlideBoundingBox.Height);
}
- if (mpBottom.get() != nullptr)
+ if (mpBottom)
{
PaintBitmapTiled(
mpBottom->GetNormalBitmap(),
@@ -1833,7 +1833,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.Width,
mpBottom->mnHeight);
}
- if (mpTopLeft.get() != nullptr)
+ if (mpTopLeft)
{
PaintBitmapOnce(
mpTopLeft->GetNormalBitmap(),
@@ -1842,7 +1842,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X - mpTopLeft->mnWidth,
rSlideBoundingBox.Y - mpTopLeft->mnHeight);
}
- if (mpTopRight.get() != nullptr)
+ if (mpTopRight)
{
PaintBitmapOnce(
mpTopRight->GetNormalBitmap(),
@@ -1851,7 +1851,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X + rSlideBoundingBox.Width,
rSlideBoundingBox.Y - mpTopLeft->mnHeight);
}
- if (mpBottomLeft.get() != nullptr)
+ if (mpBottomLeft)
{
PaintBitmapOnce(
mpBottomLeft->GetNormalBitmap(),
@@ -1860,7 +1860,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X - mpBottomLeft->mnWidth,
rSlideBoundingBox.Y + rSlideBoundingBox.Height);
}
- if (mpBottomRight.get() != nullptr)
+ if (mpBottomRight)
{
PaintBitmapOnce(
mpBottomRight->GetNormalBitmap(),
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index 69b8fea28369..2cc7f2efa252 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -299,7 +299,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const
OSL_ASSERT(mpTheme != nullptr);
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
- if (pPaneStyle.get() != nullptr)
+ if (pPaneStyle)
if (bOuter)
return pPaneStyle->maOuterBorderSize.ToVector();
else
@@ -381,18 +381,18 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap (
else
{
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
- if (pPaneStyle.get() != nullptr)
+ if (pPaneStyle)
{
SharedBitmapDescriptor pBitmap (pPaneStyle->GetBitmap(rsBitmapName));
- if (pBitmap.get() != nullptr)
+ if (pBitmap)
return pBitmap;
}
SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName));
- if (pViewStyle.get() != nullptr)
+ if (pViewStyle)
{
SharedBitmapDescriptor pBitmap (pViewStyle->GetBitmap(rsBitmapName));
- if (pBitmap.get() != nullptr)
+ if (pBitmap)
return pBitmap;
}
}
@@ -440,11 +440,11 @@ PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont (
if (mpTheme != nullptr)
{
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
- if (pPaneStyle.get() != nullptr)
+ if (pPaneStyle)
return pPaneStyle->GetFont();
SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName));
- if (pViewStyle.get() != nullptr)
+ if (pViewStyle)
return pViewStyle->GetFont();
std::shared_ptr<Theme> pTheme (mpTheme);
@@ -620,7 +620,7 @@ void PresenterTheme::Theme::Read (
SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const
{
SharedPaneStyle pPaneStyle (maPaneStyles.GetPaneStyle(rsStyleName));
- if (pPaneStyle.get() != nullptr)
+ if (pPaneStyle)
return pPaneStyle;
else if (mpParentTheme != nullptr)
return mpParentTheme->GetPaneStyle(rsStyleName);
@@ -631,7 +631,7 @@ SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName
SharedViewStyle PresenterTheme::Theme::GetViewStyle (const OUString& rsStyleName) const
{
SharedViewStyle pViewStyle (maViewStyles.GetViewStyle(rsStyleName));
- if (pViewStyle.get() != nullptr)
+ if (pViewStyle)
return pViewStyle;
else if (mpParentTheme != nullptr)
return mpParentTheme->GetViewStyle(rsStyleName);
@@ -898,7 +898,7 @@ SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const
if (mpBitmaps != nullptr)
{
SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName);
- if (pBitmap.get() != nullptr)
+ if (pBitmap)
return pBitmap;
}
@@ -910,7 +910,7 @@ SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const
PresenterTheme::SharedFontDescriptor PaneStyle::GetFont() const
{
- if (mpFont.get() != nullptr)
+ if (mpFont)
return mpFont;
else if (mpParentStyle != nullptr)
return mpParentStyle->GetFont();
@@ -969,7 +969,7 @@ void ViewStyleContainer::ProcessViewStyle(
PresenterConfigurationAccess::GetProperty(rxProperties, "Font"), UNO_QUERY);
PresenterTheme::SharedFontDescriptor pFont (
ReadContext::ReadFont(xFontNode, sPathToFont, PresenterTheme::SharedFontDescriptor()));
- if (pFont.get() != nullptr)
+ if (pFont)
pStyle->mpFont = pFont;
Reference<container::XHierarchicalNameAccess> xBackgroundNode (
@@ -981,7 +981,7 @@ void ViewStyleContainer::ProcessViewStyle(
rReadContext.mxPresenterHelper,
rReadContext.mxCanvas,
SharedBitmapDescriptor()));
- if (pBackground.get() != nullptr && pBackground->GetNormalBitmap().is())
+ if (pBackground && pBackground->GetNormalBitmap().is())
pStyle->mpBackground = pBackground;
mStyles.push_back(pStyle);
@@ -1016,7 +1016,7 @@ SharedBitmapDescriptor ViewStyle::GetBitmap (const OUString& rsBitmapName) const
PresenterTheme::SharedFontDescriptor ViewStyle::GetFont() const
{
- if (mpFont.get() != nullptr)
+ if (mpFont)
return mpFont;
else if (mpParentStyle != nullptr)
return mpParentStyle->GetFont();
diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx
index 348a8ffab7e5..0ecbad47da14 100644
--- a/sdext/source/presenter/PresenterTimer.cxx
+++ b/sdext/source/presenter/PresenterTimer.cxx
@@ -249,7 +249,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId)
// from being scheduled again and b) tries to prevent its execution.
{
::osl::MutexGuard aGuard (maCurrentTaskMutex);
- if (mpCurrentTask.get() != nullptr
+ if (mpCurrentTask
&& mpCurrentTask->mnTaskId == nTaskId)
mpCurrentTask->mbIsCanceled = true;
}
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index 206034c7ee7e..4edce3701bdb 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -412,7 +412,7 @@ void SAL_CALL PresenterToolBar::disposing()
OSL_ASSERT(rxPart != nullptr);
for (rtl::Reference<Element>& pElement : *rxPart)
{
- if (pElement.get() != nullptr)
+ if (pElement)
{
Reference<lang::XComponent> xComponent (
static_cast<XWeak*>(pElement.get()), UNO_QUERY);
@@ -657,7 +657,7 @@ void PresenterToolBar::ProcessEntry (
{
pElement->SetModes( pNormalMode, pMouseOverMode, pSelectedMode, pDisabledMode);
pElement->UpdateState();
- if (mpCurrentContainerPart.get() != nullptr)
+ if (mpCurrentContainerPart)
mpCurrentContainerPart->push_back(pElement);
}
}
@@ -928,7 +928,7 @@ void PresenterToolBar::Paint (
{
for (auto& rxElement : *rxPart)
{
- if (rxElement.get() != nullptr)
+ if (rxElement)
{
if ( ! rxElement->IsOutside(rUpdateBox))
rxElement->Paint(mxCanvas, rViewState);
@@ -945,7 +945,7 @@ void PresenterToolBar::UpdateSlideNumber()
{
for (auto& rxElement : *rxPart)
{
- if (rxElement.get() != nullptr)
+ if (rxElement)
rxElement->CurrentSlideHasChanged();
}
}
@@ -1136,7 +1136,7 @@ Element::Element (
mbIsSelected(false),
mbIsEnabled(true)
{
- if (mpToolBar.get() != nullptr)
+ if (mpToolBar)
{
OSL_ASSERT(mpToolBar->GetPresenterController().is());
OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is());
@@ -1210,7 +1210,7 @@ bool Element::SetState (
if (bClicked && mbIsEnabled)
{
- if (mpMode.get() != nullptr)
+ if (mpMode)
{
do
{
@@ -1266,8 +1266,8 @@ bool Element::IsFilling() const
void Element::UpdateState()
{
- OSL_ASSERT(mpToolBar.get() != nullptr);
- OSL_ASSERT(mpToolBar->GetPresenterController().get() != nullptr);
+ OSL_ASSERT(mpToolBar);
+ OSL_ASSERT(mpToolBar->GetPresenterController());
if (mpMode.get() == nullptr)
return;
@@ -1391,7 +1391,7 @@ Button::Button (
: Element(rpToolBar),
mbIsListenerRegistered(false)
{
- OSL_ASSERT(mpToolBar.get() != nullptr);
+ OSL_ASSERT(mpToolBar);
OSL_ASSERT(mpToolBar->GetPresenterController().is());
OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is());
}
@@ -1404,9 +1404,8 @@ void Button::Initialize()
void Button::disposing()
{
- OSL_ASSERT(mpToolBar.get() != nullptr);
- if (mpToolBar.get() != nullptr
- && mbIsListenerRegistered)
+ OSL_ASSERT(mpToolBar);
+ if (mpToolBar && mbIsListenerRegistered)
{
OSL_ASSERT(mpToolBar->GetPresenterController().is());
OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is());
@@ -1447,7 +1446,7 @@ awt::Size Button::CreateBoundingSize (
sal_Int32 nTextHeight (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1));
sal_Int32 nTextWidth (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.X2 - aTextBBox.X1));
Reference<rendering::XBitmap> xBitmap;
- if (mpMode->mpIcon.get() != nullptr)
+ if (mpMode->mpIcon)
xBitmap = mpMode->mpIcon->GetNormalBitmap();
if (xBitmap.is())
{
@@ -1544,7 +1543,7 @@ awt::Size Label::CreateBoundingSize (
void Label::SetText (const OUString& rsText)
{
- OSL_ASSERT(mpToolBar.get() != nullptr);
+ OSL_ASSERT(mpToolBar);
if (mpMode.get() == nullptr)
return;
@@ -1655,7 +1654,7 @@ void Text::Paint (
geometry::RealRectangle2D Text::GetBoundingBox (const Reference<rendering::XCanvas>& rxCanvas)
{
- if (mpFont.get() != nullptr && !msText.isEmpty())
+ if (mpFont && !msText.isEmpty())
{
if ( ! mpFont->mxFont.is())
mpFont->PrepareFont(rxCanvas);
@@ -1853,10 +1852,10 @@ void VerticalSeparator::Paint (
nullptr,
Sequence<double>(4),
rendering::CompositeOperation::OVER);
- if (mpMode.get() != nullptr)
+ if (mpMode)
{
PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont());
- if (pFont.get() != nullptr)
+ if (pFont)
PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor);
}
@@ -1898,10 +1897,10 @@ void HorizontalSeparator::Paint (
nullptr,
Sequence<double>(4),
rendering::CompositeOperation::OVER);
- if (mpMode.get() != nullptr)
+ if (mpMode)
{
PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont());
- if (pFont.get() != nullptr)
+ if (pFont)
PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor);
}
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index d8c2cfbe7667..c141b920d91e 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -208,7 +208,7 @@ Reference<XResource> SAL_CALL PresenterViewFactory::createResource (
// Activate the view.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor()));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pDescriptor->SetActivationState(true);
}
@@ -226,7 +226,7 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference<XResource>&
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId(
rxView->getResourceId()->getAnchor()));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
pDescriptor->SetActivationState(false);
// Dispose only views that we can not put into the cache.
diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx
index 0a4479882050..7b01ac83a53a 100644
--- a/sdext/source/presenter/PresenterWindowManager.cxx
+++ b/sdext/source/presenter/PresenterWindowManager.cxx
@@ -152,8 +152,8 @@ void PresenterWindowManager::NotifyViewCreation (const Reference<XView>& rxView)
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindPaneId(rxView->getResourceId()->getAnchor()));
- OSL_ASSERT(pDescriptor.get() != nullptr);
- if (pDescriptor.get() != nullptr)
+ OSL_ASSERT(pDescriptor);
+ if (pDescriptor)
{
Layout();
@@ -173,7 +173,7 @@ void PresenterWindowManager::SetPanePosSizeAbsolute (
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindPaneURL(rsPaneURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
if (pDescriptor->mxBorderWindow.is())
pDescriptor->mxBorderWindow->setPosSize(
@@ -357,7 +357,7 @@ void PresenterWindowManager::PaintChildren (const awt::PaintEvent& rEvent) const
void PresenterWindowManager::SetLayoutMode (const LayoutMode eMode)
{
- OSL_ASSERT(mpPresenterController.get() != nullptr);
+ OSL_ASSERT(mpPresenterController);
if (meLayoutMode == eMode
&& !mbIsSlideSorterActive
@@ -581,7 +581,7 @@ void PresenterWindowManager::LayoutStandardMode()
// go over the inner pane size.
PresenterPaneContainer::SharedPaneDescriptor pPane (
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL));
- if (pPane.get() != nullptr)
+ if (pPane)
{
const awt::Size aCurrentSlideOuterBox(CalculatePaneSize(
nHorizontalSlideDivide - 1.5*nGap,
@@ -603,7 +603,7 @@ void PresenterWindowManager::LayoutStandardMode()
// width. This takes into account the slide aspect ratio and thus has to
// go over the inner pane size.
pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNextSlidePreviewPaneURL);
- if (pPane.get() != nullptr)
+ if (pPane)
{
const awt::Size aNextSlideOuterBox (CalculatePaneSize(
aBox.Width - nHorizontalSlideDivide - 1.5*nGap,
@@ -642,7 +642,7 @@ void PresenterWindowManager::LayoutNotesMode()
// The notes view has no fixed aspect ratio.
PresenterPaneContainer::SharedPaneDescriptor pPane (
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNotesPaneURL));
- if (pPane.get() != nullptr)
+ if (pPane)
{
const geometry::RealSize2D aNotesViewOuterSize(
nPrimaryWidth - 1.5*nGap + 0.5,
@@ -666,7 +666,7 @@ void PresenterWindowManager::LayoutNotesMode()
// width. This takes into account the slide aspect ratio and thus has to
// go over the inner pane size.
pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL);
- if (pPane.get() != nullptr)
+ if (pPane)
{
const awt::Size aCurrentSlideOuterBox(CalculatePaneSize(
nSecondaryWidth - 1.5*nGap,
@@ -745,7 +745,7 @@ geometry::RealRectangle2D PresenterWindowManager::LayoutToolBar()
// Get access to the tool bar.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msToolBarPaneURL));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
PresenterToolBarView* pToolBarView
= dynamic_cast<PresenterToolBarView*>(pDescriptor->mxView.get());
@@ -871,7 +871,7 @@ void PresenterWindowManager::UpdateWindowSize (const Reference<awt::XWindow>& rx
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindBorderWindow(rxBorderWindow));
- if (pDescriptor.get() != nullptr)
+ if (pDescriptor)
{
mxClipPolygon = nullptr;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 08606a83f9dc..378a7c47832d 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -660,7 +660,7 @@ void SidebarController::CreateDeck(const OUString& rDeckId, const Context& rCont
VclPtr<Deck> aDeck = xDeckDescriptor->mpDeck;
if (aDeck.get()==nullptr || bForceCreate)
{
- if (aDeck.get()!=nullptr)
+ if (aDeck)
aDeck.disposeAndClear();
aDeck = VclPtr<Deck>::Create(
@@ -723,7 +723,7 @@ void SidebarController::CreatePanels(const OUString& rDeckId, const Context& rCo
rPanelContexDescriptor.mbIsInitiallyVisible,
rContext,
pDeck);
- if (aPanel.get()!=nullptr )
+ if (aPanel )
{
aNewPanels[nWriteIndex] = aPanel;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 4db985c961d9..a2d6e6823bf6 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -117,7 +117,7 @@ SfxPrinterController::SfxPrinterController( const VclPtr<Printer>& i_rPrinter,
, m_bOrigStatus( false )
, m_bNeedsChange( false )
, m_bApi(i_bApi)
- , m_bTempPrinter( i_rPrinter.get() != nullptr )
+ , m_bTempPrinter( i_rPrinter )
{
if ( mpViewShell )
{
diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx
index 8319856c1154..5a784a7fe7d0 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -207,7 +207,7 @@ bool EffectRewinder::rewind (
if (mpAsynchronousRewindEvent)
mrEventQueue.addEvent(mpAsynchronousRewindEvent);
- return mpAsynchronousRewindEvent.get()!=nullptr;
+ return bool(mpAsynchronousRewindEvent);
}
diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx
index 5ed44f0efd44..6094fa43bf89 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -111,7 +111,7 @@ namespace slideshow::internal
<< " with delay " << rEvent->getActivationTime(0.0)
);
- ENSURE_OR_RETURN_FALSE( rEvent.get() != nullptr,
+ ENSURE_OR_RETURN_FALSE( rEvent,
"EventQueue::addEvent: event ptr NULL" );
maNextEvents.emplace_back( rEvent, rEvent->getActivationTime(
mpTimer->getElapsedTime()) );
@@ -128,9 +128,7 @@ namespace slideshow::internal
<< " with delay " << rpEvent->getActivationTime(0.0)
);
- ENSURE_OR_RETURN_FALSE(
- rpEvent.get() != nullptr,
- "EventQueue::addEvent: event ptr NULL");
+ ENSURE_OR_RETURN_FALSE( rpEvent, "EventQueue::addEvent: event ptr NULL");
maNextNextEvents.push(
EventEntry(
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index a5245de7380e..7829ae1c4a79 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -423,7 +423,7 @@ public:
std::shared_ptr<PageData> tmp (rxAllocator->construct<T>(), PageData::Deallocate(rxAllocator));
m_xPage.swap (tmp);
}
- return (m_xPage.get() != nullptr);
+ return bool(m_xPage);
}
explicit PageHolderObject (std::shared_ptr<PageData> const & rxPage = std::shared_ptr<PageData>())
@@ -448,7 +448,7 @@ public:
bool is() const
{
- return (m_xPage.get() != nullptr);
+ return bool(m_xPage);
}
std::shared_ptr<PageData> & get() { return m_xPage; }
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index db0ee8d4242b..1d62ed6fb550 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -449,7 +449,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
DoesStyleMatchStyleSheetPredicate predicate(this);
rtl::Reference< SfxStyleSheetBase > ref =
pBasePool->pImpl->mxIndexedStyleSheets->GetNthStyleSheetThatMatchesPredicate(nIdx, predicate);
- if (ref.get() != nullptr)
+ if (ref)
{
nCurrentPosition = pBasePool->pImpl->mxIndexedStyleSheets->FindStyleSheetPosition(*ref);
retval = ref.get();
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index e9e725149020..1046363849b9 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -159,7 +159,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
// do we have a handle column?
bool bHandleCol = !mvCols.empty() && (0 == mvCols[ 0 ]->GetId());
// do we have a header bar?
- bool bHeaderBar = (nullptr != pDataWin->pHeaderBar.get());
+ bool bHeaderBar(pDataWin->pHeaderBar);
if ( nTitleLines
&& ( !bHeaderBar
@@ -552,7 +552,7 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
BrowserColumn *pFirstCol = mvCols[ 0 ].get();
bool bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
- bool bHeaderBar = pDataWin->pHeaderBar.get() != nullptr;
+ bool bHeaderBar(pDataWin->pHeaderBar);
// draw delimitational lines
if (!pDataWin->bNoHScroll)
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 6670f1182121..270a0ee343ff 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2108,7 +2108,7 @@ bool TabBar::StartEditMode(sal_uInt16 nPageId)
bool TabBar::IsInEditMode() const
{
- return mpImpl->mpEdit.get() != nullptr;
+ return bool(mpImpl->mpEdit);
}
void TabBar::EndEditMode(bool bCancel)
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 4d97fd7f6bab..ec7ec7603c64 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -812,7 +812,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
}
while (!bDone);
- if (pEndOfCellInfo.get() != nullptr)
+ if (pEndOfCellInfo)
{
pEndOfCellInfo->setEndOfCell(true);
@@ -917,7 +917,7 @@ const SwNode * WW8TableInfo::getNextNode(const SwNode * pNode)
WW8TableNodeInfo::Pointer_t pNodeInfo = getTableNodeInfo(pNode);
- if (pNodeInfo.get() != nullptr)
+ if (pNodeInfo)
{
WW8TableNodeInfo * pNextInfo = pNodeInfo->getNext();
@@ -1153,7 +1153,7 @@ void WW8TableCellGrid::addShadowCells()
}
WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt);
- if (pRow.get() != nullptr)
+ if (pRow)
pRow->setRowSpans(pRowSpans);
++aTopsIt;
@@ -1322,7 +1322,7 @@ std::string WW8TableCellGrid::toString()
}
RowSpansPtr pRowSpans = pRow->getRowSpans();
- if (pRowSpans.get() != nullptr)
+ if (pRowSpans)
{
sResult += "<rowspans>";
@@ -1358,7 +1358,7 @@ TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow
WW8TableCellGridRow::Pointer_t pRow =
getRow(pNodeInfoInner->getRect().Top(), false);
- if (pRow.get() != nullptr)
+ if (pRow)
{
pResult = pRow->getTableBoxVector();
}
@@ -1374,7 +1374,7 @@ WidthsPtr WW8TableCellGrid::getWidthsOfRow
WW8TableCellGridRow::Pointer_t pRow =
getRow(pNodeInfoInner->getRect().Top(), false);
- if (pRow.get() != nullptr)
+ if (pRow)
{
pResult = pRow->getWidths();
}
@@ -1390,7 +1390,7 @@ RowSpansPtr WW8TableCellGrid::getRowSpansOfRow
WW8TableCellGridRow::Pointer_t pRow =
getRow(pNodeInfoInner->getRect().Top(), false);
- if (pRow.get() != nullptr)
+ if (pRow)
{
pResult = pRow->getRowSpans();
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index bec214a2830e..b66745241dd9 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1840,7 +1840,7 @@ void WW8AttributeOutput::FormatDrop( const SwTextNode& rNode, const SwFormatDrop
m_rWW8Export.WriteCR( pTextNodeInfoInner );
- if ( pTextNodeInfo.get() != nullptr )
+ if ( pTextNodeInfo )
{
#ifdef DBG_UTIL
SAL_INFO( "sw.ww8", pTextNodeInfo->toString());
@@ -2294,7 +2294,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
sal_Int32 nOpenAttrWithRange = 0;
ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
- if ( pTextNodeInfo.get() != nullptr )
+ if ( pTextNodeInfo )
{
pTextNodeInfoInner = pTextNodeInfo->getFirstInner();
}
@@ -2729,7 +2729,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
if ( m_pParentFrame && IsInTable() ) // Fly-Attrs
OutputFormat( m_pParentFrame->GetFrameFormat(), false, false, true );
- if ( pTextNodeInfo.get() != nullptr )
+ if ( pTextNodeInfo )
{
#ifdef DBG_UTIL
SAL_INFO( "sw.ww8", pTextNodeInfo->toString());
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c3fe9c0a36f9..6bdab61a8e9e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1881,7 +1881,7 @@ void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt,
void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- if (pTableTextNodeInfoInner.get() != nullptr && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
+ if (pTableTextNodeInfoInner && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
WriteChar('\007');
else
WriteChar( '\015' );
@@ -2952,11 +2952,11 @@ bool MSWordExportBase::IsInTable() const
{
SwNode& rNode = m_pCurPam->GetNode();
- if (m_pTableInfo.get() != nullptr)
+ if (m_pTableInfo)
{
ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = m_pTableInfo->getTableNodeInfo(&rNode);
- if (pTableNodeInfo.get() != nullptr && pTableNodeInfo->getDepth() > 0)
+ if (pTableNodeInfo && pTableNodeInfo->getDepth() > 0)
{
bResult = true;
}
@@ -4391,7 +4391,7 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode)
ww8::WW8TableNodeInfo::Pointer_t pNodeInfo =
m_pTableInfo->getTableNodeInfo( &rNode );
- if (pNodeInfo.get() != nullptr)
+ if (pNodeInfo)
{
#ifdef DBG_UTIL
SAL_INFO( "sw.ww8", pNodeInfo->toString());
@@ -4418,7 +4418,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = m_pTableInfo->getTableNodeInfo( &rNode );
- if (pNodeInfo.get() != nullptr)
+ if (pNodeInfo)
{
#ifdef DBG_UTIL
SAL_INFO( "sw.ww8", pNodeInfo->toString());
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 4b913d9fa576..b11d85931a77 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -999,7 +999,7 @@ void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTe
mbOnTOXEnding = false;
m_rWW8Export.pO->clear();
- if ( pTextNodeInfoInner.get() != nullptr )
+ if ( pTextNodeInfoInner )
{
if ( pTextNodeInfoInner->isEndOfLine() )
{
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index a4a3f5d9e3d2..078fb3266623 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -83,7 +83,7 @@ void LifecycleTest::testVirtualDevice()
void LifecycleTest::testMultiDispose()
{
VclPtrInstance<WorkWindow> xWin(nullptr, WB_APP|WB_STDWORK);
- CPPUNIT_ASSERT(xWin.get() != nullptr);
+ CPPUNIT_ASSERT(xWin);
xWin->disposeOnce();
xWin->disposeOnce();
xWin->disposeOnce();
@@ -141,7 +141,7 @@ void LifecycleTest::testIsolatedWidgets()
void LifecycleTest::testParentedWidgets()
{
ScopedVclPtrInstance<WorkWindow> xWin(nullptr, WB_APP|WB_STDWORK);
- CPPUNIT_ASSERT(xWin.get() != nullptr);
+ CPPUNIT_ASSERT(xWin);
xWin->Show();
testWidgets(xWin);
}
@@ -163,7 +163,7 @@ public:
void LifecycleTest::testChildDispose()
{
VclPtrInstance<WorkWindow> xWin(nullptr, WB_APP|WB_STDWORK);
- CPPUNIT_ASSERT(xWin.get() != nullptr);
+ CPPUNIT_ASSERT(xWin);
VclPtrInstance< DisposableChild > xChild( xWin.get() );
xWin->Show();
xChild->disposeOnce();
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 4c7ee7b964d0..4d483d943dc0 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1041,7 +1041,7 @@ IMPL_LINK( TabControl, ImplWindowEventListener, VclWindowEvent&, rEvent, void )
void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
{
- if (mpTabCtrlData->mpListBox.get() != nullptr || !rMEvt.IsLeft())
+ if (mpTabCtrlData->mpListBox || !rMEvt.IsLeft())
return;
ImplTabItem *pItem = ImplGetItem(rMEvt.GetPosPixel());
diff --git a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
index ab011d9d0925..2442e6ab665d 100644
--- a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx
@@ -788,7 +788,7 @@ ensureTypeFor( uno::XInterface *pAccessible )
AtkObject *
atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
{
- g_return_val_if_fail( rxAccessible.get() != nullptr, nullptr );
+ g_return_val_if_fail( bool(rxAccessible), nullptr );
AtkObject *obj = ooo_wrapper_registry_get(rxAccessible);
if( obj )
@@ -807,14 +807,14 @@ AtkObject *
atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessible >& rxAccessible,
AtkObject* parent, AtkObject* orig )
{
- g_return_val_if_fail( rxAccessible.get() != nullptr, nullptr );
+ g_return_val_if_fail( bool(rxAccessible), nullptr );
AtkObjectWrapper *pWrap = nullptr;
try {
uno::Reference< accessibility::XAccessibleContext > xContext(rxAccessible->getAccessibleContext());
- g_return_val_if_fail( xContext.get() != nullptr, nullptr );
+ g_return_val_if_fail( bool(xContext), nullptr );
GType nType = ensureTypeFor( xContext.get() );
gpointer obj = g_object_new( nType, nullptr);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 475e7d9b5f77..0511b6677ba2 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2508,7 +2508,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case NS_ooxml::LN_ffdata:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
{
FFDataHandler::Pointer_t pFFDataHandler(new FFDataHandler());
@@ -2522,14 +2522,14 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
{
m_pImpl->m_pSdtHelper->setInsideDropDownControl(true);
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
}
break;
case NS_ooxml::LN_CT_SdtDropDownList_listItem:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
}
break;
@@ -2590,7 +2590,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
// process subitems
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
if (nSprmId == NS_ooxml::LN_CT_SdtPr_alias)
@@ -2879,21 +2879,21 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case NS_ooxml::LN_CT_DocPartPr_name:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
}
break;
case NS_ooxml::LN_CT_DocPartPr_category:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
}
break;
case NS_ooxml::LN_CT_DocPartCategory_gallery:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get() != nullptr)
+ if (pProperties)
pProperties->resolve(*this);
}
break;
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index dd5a14b732eb..a42478a2b0df 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -87,7 +87,7 @@ void DomainMapperTableHandler::startTable(const TablePropertyMapPtr& pProps)
#ifdef DBG_UTIL
TagLogger::getInstance().startElement("tablehandler.table");
- if (pProps.get() != nullptr)
+ if (pProps)
pProps->dumpXml();
#endif
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 915b317d40d5..d0f46d312128 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -127,7 +127,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
bRet = true;
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
- sal_Int32 nIntValue = ((pValue.get() != nullptr) ? pValue->getInt() : 0);
+ sal_Int32 nIntValue = (pValue ? pValue->getInt() : 0);
switch ( nSprmId )
{
case NS_ooxml::LN_CT_TblPrBase_tblW:
@@ -514,7 +514,7 @@ void DomainMapperTableManager::endLevel( )
#ifdef DBG_UTIL
TagLogger::getInstance().startElement("dmappertablemanager.endLevel");
PropertyMapPtr pProps = getTableProps().get();
- if (pProps.get() != nullptr)
+ if (pProps)
getTableProps()->dumpXml();
TagLogger::getInstance().endElement();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index fb58e1b9567b..18fb4fa3d982 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5957,7 +5957,7 @@ void DomainMapper_Impl::PopFieldContext()
else
{
FormControlHelper::Pointer_t pFormControlHelper(pContext->getFormControlHelper());
- if (pFormControlHelper.get() != nullptr)
+ if (pFormControlHelper)
{
uno::Reference< text::XFormField > xFormField( pContext->GetFormField() );
assert(xCrsr.is());
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 73333b23e790..5155e2f61211 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1386,7 +1386,7 @@ uno::Reference<text::XTextContent> GraphicImport::createGraphicObject(uno::Refer
//there seems to be no way to detect the original size via _real_ API
uno::Reference< beans::XPropertySet > xGraphicProperties(rxGraphic, uno::UNO_QUERY_THROW);
- if (m_pImpl->mpWrapPolygon.get() != nullptr)
+ if (m_pImpl->mpWrapPolygon)
{
uno::Any aContourPolyPolygon;
awt::Size aGraphicSize;
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index d03be9cba324..80a0df186407 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1018,7 +1018,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
//TODO: Handle cases where a paragraph <> character style relation is needed
StyleSheetEntryPtr pParent = FindStyleSheetByISTD( pEntry->sBaseStyleIdentifier );
// Writer core doesn't support numbering styles having a parent style, it seems
- if (pParent.get() != nullptr && !bListStyle)
+ if (pParent && !bListStyle)
{
const OUString sParentStyleName = ConvertStyleName( pParent->sStyleName );
if ( !sParentStyleName.isEmpty() && !xStyles->hasByName( sParentStyleName ) )
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index abce3a1e6b14..a0185eaa735a 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -54,7 +54,7 @@ namespace writerfilter::dmapper {
bool bRet = true;
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
- sal_Int32 nIntValue = ((pValue.get() != nullptr) ? pValue->getInt() : 0);
+ sal_Int32 nIntValue = (pValue ? pValue->getInt() : 0);
switch( nSprmId )
{
case NS_ooxml::LN_CT_TrPrBase_jc:
diff --git a/writerfilter/source/ooxml/Handler.cxx b/writerfilter/source/ooxml/Handler.cxx
index c582b71aba82..92c74e78e63a 100644
--- a/writerfilter/source/ooxml/Handler.cxx
+++ b/writerfilter/source/ooxml/Handler.cxx
@@ -299,7 +299,7 @@ void OOXMLPictureHandler::attribute(Id name, Value & val)
{
writerfilter::Reference<Properties>::Pointer_t pProps
(val.getProperties());
- if (pProps.get() != nullptr)
+ if (pProps)
pProps->resolve(*this);
}
}
@@ -309,7 +309,7 @@ void OOXMLPictureHandler::sprm(Sprm & rSprm)
writerfilter::Reference<Properties>::Pointer_t pProps
(rSprm.getProps());
- if (pProps.get() != nullptr)
+ if (pProps)
pProps->resolve(*this);
}
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index 6bc7a10e8df1..9c2c51c36a2c 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -167,7 +167,7 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
- if (pFactory.get() != nullptr)
+ if (pFactory)
{
pFactory->charactersAction(pHandler, rString);
}
@@ -178,7 +178,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler)
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
- if (pFactory.get() != nullptr)
+ if (pFactory)
{
pFactory->startAction(pHandler);
}
@@ -189,7 +189,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler)
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
- if (pFactory.get() != nullptr)
+ if (pFactory)
{
pFactory->endAction(pHandler);
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 6a31e6b69a97..42888678f98e 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -877,7 +877,7 @@ void OOXMLFastContextHandler::sendPropertyToParent()
{
OOXMLPropertySet::Pointer_t pProps(mpParent->getPropertySet());
- if (pProps.get() != nullptr)
+ if (pProps)
{
pProps->add(mId, getValue(), OOXMLProperty::SPRM);
}
@@ -890,11 +890,11 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
{
OOXMLPropertySet::Pointer_t pParentProps(mpParent->getPropertySet());
- if (pParentProps.get() != nullptr)
+ if (pParentProps)
{
OOXMLPropertySet::Pointer_t pProps(getPropertySet());
- if (pProps.get() != nullptr)
+ if (pProps)
{
OOXMLValue::Pointer_t pValue
(new OOXMLPropertySetValue(getPropertySet()));
@@ -1123,7 +1123,7 @@ void OOXMLFastContextHandlerProperties::handleHyperlinkURL() {
void OOXMLFastContextHandlerProperties::setPropertySet
(const OOXMLPropertySet::Pointer_t& pPropertySet)
{
- if (pPropertySet.get() != nullptr)
+ if (pPropertySet)
mpPropertySet = pPropertySet;
}
@@ -1289,7 +1289,7 @@ void OOXMLFastContextHandlerTable::addCurrentChild()
{
OOXMLValue::Pointer_t pValue(pHandler->getValue());
- if (pValue.get() != nullptr)
+ if (pValue)
{
OOXMLTable::ValuePointer_t pTmpVal(pValue->clone());
mTable.add(pTmpVal);
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index 576e97c8ce7a..bab418a2f2ff 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -110,7 +110,7 @@ const OUString & OOXMLParserState::getTarget() const
void OOXMLParserState::resolveCharacterProperties(Stream & rStream)
{
- if (mpCharacterProps.get() != nullptr)
+ if (mpCharacterProps)
{
rStream.props(mpCharacterProps.get());
mpCharacterProps = new OOXMLPropertySet;
@@ -157,7 +157,7 @@ void OOXMLParserState::resolveCellProperties(Stream & rStream)
{
OOXMLPropertySet::Pointer_t & rCellProps = mCellProps.top();
- if (rCellProps.get() != nullptr)
+ if (rCellProps)
{
rStream.props(rCellProps.get());
rCellProps = new OOXMLPropertySet;
@@ -171,7 +171,7 @@ void OOXMLParserState::resolveRowProperties(Stream & rStream)
{
OOXMLPropertySet::Pointer_t & rRowProps = mRowProps.top();
- if (rRowProps.get() != nullptr)
+ if (rRowProps)
{
rStream.props(rRowProps.get());
rRowProps = new OOXMLPropertySet;
@@ -185,7 +185,7 @@ void OOXMLParserState::resolveTableProperties(Stream & rStream)
{
OOXMLPropertySet::Pointer_t & rTableProps = mTableProps.top();
- if (rTableProps.get() != nullptr)
+ if (rTableProps)
{
rStream.props(rTableProps.get());
// Don't clean the table props to send them again for each row
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index b8071011422b..e7e1c8d581c9 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -49,7 +49,7 @@ Value::Pointer_t OOXMLProperty::getValue()
{
Value::Pointer_t pResult;
- if (mpValue.get() != nullptr)
+ if (mpValue)
pResult = Value::Pointer_t(mpValue->clone());
else
pResult = Value::Pointer_t(new OOXMLValue());
@@ -61,7 +61,7 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLProperty::getProps()
{
writerfilter::Reference<Properties>::Pointer_t pResult;
- if (mpValue.get() != nullptr)
+ if (mpValue)
pResult = mpValue->getProperties();
return pResult;
@@ -94,7 +94,7 @@ string OOXMLProperty::toString() const
sResult += getName();
sResult += ", ";
- if (mpValue.get() != nullptr)
+ if (mpValue)
sResult += mpValue->toString();
else
sResult +="(null)";
@@ -341,7 +341,7 @@ void OOXMLPropertySet::resolve(Properties & rHandler)
{
OOXMLProperty::Pointer_t pProp = mProperties[nIt];
- if (pProp.get() != nullptr)
+ if (pProp)
pProp->resolve(rHandler);
}
}
@@ -370,7 +370,7 @@ OOXMLPropertySet::end() const
void OOXMLPropertySet::add(const OOXMLProperty::Pointer_t& pProperty)
{
- if (pProperty.get() != nullptr && pProperty->getId() != 0x0)
+ if (pProperty && pProperty->getId() != 0x0)
{
mProperties.push_back(pProperty);
}
@@ -416,7 +416,7 @@ string OOXMLPropertySet::toString()
if (aIt != aItBegin)
sResult += ", ";
- if ((*aIt).get() != nullptr)
+ if (*aIt)
sResult += (*aIt)->toString();
else
sResult += "0x0";
@@ -772,7 +772,7 @@ void OOXMLTable::resolve(Table & rTable)
writerfilter::Reference<Properties>::Pointer_t pProperties
(rPropSet->getProperties());
- if (pProperties.get() != nullptr)
+ if (pProperties)
pTable->entry(nPos, pProperties);
++nPos;
@@ -781,7 +781,7 @@ void OOXMLTable::resolve(Table & rTable)
void OOXMLTable::add(const ValuePointer_t& pPropertySet)
{
- if (pPropertySet.get() != nullptr)
+ if (pPropertySet)
mPropertySets.push_back(pPropertySet);
}