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>
This commit is contained in:
parent
0f499af8c2
commit
054c0e7177
@ -34,7 +34,7 @@ VCLXAccessibleComboBox::VCLXAccessibleComboBox (VCLXWindow* pVCLWindow)
|
||||
|
||||
bool VCLXAccessibleComboBox::IsValid() const
|
||||
{
|
||||
return GetWindow().get() != nullptr;
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
@ -37,7 +37,7 @@ VCLXAccessibleDropDownComboBox::VCLXAccessibleDropDownComboBox (VCLXWindow* pVCL
|
||||
|
||||
bool VCLXAccessibleDropDownComboBox::IsValid() const
|
||||
{
|
||||
return GetWindow().get() != nullptr;
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
void VCLXAccessibleDropDownComboBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
|
||||
|
@ -37,7 +37,7 @@ VCLXAccessibleDropDownListBox::VCLXAccessibleDropDownListBox (VCLXWindow* pVCLWi
|
||||
|
||||
bool VCLXAccessibleDropDownListBox::IsValid() const
|
||||
{
|
||||
return GetWindow().get() != nullptr;
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ VCLXAccessibleListBox::VCLXAccessibleListBox (VCLXWindow* pVCLWindow)
|
||||
|
||||
bool VCLXAccessibleListBox::IsValid() const
|
||||
{
|
||||
return GetWindow().get() != nullptr;
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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: */
|
||||
|
@ -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" );
|
||||
|
@ -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 );
|
||||
|
@ -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 )
|
||||
|
@ -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 ||
|
||||
|
@ -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 ||
|
||||
|
@ -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 )
|
||||
|
@ -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) {
|
||||
|
@ -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 )
|
||||
|
@ -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
|
||||
|
@ -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. */
|
||||
|
@ -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())
|
||||
|
@ -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() );
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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() );
|
||||
|
@ -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 &&
|
||||
|
@ -383,7 +383,7 @@ void ScDocument::DelayFormulaGrouping( bool delay )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pDelayedFormulaGrouping.get() != nullptr && pDelayedFormulaGrouping->IsValid())
|
||||
if( pDelayedFormulaGrouping && pDelayedFormulaGrouping->IsValid())
|
||||
RegroupFormulaCells( *pDelayedFormulaGrouping );
|
||||
pDelayedFormulaGrouping.reset();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 ======================================================
|
||||
|
@ -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(
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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 )
|
||||
|
@ -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() )
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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())
|
||||
|
@ -69,7 +69,7 @@ bool PanelBase::ProvideWrappedControl()
|
||||
if (mpWrappedControl)
|
||||
mpWrappedControl->Show();
|
||||
}
|
||||
return mpWrappedControl.get() != nullptr;
|
||||
return bool(mpWrappedControl);
|
||||
}
|
||||
|
||||
ISidebarReceiver::~ISidebarReceiver()
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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(),
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -398,7 +398,7 @@ void PresenterProtocolHandler::Dispatch::disposing()
|
||||
{
|
||||
if (mbIsListeningToWindowManager)
|
||||
{
|
||||
if (mpPresenterController.get() != nullptr)
|
||||
if (mpPresenterController)
|
||||
mpPresenterController->GetWindowManager()->RemoveLayoutListener(this);
|
||||
mbIsListeningToWindowManager = false;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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())
|
||||
|
@ -80,7 +80,7 @@ PresenterSlidePreview::PresenterSlidePreview (
|
||||
mxWindow->setVisible(true);
|
||||
}
|
||||
|
||||
if (mpPresenterController.get() != nullptr)
|
||||
if (mpPresenterController)
|
||||
mnSlideAspectRatio = mpPresenterController->GetSlideAspectRatio();
|
||||
|
||||
Reference<lang::XMultiComponentFactory> xFactory = rxContext->getServiceManager();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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(),
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ bool EffectRewinder::rewind (
|
||||
if (mpAsynchronousRewindEvent)
|
||||
mrEventQueue.addEvent(mpAsynchronousRewindEvent);
|
||||
|
||||
return mpAsynchronousRewindEvent.get()!=nullptr;
|
||||
return bool(mpAsynchronousRewindEvent);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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; }
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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());
|
||||
|
@ -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() )
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user