Kaydet (Commit) 2e2d736c authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:collapseif in framework..sal

Change-Id: I3068b18f5cff024a48a8f8c68d69cadad30fe4d5
Reviewed-on: https://gerrit.libreoffice.org/62953
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1647bc13
......@@ -92,12 +92,9 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL,
}
css::uno::Reference< css::frame::XFrame > xBaseFrame(m_xOwnerFrame.get(), css::uno::UNO_QUERY);
if (!xBaseFrame.is())
{
if (xListener.is())
xListener->dispatchFinished(
css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::FAILURE, css::uno::Any()));
}
if (!xBaseFrame.is() && xListener.is())
xListener->dispatchFinished(
css::frame::DispatchResultEvent(xThis, css::frame::DispatchResultState::FAILURE, css::uno::Any()));
// OK ... now the internal loader seems to be usable for new requests
// and our owner frame seems to be valid for such operations.
......
......@@ -666,11 +666,9 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 0) {
OUString aLineDashName;
GET(aLineDashName, LineDashName);
if (!aLineDashName.isEmpty()) {
if (xModel) {
css::uno::Any aAny = getLineDash(xModel, aLineDashName);
aAny >>= aLineDash;
}
if (!aLineDashName.isEmpty() && xModel) {
css::uno::Any aAny = getLineDash(xModel, aLineDashName);
aAny >>= aLineDash;
}
}
bDashSet = true;
......
......@@ -83,13 +83,10 @@ ZipFile::ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolde
, m_xContext ( rxContext )
, bRecoveryMode( false )
{
if (bInitialise)
if (bInitialise && readCEN() == -1 )
{
if ( readCEN() == -1 )
{
aEntries.clear();
throw ZipException( "stream data looks to be broken" );
}
aEntries.clear();
throw ZipException( "stream data looks to be broken" );
}
}
......
......@@ -57,13 +57,10 @@ static void REGISTRY_CALLTYPE release(RegHandle hReg)
{
ORegistry* pReg = static_cast<ORegistry*>(hReg);
if (pReg)
if (pReg && pReg->release() == 0)
{
if (pReg->release() == 0)
{
delete pReg;
hReg = nullptr;
}
delete pReg;
hReg = nullptr;
}
}
......
......@@ -99,47 +99,44 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt
bool bDest = (evt.Source == m_xDest);
Reference<XPropertySet> xProp = bDest ? m_xSource : m_xDest;
Reference<XPropertySetInfo> xPropInfo = bDest ? m_xSourceInfo : m_xDestInfo;
if ( xProp.is() )
if ( xProp.is() && xPropInfo.is() )
{
if ( xPropInfo.is() )
if ( xPropInfo->hasPropertyByName(evt.PropertyName) )
xProp->setPropertyValue(evt.PropertyName,evt.NewValue);
else
{
if ( xPropInfo->hasPropertyByName(evt.PropertyName) )
xProp->setPropertyValue(evt.PropertyName,evt.NewValue);
TPropertyNamePair::const_iterator aFind = m_aNameMap.find(evt.PropertyName);
OUString sPropName;
if ( aFind != m_aNameMap.end() )
sPropName = aFind->second.first;
else
{
TPropertyNamePair::const_iterator aFind = m_aNameMap.find(evt.PropertyName);
OUString sPropName;
aFind = ::std::find_if(
m_aNameMap.begin(),
m_aNameMap.end(),
[&evt] (const TPropertyNamePair::value_type& namePair) {
return namePair.second.first == evt.PropertyName;
});
if ( aFind != m_aNameMap.end() )
sPropName = aFind->second.first;
else
{
aFind = ::std::find_if(
m_aNameMap.begin(),
m_aNameMap.end(),
[&evt] (const TPropertyNamePair::value_type& namePair) {
return namePair.second.first == evt.PropertyName;
});
if ( aFind != m_aNameMap.end() )
sPropName = aFind->first;
}
if (aFind != m_aNameMap.end() && !sPropName.isEmpty() && xPropInfo->hasPropertyByName(sPropName))
xProp->setPropertyValue(sPropName,aFind->second.second->operator()(sPropName,evt.NewValue));
else if ( evt.PropertyName == PROPERTY_CHARFONTNAME
|| evt.PropertyName == PROPERTY_CHARFONTSTYLENAME
|| evt.PropertyName == PROPERTY_CHARSTRIKEOUT
|| evt.PropertyName == PROPERTY_CHARWORDMODE
|| evt.PropertyName == PROPERTY_CHARROTATION
|| evt.PropertyName == PROPERTY_CHARSCALEWIDTH
|| evt.PropertyName == PROPERTY_CHARFONTFAMILY
|| evt.PropertyName == PROPERTY_CHARFONTCHARSET
|| evt.PropertyName == PROPERTY_CHARFONTPITCH
|| evt.PropertyName == PROPERTY_CHARHEIGHT
|| evt.PropertyName == PROPERTY_CHARUNDERLINE
|| evt.PropertyName == PROPERTY_CHARWEIGHT
|| evt.PropertyName == PROPERTY_CHARPOSTURE)
{
xProp->setPropertyValue(PROPERTY_FONTDESCRIPTOR,m_xSource->getPropertyValue(PROPERTY_FONTDESCRIPTOR));
}
sPropName = aFind->first;
}
if (aFind != m_aNameMap.end() && !sPropName.isEmpty() && xPropInfo->hasPropertyByName(sPropName))
xProp->setPropertyValue(sPropName,aFind->second.second->operator()(sPropName,evt.NewValue));
else if ( evt.PropertyName == PROPERTY_CHARFONTNAME
|| evt.PropertyName == PROPERTY_CHARFONTSTYLENAME
|| evt.PropertyName == PROPERTY_CHARSTRIKEOUT
|| evt.PropertyName == PROPERTY_CHARWORDMODE
|| evt.PropertyName == PROPERTY_CHARROTATION
|| evt.PropertyName == PROPERTY_CHARSCALEWIDTH
|| evt.PropertyName == PROPERTY_CHARFONTFAMILY
|| evt.PropertyName == PROPERTY_CHARFONTCHARSET
|| evt.PropertyName == PROPERTY_CHARFONTPITCH
|| evt.PropertyName == PROPERTY_CHARHEIGHT
|| evt.PropertyName == PROPERTY_CHARUNDERLINE
|| evt.PropertyName == PROPERTY_CHARWEIGHT
|| evt.PropertyName == PROPERTY_CHARPOSTURE)
{
xProp->setPropertyValue(PROPERTY_FONTDESCRIPTOR,m_xSource->getPropertyValue(PROPERTY_FONTDESCRIPTOR));
}
}
}
......
......@@ -1401,11 +1401,8 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b
{
OReportSection& rReportSection = (*aIter)->getReportSection();
SdrHdl* pCurrentHdl = rReportSection.getSectionView().GetDragHdl();
if ( pCurrentHdl )
{
if ( aRealMousePos.Y() > 0 )
aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
}
if ( pCurrentHdl && aRealMousePos.Y() > 0 )
aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
rReportSection.getSectionView().MovAction ( aRealMousePos );
const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height();
aRealMousePos.AdjustY( -nSectionHeight );
......
......@@ -294,11 +294,8 @@ rtlRandomError SAL_CALL rtl_random_getBytes (
if (pImpl->m_hDigest || !osl_get_system_random_data(static_cast< char* >(Buffer), Bytes))
{
if (!pImpl->m_hDigest)
{
if (!initPool (pImpl))
return rtl_Random_E_Unknown;
}
if (!pImpl->m_hDigest && !initPool(pImpl))
return rtl_Random_E_Unknown;
readPool(pImpl, pBuffer, Bytes);
}
return rtl_Random_E_None;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment