Kaydet (Commit) 004cc811 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:collapseif in dbaccess..lotuswordpro

Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662
Reviewed-on: https://gerrit.libreoffice.org/62934
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2429c626
......@@ -114,11 +114,8 @@ void OAppBorderWindow::Resize()
if ( m_pPanel )
{
OApplicationSwapWindow* pSwap = getPanel();
if ( pSwap )
{
if ( pSwap->GetEntryCount() != 0 )
nX = pSwap->GetBoundingBox( pSwap->GetEntry(0) ).GetWidth() + aFLSize.Height();
}
if ( pSwap && pSwap->GetEntryCount() != 0 )
nX = pSwap->GetBoundingBox( pSwap->GetEntry(0) ).GetWidth() + aFLSize.Height();
nX = std::max(m_pPanel->GetWidthPixel() ,nX);
m_pPanel->SetPosSizePixel(Point(0,0),Size(nX,nOutputHeight));
}
......
......@@ -2047,11 +2047,8 @@ long OSelectionBrowseBox::GetRealRow(long nRowId) const
const long nCount = m_bVisibleRow.size();
for(i=0;i < nCount; ++i)
{
if(m_bVisibleRow[i])
{
if(nErg++ == nRowId)
break;
}
if(m_bVisibleRow[i] && nErg++ == nRowId)
break;
}
OSL_ENSURE(nErg <= long(m_bVisibleRow.size()),"nErg cannot be greater than BROW_ROW_CNT!");
return i;
......
......@@ -1812,13 +1812,10 @@ void dumpXShape(const uno::Reference< drawing::XShape >& xShape, xmlTextWriterPt
if(xInfo->hasPropertyByName("Name"))
{
uno::Any aAny = xPropSet->getPropertyValue("Name");
if (aAny >>= aName)
if ((aAny >>= aName) && !aName.isEmpty())
{
if (!aName.isEmpty())
{
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
m_bNameDumped = true;
}
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("name"), "%s", OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
m_bNameDumped = true;
}
}
......
......@@ -1672,11 +1672,8 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons
bDoTrans = true;
while (true)
{
if ( mnLevel == 1 )
{
if ( nHeight > 10 )
nHeight = 8;
}
if ( mnLevel == 1 && nHeight > 10 )
nHeight = 8;
aRect = tools::Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( nWidth, nHeight ) );
aRegion = vcl::Region( pMaskBitmap->CreateRegion( COL_BLACK, aRect ) );
......
......@@ -1601,18 +1601,15 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
}
}
if (!bConverted)
if (!bConverted && pGraphicProvider )
{
if ( pGraphicProvider )
const OUString& rBaseURI( pGraphicProvider->GetBaseURI() );
INetURLObject aBaseURI( rBaseURI );
if( aBaseURI.GetProtocol() == aTmp.GetProtocol() )
{
const OUString& rBaseURI( pGraphicProvider->GetBaseURI() );
INetURLObject aBaseURI( rBaseURI );
if( aBaseURI.GetProtocol() == aTmp.GetProtocol() )
{
OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl ) );
if ( !aRelUrl.isEmpty() )
aGraphicUrl = aRelUrl;
}
OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl ) );
if ( !aRelUrl.isEmpty() )
aGraphicUrl = aRelUrl;
}
}
}
......@@ -2268,20 +2265,17 @@ void EscherPropertyContainer::CreateShadowProperties(
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "Shadow", true ) )
{
bool bHasShadow = false; // shadow is possible only if at least a fillcolor, linecolor or graphic is set
if ( aAny >>= bHasShadow )
if ( (aAny >>= bHasShadow) && bHasShadow )
{
if ( bHasShadow )
{
nShadowFlags |= 2;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowColor" ) )
AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny) ) );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowXDistance" ) )
AddOpt( ESCHER_Prop_shadowOffsetX, *o3tl::doAccess<sal_Int32>(aAny) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowYDistance" ) )
AddOpt( ESCHER_Prop_shadowOffsetY, *o3tl::doAccess<sal_Int32>(aAny) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowTransparence" ) )
AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (static_cast<sal_uInt32>(*o3tl::doAccess<sal_uInt16>(aAny)) * 655 ) );
}
nShadowFlags |= 2;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowColor" ) )
AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny) ) );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowXDistance" ) )
AddOpt( ESCHER_Prop_shadowOffsetX, *o3tl::doAccess<sal_Int32>(aAny) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowYDistance" ) )
AddOpt( ESCHER_Prop_shadowOffsetY, *o3tl::doAccess<sal_Int32>(aAny) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowTransparence" ) )
AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (static_cast<sal_uInt32>(*o3tl::doAccess<sal_uInt16>(aAny)) * 655 ) );
}
}
}
......
......@@ -647,56 +647,53 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
sal_uInt32 k, nPt = nC;
css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > aSegments;
pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments );
if ( pAny )
if ( pAny && (*pAny >>= aSegments) )
{
if ( *pAny >>= aSegments )
for ( nPt = 0, k = 1; nC && ( k < static_cast<sal_uInt32>(aSegments.getLength()) ); k++ )
{
for ( nPt = 0, k = 1; nC && ( k < static_cast<sal_uInt32>(aSegments.getLength()) ); k++ )
sal_Int16 j, nCnt2 = aSegments[ k ].Count;
if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN )
{
sal_Int16 j, nCnt2 = aSegments[ k ].Count;
if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN )
for ( j = 0; nC && ( j < nCnt2 ); j++ )
{
for ( j = 0; nC && ( j < nCnt2 ); j++ )
switch( aSegments[ k ].Command )
{
switch( aSegments[ k ].Command )
case EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
case EnhancedCustomShapeSegmentCommand::LINETO :
case EnhancedCustomShapeSegmentCommand::MOVETO :
{
case EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
case EnhancedCustomShapeSegmentCommand::LINETO :
case EnhancedCustomShapeSegmentCommand::MOVETO :
{
nC--;
nPt++;
}
break;
case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
break;
nC--;
nPt++;
}
break;
case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
break;
case EnhancedCustomShapeSegmentCommand::CURVETO :
{
nC--;
nPt += 3;
}
break;
case EnhancedCustomShapeSegmentCommand::CURVETO :
{
nC--;
nPt += 3;
}
break;
case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
{
nC--;
nPt += 3;
}
break;
case EnhancedCustomShapeSegmentCommand::ARCTO :
case EnhancedCustomShapeSegmentCommand::ARC :
case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
{
nC--;
nPt += 4;
}
break;
case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
{
nC--;
nPt += 3;
}
break;
case EnhancedCustomShapeSegmentCommand::ARCTO :
case EnhancedCustomShapeSegmentCommand::ARC :
case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
{
nC--;
nPt += 4;
}
break;
}
}
}
......
......@@ -2101,11 +2101,8 @@ bool FormulaCompiler::CompileTokenArray()
FormulaToken** pData = pDataArray + 1;
pCode = pData;
bool bWasForced = pArr->IsRecalcModeForced();
if ( bWasForced )
{
if ( bAutoCorrect )
aCorrectedFormula = "=";
}
if ( bWasForced && bAutoCorrect )
aCorrectedFormula = "=";
pArr->ClearRecalcMode();
maArrIterator.Reset();
eLastOp = ocOpen;
......
......@@ -123,13 +123,10 @@ bool SvMetaObject::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
bOk = rInStm.ReadIf( ']' );
}
if( bOk )
if( bOk && rInStm.ReadIf( '{' ) )
{
if( rInStm.ReadIf( '{' ) )
{
DoReadContextSvIdl( rBase, rInStm );
bOk = rInStm.ReadIf( '}' );
}
DoReadContextSvIdl( rBase, rInStm );
bOk = rInStm.ReadIf( '}' );
}
if( !bOk )
......
......@@ -150,11 +150,8 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName)
// Special case for scope which is an interface. We
// have to look in the inherited interfaces as well.
if ( !pDecl )
{
if (m_nodeType == NT_interface)
pDecl = lookupInInherited(scopedName);
}
if ( !pDecl && m_nodeType == NT_interface )
pDecl = lookupInInherited(scopedName);
}
}
......
......@@ -465,11 +465,9 @@ void XRMResMerge::WorkOnText(
const OString &,
OString & )
{
if ( pMergeDataFile ) {
if ( !pResData ) {
pResData.reset( new ResData( GetGID(), sFilename ) );
pResData->sResTyp = sResourceType;
}
if ( pMergeDataFile && !pResData ) {
pResData.reset( new ResData( GetGID(), sFilename ) );
pResData->sResTyp = sResourceType;
}
}
......
......@@ -354,15 +354,12 @@ void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
}
}
if ( fZoom != 0 )
if ( fZoom != 0 && window->lokdocview )
{
if ( window->lokdocview )
{
lok_doc_view_set_zoom( LOK_DOC_VIEW(window->lokdocview), fZoom );
GdkRectangle aVisibleArea;
gtv_application_window_get_visible_area(window, &aVisibleArea);
lok_doc_view_set_visible_area(LOK_DOC_VIEW(window->lokdocview), &aVisibleArea);
}
lok_doc_view_set_zoom( LOK_DOC_VIEW(window->lokdocview), fZoom );
GdkRectangle aVisibleArea;
gtv_application_window_get_visible_area(window, &aVisibleArea);
lok_doc_view_set_visible_area(LOK_DOC_VIEW(window->lokdocview), &aVisibleArea);
}
const std::string aZoom = std::string("Zoom: ") + std::to_string(int(fZoom * 100)) + std::string("%");
gtk_label_set_text(GTK_LABEL(window->zoomlabel), aZoom.c_str());
......
......@@ -536,18 +536,15 @@ void LwpFribPtr::RegisterStyle()
void LwpFribPtr::ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen)
{
if (pStory)
if (pStory && pStory->GetDropcapFlag())
{
if (pStory->GetDropcapFlag())
{
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName());
pFribStyle->GetFont()->SetFontSize(0);
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName());
pFribStyle->GetFont()->SetFontSize(0);
LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe().GetOnlyLayout().obj().get());
if (pObj)
pObj->SetChars(nLen);
}
LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe().GetOnlyLayout().obj().get());
if (pObj)
pObj->SetChars(nLen);
}
}
/**
......
......@@ -436,17 +436,14 @@ void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpInden
pTotalIndent.reset(pIndent->clone());
//for bullet only
if (pPara)
if (pPara && pPara->GetBulletFlag())
{
if (pPara->GetBulletFlag())
{
pTotalIndent->SetMAll(o3tl::saturating_add(pParentIndent->GetMAll(), pTotalIndent->GetMAll()));
pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight()));
pParaStyle->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
pTotalIndent->GetMAll())), pTotalIndent->GetRight());
pPara->SetIndent(pTotalIndent.release());
return;
}
pTotalIndent->SetMAll(o3tl::saturating_add(pParentIndent->GetMAll(), pTotalIndent->GetMAll()));
pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight()));
pParaStyle->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
pTotalIndent->GetMAll())), pTotalIndent->GetRight());
pPara->SetIndent(pTotalIndent.release());
return;
}
sal_uInt16 relative = pParentIndent->GetRelative();
......@@ -467,15 +464,12 @@ void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpInden
else
{
pTotalIndent.reset(pIndent->clone());
if (pPara)
if (pPara && pPara->GetBulletFlag())
{
if (pPara->GetBulletFlag())
{
pParaStyle->SetMargins(LwpTools::ConvertToMetric(
LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight());
pPara->SetIndent(pTotalIndent.release());
return;
}
pParaStyle->SetMargins(LwpTools::ConvertToMetric(
LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight());
pPara->SetIndent(pTotalIndent.release());
return;
}
pParaStyle->SetIndent(pIndent->GetFirst());
......
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