diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-16 15:23:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-17 08:25:47 +0200 |
commit | ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch) | |
tree | 2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /sdext | |
parent | da5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff) |
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer
Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd
Reviewed-on: https://gerrit.libreoffice.org/61837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterBitmapContainer.cxx | 4 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterButton.cxx | 4 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 8 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterNotesView.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterPaneBase.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterPaneBorderPainter.cxx | 35 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterPaneFactory.cxx | 6 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterProtocolHandler.cxx | 6 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterScrollBar.cxx | 6 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideShowView.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideSorter.cxx | 16 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterTheme.cxx | 68 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterTimer.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterToolBar.cxx | 23 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterViewFactory.cxx | 6 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterWindowManager.cxx | 4 |
16 files changed, 91 insertions, 103 deletions
diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx index ea39f17e2588..d9d9b90c1f3a 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -106,7 +106,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::GetBitmap ( BitmapContainer::const_iterator iSet (maIconContainer.find(rsName)); if (iSet != maIconContainer.end()) return iSet->second; - else if (mpParentContainer.get() != nullptr) + else if (mpParentContainer != nullptr) return mpParentContainer->GetBitmap(rsName); else return SharedBitmapDescriptor(); @@ -317,7 +317,7 @@ PresenterBitmapContainer::BitmapDescriptor::BitmapDescriptor ( mxDisabledBitmap(), mxMaskBitmap() { - if (rpDefault.get() != nullptr) + if (rpDefault != nullptr) { mnWidth = rpDefault->mnWidth; mnHeight = rpDefault->mnHeight; diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index 7b7232b04e1a..e24ee663f44e 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -57,11 +57,11 @@ const static double gnVerticalBorder (5); PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= sAction; PresenterTheme::SharedFontDescriptor pFont; - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) pFont = rpTheme->GetFont("ButtonFont"); PresenterTheme::SharedFontDescriptor pMouseOverFont; - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) pMouseOverFont = rpTheme->GetFont("ButtonMouseOverFont"); rtl::Reference<PresenterButton> pButton ( diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 6b348dd40b76..dd00b3955e64 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -364,7 +364,7 @@ void PresenterController::UpdatePaneTitles() PresenterPaneContainer::PaneList::const_iterator iPane; for (iPane=mpPaneContainer->maPanes.begin(); iPane!=mpPaneContainer->maPanes.end(); ++iPane) { - OSL_ASSERT((*iPane).get() != nullptr); + OSL_ASSERT(*iPane != nullptr); OUString sTemplate (IsAccessibilityActive() ? (*iPane)->msAccessibleTitleTemplate @@ -427,7 +427,7 @@ void PresenterController::UpdateViews() SharedBitmapDescriptor PresenterController::GetViewBackground (const OUString& rsViewURL) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); return mpTheme->GetBitmap(sStyleName, "Background"); @@ -438,7 +438,7 @@ SharedBitmapDescriptor PresenterTheme::SharedFontDescriptor PresenterController::GetViewFont (const OUString& rsViewURL) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); return mpTheme->GetFont(sStyleName); @@ -1150,7 +1150,7 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid { mnPendingSlideNumber = nPendingSlideNumber; - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) return; if ( ! mxMainWindow.is()) diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 3413d4349dfa..20c1525d7565 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -630,7 +630,7 @@ void PresenterNotesView::ChangeFontSize (const sal_Int32 nSizeChange) std::shared_ptr<PresenterConfigurationAccess> pConfiguration ( mpPresenterController->GetTheme()->GetNodeForViewStyle( sStyleName)); - if (pConfiguration.get()==nullptr || ! pConfiguration->IsValid()) + if (pConfiguration == nullptr || !pConfiguration->IsValid()) return; pConfiguration->GoToChild(OUString("Font")); diff --git a/sdext/source/presenter/PresenterPaneBase.cxx b/sdext/source/presenter/PresenterPaneBase.cxx index f6174652b103..d8d25218dd9e 100644 --- a/sdext/source/presenter/PresenterPaneBase.cxx +++ b/sdext/source/presenter/PresenterPaneBase.cxx @@ -108,7 +108,7 @@ void PresenterPaneBase::SetTitle (const OUString& rsTitle) msTitle = rsTitle; OSL_ASSERT(mpPresenterController.get()!=nullptr); - OSL_ASSERT(mpPresenterController->GetPaintManager().get()!=nullptr); + OSL_ASSERT(mpPresenterController->GetPaintManager() != nullptr); mpPresenterController->GetPaintManager()->Invalidate(mxBorderWindow); } diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index 5fbad6e5a6e2..551546995b90 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -209,7 +209,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorder ( } ProvideTheme(rxCanvas); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetupClipping( @@ -244,7 +244,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorderWithCallout ( } ProvideTheme(rxCanvas); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetupClipping( @@ -265,12 +265,11 @@ awt::Point SAL_CALL PresenterPaneBorderPainter::getCalloutOffset ( { ThrowIfDisposed(); ProvideTheme(); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle( mpRenderer->GetRendererPaneStyle(rsPaneBorderStyleName)); - if (pRendererPaneStyle.get() != nullptr - && pRendererPaneStyle->mpBottomCallout.get() != nullptr) + if (pRendererPaneStyle != nullptr && pRendererPaneStyle->mpBottomCallout.get() != nullptr) { return awt::Point ( 0, @@ -290,7 +289,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva if ( ! mxContext.is()) return false; - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { // Check if the theme already has a canvas. if ( ! mpTheme->HasCanvas()) @@ -305,9 +304,9 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva bModified = true; } - if (mpTheme.get() != nullptr && bModified) + if (mpTheme != nullptr && bModified) { - if (mpRenderer.get() == nullptr) + if (mpRenderer == nullptr) mpRenderer.reset(new Renderer(mxContext, mpTheme)); else mpRenderer->SetCanvas(rxCanvas); @@ -318,7 +317,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva void PresenterPaneBorderPainter::ProvideTheme() { - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) { // Create a theme without bitmaps (no canvas => no bitmaps). ProvideTheme(nullptr); @@ -330,7 +329,7 @@ void PresenterPaneBorderPainter::ProvideTheme() void PresenterPaneBorderPainter::SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme) { mpTheme = rpTheme; - if (mpRenderer.get() == nullptr) + if (mpRenderer == nullptr) mpRenderer.reset(new Renderer(mxContext, mpTheme)); } @@ -339,10 +338,10 @@ awt::Rectangle PresenterPaneBorderPainter::AddBorder ( const awt::Rectangle& rInnerBox, const css::drawing::framework::BorderType eBorderType) const { - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); - if (pRendererPaneStyle.get() != nullptr) + if (pRendererPaneStyle != nullptr) return pRendererPaneStyle->AddBorder(rInnerBox, eBorderType); } return rInnerBox; @@ -353,10 +352,10 @@ awt::Rectangle PresenterPaneBorderPainter::RemoveBorder ( const css::awt::Rectangle& rOuterBox, const css::drawing::framework::BorderType eBorderType) const { - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); - if (pRendererPaneStyle.get() != nullptr) + if (pRendererPaneStyle != nullptr) return pRendererPaneStyle->RemoveBorder(rOuterBox, eBorderType); } return rOuterBox; @@ -416,7 +415,7 @@ void PresenterPaneBorderPainter::Renderer::PaintBorder ( // Create the outer and inner border of the, ahm, border. std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneURL)); - if (pStyle.get() == nullptr) + if (pStyle == nullptr) return; awt::Rectangle aOuterBox (rBBox); @@ -560,7 +559,7 @@ void PresenterPaneBorderPainter::Renderer::PaintTitle ( std::shared_ptr<RendererPaneStyle> PresenterPaneBorderPainter::Renderer::GetRendererPaneStyle (const OUString& rsResourceURL) { - OSL_ASSERT(mpTheme.get()!=nullptr); + OSL_ASSERT(mpTheme != nullptr); RendererPaneStyleContainer::const_iterator iStyle (maRendererPaneStyles.find(rsResourceURL)); if (iStyle == maRendererPaneStyles.end()) @@ -708,7 +707,7 @@ void PresenterPaneBorderPainter::Renderer::SetupClipping ( return; std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneStyleName)); - if (pStyle.get() == nullptr) + if (pStyle == nullptr) { mxViewStateClip = PresenterGeometryHelper::CreatePolygon( rUpdateBox, @@ -765,7 +764,7 @@ RendererPaneStyle::RendererPaneStyle ( maOuterBorderSize(), maTotalBorderSize() { - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) { mpTopLeft = GetBitmap(rpTheme, rsStyleName, "TopLeft"); mpTop = GetBitmap(rpTheme, rsStyleName, "Top"); diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index 94f6335cdd79..8160b9431745 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -119,7 +119,7 @@ void SAL_CALL PresenterPaneFactory::disposing() mxConfigurationControllerWeak = WeakReference<XConfigurationController>(); // Dispose the panes in the cache. - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { ResourceContainer::const_iterator iPane (mpResourceCache->begin()); ResourceContainer::const_iterator iEnd (mpResourceCache->end()); @@ -147,7 +147,7 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource ( if (sPaneURL.isEmpty()) return nullptr; - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Has the requested resource already been created? ResourceContainer::const_iterator iResource (mpResourceCache->find(sPaneURL)); @@ -194,7 +194,7 @@ void SAL_CALL PresenterPaneFactory::releaseResource (const Reference<XResource>& if (pDescriptor->mxBorderWindow.is()) pDescriptor->mxBorderWindow->setVisible(false); - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Store the pane in the cache. (*mpResourceCache)[sPaneURL] = rxResource; diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 953a7821adf2..f25e7255cd3f 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -341,7 +341,7 @@ Reference<frame::XDispatch> PresenterProtocolHandler::Dispatch::Create ( const ::rtl::Reference<PresenterController>& rpPresenterController) { ::rtl::Reference<Dispatch> pDispatch (new Dispatch (rsURLPath, rpPresenterController)); - if (pDispatch->mpCommand.get() != nullptr) + if (pDispatch->mpCommand != nullptr) return Reference<frame::XDispatch>(pDispatch.get()); else return nullptr; @@ -357,7 +357,7 @@ PresenterProtocolHandler::Dispatch::Dispatch ( maStatusListenerContainer(), mbIsListeningToWindowManager(false) { - if (mpCommand.get() != nullptr) + if (mpCommand != nullptr) { mpPresenterController->GetWindowManager()->AddLayoutListener(this); mbIsListeningToWindowManager = true; @@ -438,7 +438,7 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch( throw RuntimeException(); } - if (mpCommand.get() != nullptr) + if (mpCommand != nullptr) mpCommand->Execute(); } diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index da089fb335ce..52f49706f8fe 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -240,7 +240,7 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx mxCanvas = rxCanvas; if (mxCanvas.is()) { - if (mpBitmaps.get()==nullptr) + if (mpBitmaps == nullptr) { if (mpSharedBitmaps.expired()) { @@ -434,7 +434,7 @@ void PresenterScrollBar::Repaint ( const geometry::RealRectangle2D& rBox, const bool bAsynchronousUpdate) { - if (mpPaintManager.get() != nullptr) + if (mpPaintManager != nullptr) mpPaintManager->Invalidate( mxWindow, PresenterGeometryHelper::ConvertRectangle(rBox), @@ -687,7 +687,7 @@ void PresenterVerticalScrollBar::UpdateBorders() void PresenterVerticalScrollBar::UpdateBitmaps() { - if (mpBitmaps.get() != nullptr) + if (mpBitmaps != nullptr) { mpPrevButtonDescriptor = mpBitmaps->GetBitmap("Up"); mpNextButtonDescriptor = mpBitmaps->GetBitmap("Down"); diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index c4368fa3eb9b..55606ad9b9e9 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -734,7 +734,7 @@ void PresenterSlideShowView::PaintEndSlide (const awt::Rectangle& rRepaintBox) if (mpPresenterController.get() == nullptr) break; std::shared_ptr<PresenterTheme> pTheme (mpPresenterController->GetTheme()); - if (pTheme.get() == nullptr) + if (pTheme == nullptr) break; const OUString sViewStyle (pTheme->GetStyleName(mxViewId->getResourceURL())); diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 210b74087407..ad07a02b4b27 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -309,7 +309,7 @@ PresenterSlideSorter::PresenterSlideSorter ( mxCanvas, "SlideSorterCloser"); - if (mpPresenterController->GetTheme().get() != nullptr) + if (mpPresenterController->GetTheme() != nullptr) { PresenterTheme::SharedFontDescriptor pFont ( mpPresenterController->GetTheme()->GetFont("ButtonFont")); @@ -530,7 +530,7 @@ void SAL_CALL PresenterSlideSorter::mouseEntered (const css::awt::MouseEvent&) { void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent&) { mnSlideIndexMousePressed = -1; - if (mpMouseOverManager.get() != nullptr) + if (mpMouseOverManager != nullptr) mpMouseOverManager->SetSlide(mnSlideIndexMousePressed, awt::Rectangle(0,0,0,0)); } @@ -538,7 +538,7 @@ void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent&) void SAL_CALL PresenterSlideSorter::mouseMoved (const css::awt::MouseEvent& rEvent) { - if (mpMouseOverManager.get() != nullptr) + if (mpMouseOverManager != nullptr) { css::awt::MouseEvent rTemp =rEvent; /// check whether RTL interface or not @@ -591,7 +591,7 @@ void SAL_CALL PresenterSlideSorter::propertyChange ( void SAL_CALL PresenterSlideSorter::notifyPreviewCreation ( sal_Int32 nSlideIndex) { - OSL_ASSERT(mpLayout.get()!=nullptr); + OSL_ASSERT(mpLayout != nullptr); awt::Rectangle aBBox (mpLayout->GetBoundingBox(nSlideIndex)); mpPresenterController->GetPaintManager()->Invalidate(mxWindow, aBBox, true); @@ -886,7 +886,7 @@ void PresenterSlideSorter::PaintPreview ( // Emphasize the current slide. if (nSlideIndex == mnCurrentSlideIndex) { - if (mpCurrentSlideFrameRenderer.get() != nullptr) + if (mpCurrentSlideFrameRenderer != nullptr) { const awt::Rectangle aSlideBoundingBox( sal::static_int_cast<sal_Int32>(0.5 + aTopLeft.X), @@ -1443,10 +1443,10 @@ PresenterSlideSorter::MouseOverManager::MouseOverManager ( mxInvalidateTarget(rxInvalidateTarget), mpPaintManager(rpPaintManager) { - if (rpTheme.get()!=nullptr) + if (rpTheme != nullptr) { std::shared_ptr<PresenterBitmapContainer> pBitmaps (rpTheme->GetBitmapContainer()); - if (pBitmaps.get() != nullptr) + if (pBitmaps != nullptr) { mpLeftLabelBitmap = pBitmaps->GetBitmap("LabelLeft"); mpCenterLabelBitmap = pBitmaps->GetBitmap("LabelCenter"); @@ -1709,7 +1709,7 @@ void PresenterSlideSorter::MouseOverManager::PaintButtonBackground ( void PresenterSlideSorter::MouseOverManager::Invalidate() { - if (mpPaintManager.get() != nullptr) + if (mpPaintManager != nullptr) mpPaintManager->Invalidate(mxInvalidateTarget, maSlideBoundingBox, true); } diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx index 4650a7213c70..6e5270b91432 100644 --- a/sdext/source/presenter/PresenterTheme.cxx +++ b/sdext/source/presenter/PresenterTheme.cxx @@ -290,7 +290,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const { OUString sStyleName; std::shared_ptr<Theme> pTheme (mpTheme); - while (sStyleName.isEmpty() && pTheme.get()!=nullptr) + while (sStyleName.isEmpty() && pTheme != nullptr) { sStyleName = pTheme->maStyleAssociations.GetStyleName(rsResourceURL); pTheme = pTheme->mpParentTheme; @@ -302,7 +302,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const const OUString& rsStyleName, const bool bOuter) const { - OSL_ASSERT(mpTheme.get() != nullptr); + OSL_ASSERT(mpTheme != nullptr); SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) @@ -346,7 +346,7 @@ bool PresenterTheme::ConvertToColor ( std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyle ( const OUString& rsStyleName) const { - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) return std::shared_ptr<PresenterConfigurationAccess>(); // Open configuration for writing. @@ -375,16 +375,16 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( const OUString& rsStyleName, const OUString& rsBitmapName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { if (rsStyleName.isEmpty()) { if (rsBitmapName == "Background") { std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr) + while (pTheme != nullptr && pTheme->mpBackground.get() == nullptr) pTheme = pTheme->mpParentTheme; - if (pTheme.get() != nullptr) + if (pTheme != nullptr) return pTheme->mpBackground; else return SharedBitmapDescriptor(); @@ -416,21 +416,21 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( SharedBitmapDescriptor PresenterTheme::GetBitmap ( const OUString& rsBitmapName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { if (rsBitmapName == "Background") { std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr) + while (pTheme != nullptr && pTheme->mpBackground.get() == nullptr) pTheme = pTheme->mpParentTheme; - if (pTheme.get() != nullptr) + if (pTheme != nullptr) return pTheme->mpBackground; else return SharedBitmapDescriptor(); } else { - if (mpTheme->mpIconContainer.get() != nullptr) + if (mpTheme->mpIconContainer != nullptr) return mpTheme->mpIconContainer->GetBitmap(rsBitmapName); } } @@ -440,7 +440,7 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) return mpTheme->mpIconContainer; else return std::shared_ptr<PresenterBitmapContainer>(); @@ -449,7 +449,7 @@ std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() c PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont ( const OUString& rsStyleName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) @@ -460,7 +460,7 @@ PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont ( return pViewStyle->GetFont(); std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get() != nullptr) + while (pTheme != nullptr) { Theme::FontContainer::const_iterator iFont (pTheme->maFontContainer.find(rsStyleName)); if (iFont != pTheme->maFontContainer.end()) @@ -485,7 +485,7 @@ PresenterTheme::FontDescriptor::FontDescriptor ( mnXOffset(0), mnYOffset(0) { - if (rpDescriptor.get() != nullptr) + if (rpDescriptor != nullptr) { msFamilyName = rpDescriptor->msFamilyName; msStyleName = rpDescriptor->msStyleName; @@ -610,16 +610,12 @@ void PresenterTheme::Theme::Read ( maViewStyles.Read(rReadContext, mxThemeRoot); // Read bitmaps. - mpIconContainer.reset( - new PresenterBitmapContainer( - Reference<container::XNameAccess>( - PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), - UNO_QUERY), - mpParentTheme.get()!=nullptr - ? mpParentTheme->mpIconContainer - : std::shared_ptr<PresenterBitmapContainer>(), - rReadContext.mxComponentContext, - rReadContext.mxCanvas)); + mpIconContainer.reset(new PresenterBitmapContainer( + Reference<container::XNameAccess>( + PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), UNO_QUERY), + mpParentTheme != nullptr ? mpParentTheme->mpIconContainer + : std::shared_ptr<PresenterBitmapContainer>(), + rReadContext.mxComponentContext, rReadContext.mxCanvas)); // Read fonts. Reference<container::XNameAccess> xFontNode( @@ -638,7 +634,7 @@ SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName SharedPaneStyle pPaneStyle (maPaneStyles.GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) return pPaneStyle; - else if (mpParentTheme.get() != nullptr) + else if (mpParentTheme != nullptr) return mpParentTheme->GetPaneStyle(rsStyleName); else return SharedPaneStyle(); @@ -649,7 +645,7 @@ SharedViewStyle PresenterTheme::Theme::GetViewStyle (const OUString& rsStyleName SharedViewStyle pViewStyle (maViewStyles.GetViewStyle(rsStyleName)); if (pViewStyle.get() != nullptr) return pViewStyle; - else if (mpParentTheme.get() != nullptr) + else if (mpParentTheme != nullptr) return mpParentTheme->GetViewStyle(rsStyleName); else return SharedViewStyle(); @@ -786,7 +782,7 @@ std::shared_ptr<PresenterTheme::Theme> ReadContext::ReadTheme ( } } - if (pTheme.get() != nullptr) + if (pTheme != nullptr) { pTheme->Read(rConfiguration, *this); } @@ -873,7 +869,7 @@ void PaneStyleContainer::ProcessPaneStyle( Reference<container::XNameAccess> xOuterBorderSizeNode (rValues[4], UNO_QUERY); pStyle->maOuterBorderSize = ReadContext::ReadBorderSize(xOuterBorderSizeNode); - if (pStyle->mpParentStyle.get() != nullptr) + if (pStyle->mpParentStyle != nullptr) { pStyle->maInnerBorderSize.Merge(pStyle->mpParentStyle->maInnerBorderSize); pStyle->maOuterBorderSize.Merge(pStyle->mpParentStyle->maOuterBorderSize); @@ -884,11 +880,9 @@ void PaneStyleContainer::ProcessPaneStyle( Reference<container::XNameAccess> xBitmapsNode (rValues[5], UNO_QUERY); pStyle->mpBitmaps.reset(new PresenterBitmapContainer( xBitmapsNode, - pStyle->mpParentStyle.get()!=nullptr - ? pStyle->mpParentStyle->mpBitmaps - : std::shared_ptr<PresenterBitmapContainer>(), - rReadContext.mxComponentContext, - rReadContext.mxCanvas, + pStyle->mpParentStyle != nullptr ? pStyle->mpParentStyle->mpBitmaps + : std::shared_ptr<PresenterBitmapContainer>(), + rReadContext.mxComponentContext, rReadContext.mxCanvas, rReadContext.mxPresenterHelper)); } @@ -918,14 +912,14 @@ PaneStyle::PaneStyle() const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const { - if (mpBitmaps.get() != nullptr) + if (mpBitmaps != nullptr) { const SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName); if (pBitmap.get() != nullptr) return pBitmap; } - if (mpParentStyle.get() != nullptr) + if (mpParentStyle != nullptr) return mpParentStyle->GetBitmap(rsBitmapName); else return SharedBitmapDescriptor(); @@ -935,7 +929,7 @@ PresenterTheme::SharedFontDescriptor PaneStyle::GetFont() const { if (mpFont.get() != nullptr) return mpFont; - else if (mpParentStyle.get() != nullptr) + else if (mpParentStyle != nullptr) return mpParentStyle->GetFont(); else return PresenterTheme::SharedFontDescriptor(); @@ -1042,7 +1036,7 @@ PresenterTheme::SharedFontDescriptor ViewStyle::GetFont() const { if (mpFont.get() != nullptr) return mpFont; - else if (mpParentStyle.get() != nullptr) + else if (mpParentStyle != nullptr) return mpParentStyle->GetFont(); else return PresenterTheme::SharedFontDescriptor(); diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 99a0eba3219e..916b6bf168e6 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -187,7 +187,7 @@ std::shared_ptr<TimerScheduler> TimerScheduler::Instance( uno::Reference<uno::XComponentContext> const& xContext) { ::osl::MutexGuard aGuard (maInstanceMutex); - if (mpInstance.get() == nullptr) + if (mpInstance == nullptr) { if (!xContext.is()) return nullptr; diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 553ce220ca0d..33fb79220f70 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -420,7 +420,7 @@ void SAL_CALL PresenterToolBar::disposing() ElementContainer::const_iterator iEnd (maElementContainer.end()); for ( ; iPart!=iEnd; ++iPart) { - OSL_ASSERT(iPart->get()!=nullptr); + OSL_ASSERT(*iPart != nullptr); ElementContainerPart::iterator iElement ((*iPart)->begin()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); for ( ; iElement!=iPartEnd; ++iElement) @@ -1369,7 +1369,7 @@ void ElementMode::ReadElementMode ( UNO_QUERY); Reference<beans::XPropertySet> xProperties ( PresenterConfigurationAccess::GetNodeProperties(xNode, OUString())); - if ( ! xProperties.is() && rpDefaultMode.get()!=nullptr) + if (!xProperties.is() && rpDefaultMode != nullptr) { // The mode is not specified. Use the given, possibly empty, // default mode instead. @@ -1380,30 +1380,25 @@ void ElementMode::ReadElementMode ( // Read action. if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= msAction)) - if (rpDefaultMode.get()!=nullptr) + if (rpDefaultMode != nullptr) msAction = rpDefaultMode->msAction; // Read text and font - OUString sText (rpDefaultMode.get()!=nullptr ? rpDefaultMode->maText.GetText() : OUString()); + OUString sText(rpDefaultMode != nullptr ? rpDefaultMode->maText.GetText() : OUString()); PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText; Reference<container::XHierarchicalNameAccess> xFontNode ( PresenterConfigurationAccess::GetProperty(xProperties, "Font"), UNO_QUERY); - PresenterTheme::SharedFontDescriptor pFont (PresenterTheme::ReadFont( - xFontNode, - rpDefaultMode.get()!=nullptr - ? rpDefaultMode->maText.GetFont() - : PresenterTheme::SharedFontDescriptor())); + PresenterTheme::SharedFontDescriptor pFont(PresenterTheme::ReadFont( + xFontNode, rpDefaultMode != nullptr ? rpDefaultMode->maText.GetFont() + : PresenterTheme::SharedFontDescriptor())); maText = Text(sText,pFont); // Read bitmaps to display as icons. Reference<container::XHierarchicalNameAccess> xIconNode ( PresenterConfigurationAccess::GetProperty(xProperties, "Icon"), UNO_QUERY); mpIcon = PresenterBitmapContainer::LoadBitmap( - xIconNode, - "", - rContext.mxPresenterHelper, - rContext.mxCanvas, - rpDefaultMode.get()!=nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); + xIconNode, "", rContext.mxPresenterHelper, rContext.mxCanvas, + rpDefaultMode != nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); } catch(Exception&) { diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index 983a17996e6c..f8f8c5ed8e0c 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -178,7 +178,7 @@ void SAL_CALL PresenterViewFactory::disposing() mxConfigurationController->removeResourceFactoryForReference(this); mxConfigurationController = nullptr; - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Dispose all views in the cache. ResourceContainer::const_iterator iView (mpResourceCache->begin()); @@ -243,7 +243,7 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference<XResource>& // Dispose only views that we can not put into the cache. CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get()); - if (pView == nullptr || mpResourceCache.get()==nullptr) + if (pView == nullptr || mpResourceCache == nullptr) { try { @@ -281,7 +281,7 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache( const Reference<XResourceId>& rxViewId, const Reference<XPane>& rxAnchorPane) const { - if (mpResourceCache.get() == nullptr) + if (mpResourceCache == nullptr) return nullptr; try diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 2830c444df97..1337da2abbe5 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -156,7 +156,7 @@ void PresenterWindowManager::SetTheme (const std::shared_ptr<PresenterTheme>& rp // Get background bitmap or background color from the theme. - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), "Background"); } @@ -255,7 +255,7 @@ void SAL_CALL PresenterWindowManager::windowPaint (const awt::PaintEvent& rEvent if ( ! mxParentCanvas.is()) return; - if (mpTheme.get()!=nullptr) + if (mpTheme != nullptr) { try { |