summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/source/dispatch/loaddispatcher.cxx9
-rw-r--r--oox/source/export/drawingml.cxx8
-rw-r--r--package/source/zipapi/ZipFile.cxx9
-rw-r--r--registry/source/registry.cxx9
-rw-r--r--reportdesign/source/core/sdr/PropertyForward.cxx69
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx7
-rw-r--r--sal/rtl/random.cxx7
7 files changed, 49 insertions, 69 deletions
diff --git a/framework/source/dispatch/loaddispatcher.cxx b/framework/source/dispatch/loaddispatcher.cxx
index 836fcae3c60f..49d2a496e723 100644
--- a/framework/source/dispatch/loaddispatcher.cxx
+++ b/framework/source/dispatch/loaddispatcher.cxx
@@ -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.
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 573d2982cc88..ba60093fa121 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -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;
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 2e2a6216cb4f..60bdced74b5a 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -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" );
}
}
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index 61b2c7ba1445..b183f634eb97 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -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;
}
}
diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
index a2a94ccd6fff..cca1f9825216 100644
--- a/reportdesign/source/core/sdr/PropertyForward.cxx
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -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));
}
}
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 3a1deb5958d9..9e4bbf84cf69 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -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 );
diff --git a/sal/rtl/random.cxx b/sal/rtl/random.cxx
index 224a345a3094..836d30889b80 100644
--- a/sal/rtl/random.cxx
+++ b/sal/rtl/random.cxx
@@ -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;