diff options
23 files changed, 47 insertions, 71 deletions
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 4b5d57c0e668..6b56087c2e27 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -368,16 +368,11 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs ) { // determine default-distance SfxItemPool* pPool = m_rOutAttrs.GetPool(); - const SdrMetricItem* pXDistItem = &pPool->GetDefaultItem(SDRATTR_SHADOWXDIST); - const SdrMetricItem* pYDistItem = &pPool->GetDefaultItem(SDRATTR_SHADOWYDIST); - if (pXDistItem && pYDistItem) { - sal_Int32 nX = pXDistItem->GetValue(); - sal_Int32 nY = pYDistItem->GetValue(); - if( nX != 0 ) - SetMetricValue( *m_xMtrDistance, nX < 0 ? -nX : nX, m_ePoolUnit ); - else - SetMetricValue( *m_xMtrDistance, nY < 0 ? -nY : nY, m_ePoolUnit ); + sal_Int32 n = pPool->GetDefaultItem(SDRATTR_SHADOWXDIST).GetValue(); + if (n == 0) + n = pPool->GetDefaultItem(SDRATTR_SHADOWYDIST).GetValue(); + SetMetricValue(*m_xMtrDistance, std::abs(n), m_ePoolUnit); } // Tristate, e. g. multiple objects have been marked of which some have a shadow and some don't. diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index bae3fa07273b..e4528d487620 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1018,7 +1018,8 @@ void SbaTableQueryBrowser::checkDocumentDataSource() // TODO: should we expand the object container? This may be too expensive just for checking .... else { - if ((nullptr == pObjectEntry) && m_aDocumentDataSource.has(DataAccessDescriptorProperty::CommandType) && m_aDocumentDataSource.has(DataAccessDescriptorProperty::Command)) + if (m_aDocumentDataSource.has(DataAccessDescriptorProperty::CommandType) + && m_aDocumentDataSource.has(DataAccessDescriptorProperty::Command)) { // maybe we have a command to be displayed ? sal_Int32 nCommandType = CommandType::TABLE; m_aDocumentDataSource[DataAccessDescriptorProperty::CommandType] >>= nCommandType; @@ -1773,13 +1774,13 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const case ID_BROWSER_ROWHEIGHT: case ID_BROWSER_COLATTRSET: case ID_BROWSER_COLWIDTH: - aReturn.bEnabled = getBrowserView() && getBrowserView()->getVclControl() && isValid() && isValidCursor(); + aReturn.bEnabled = getBrowserView()->getVclControl() && isValid() && isValidCursor(); // aReturn.bEnabled &= getDefinition() && !getDefinition()->GetDatabase()->IsReadOnly(); break; case ID_BROWSER_COPY: OSL_ENSURE( !m_pTreeView->HasChildPathFocus(), "SbaTableQueryBrowser::GetState( ID_BROWSER_COPY ): this should have been handled above!" ); - if (getBrowserView() && getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing()) + if (getBrowserView()->getVclControl() && !getBrowserView()->getVclControl()->IsEditing()) { SbaGridControl* pControl = getBrowserView()->getVclControl(); if ( pControl->GetSelectRowCount() ) diff --git a/i18npool/source/transliteration/transliteration_Numeric.cxx b/i18npool/source/transliteration/transliteration_Numeric.cxx index 4550026153d5..b479a85bfde1 100644 --- a/i18npool/source/transliteration/transliteration_Numeric.cxx +++ b/i18npool/source/transliteration/transliteration_Numeric.cxx @@ -72,7 +72,8 @@ transliteration_Numeric::transliterateBullet( const OUString& inStr, sal_Int32 s offset.realloc(nCount); for (sal_Int32 i = startPos; i < endPos; i++) { - if (i < endPos && isNumber(inStr[i])) { + if (isNumber(inStr[i])) + { if (number == -1) { startPos = i; number = (inStr[i] - NUMBER_ZERO); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 73b905528185..63e1a2469604 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -983,7 +983,7 @@ void correctOverlapping(SdrObject* _pControl,OReportSection const & _aReportSect xComponent->setPositionY(aRect.Top()); } } - if ( !bOverlapping && _bInsert ) // now insert objects + if (_bInsert) // now insert objects rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(), SdrInsertFlags::ADDMARK); } diff --git a/sal/rtl/uri.cxx b/sal/rtl/uri.cxx index baa806928238..07634c628de6 100644 --- a/sal/rtl/uri.cxx +++ b/sal/rtl/uri.cxx @@ -836,8 +836,7 @@ sal_Bool SAL_CALL rtl_uriConvertRelToAbs(rtl_uString * pBaseUriRef, } else { - if (aRelComponents.aPath.pBegin != aRelComponents.aPath.pEnd - && *aRelComponents.aPath.pBegin == '/') + if (*aRelComponents.aPath.pBegin == '/') { appendPath( aBuffer, aBuffer.getLength(), false, diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 85e5f3b5a520..bfb780a8e172 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4717,7 +4717,7 @@ void Test::testAutoFill() { ASSERT_DOUBLES_EQUAL(static_cast<double>(i+1), m_pDoc->GetValue(i, 0, 0)); } - else if (j == 1 || j== 2) + else // j == 1 || j == 2 { if(i == 0) ASSERT_DOUBLES_EQUAL(10.0, m_pDoc->GetValue(0,j,0)); diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 8d02700b866b..063be3a26fd4 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -156,7 +156,7 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo, mpLbColumns->CheckEntryPos( nCheckPos ); *pFunction = FuncToLbPos( pFunctions[i] ); - if (i == 0 || (i > 0 && nCheckPos < nFirstChecked)) + if (i == 0 || nCheckPos < nFirstChecked) nFirstChecked = nCheckPos; } // Select the first checked field from the top. diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 0a42ecdad7b3..662da98dfad6 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -482,7 +482,7 @@ void SAL_CALL SdLayerManager::attachShapeToLayer( const uno::Reference< drawing: SvxShape* pShape = SvxShape::getImplementation( xShape ); SdrObject* pSdrObject = pShape?pShape->GetSdrObject():nullptr; - if(pSdrObject && pSdrLayer ) + if(pSdrObject) pSdrObject->SetLayer(pSdrLayer->GetID()); mpModel->SetModified(); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 5006a49a2f59..457afdffdefa 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -610,7 +610,7 @@ sal_Bool SAL_CALL SdXImpressDocument::hasControllersLocked( ) if( nullptr == mpDoc ) throw lang::DisposedException(); - return mpDoc && mpDoc->isLocked(); + return mpDoc->isLocked(); } uno::Reference < container::XIndexAccess > SAL_CALL SdXImpressDocument::getViewData() @@ -1466,7 +1466,7 @@ sal_Int32 SAL_CALL SdXImpressDocument::getRendererCount( const uno::Any& rSelect if( nullptr == mpDoc ) throw lang::DisposedException(); - if( mpDocShell && mpDoc ) + if (mpDocShell) { uno::Reference< frame::XModel > xModel; @@ -1502,7 +1502,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SdXImpressDocument::getRenderer( rxOptions[ nProperty].Value >>= bExportNotesPages; } uno::Sequence< beans::PropertyValue > aRenderer; - if( mpDocShell && mpDoc ) + if (mpDocShell) { awt::Size aPageSize; if ( bExportNotesPages ) @@ -1890,7 +1890,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r if( nullptr == mpDoc ) throw lang::DisposedException(); - if( mpDocShell && mpDoc ) + if (mpDocShell) { uno::Reference< awt::XDevice > xRenderDevice; const sal_Int32 nPageNumber = nRenderer + 1; diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 375000182ba3..e60b495b2855 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -245,7 +245,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa } else { - if(pEntry && pEntry->nWID) + if(pEntry->nWID) mpPropSet->setPropertyValue( pEntry, aValue ); } } @@ -294,7 +294,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert } else { - if(pEntry && pEntry->nWID) + if(pEntry->nWID) aAny = mpPropSet->getPropertyValue( pEntry ); } return aAny; diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index 80cccf7e51d9..9e78b7ea574d 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -97,13 +97,11 @@ void SvxUnoDrawPool::getAny( SfxItemPool const * pPool, const comphelper::Proper { case OWN_ATTR_FILLBMP_MODE: { - const XFillBmpStretchItem* pStretchItem = &pPool->GetDefaultItem(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = &pPool->GetDefaultItem(XATTR_FILLBMP_TILE); - if( pTileItem && pTileItem->GetValue() ) + if (pPool->GetDefaultItem(XATTR_FILLBMP_TILE).GetValue()) { rValue <<= drawing::BitmapMode_REPEAT; } - else if( pStretchItem && pStretchItem->GetValue() ) + else if (pPool->GetDefaultItem(XATTR_FILLBMP_STRETCH).GetValue()) { rValue <<= drawing::BitmapMode_STRETCH; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 8da3c0d9f203..65ca35e38cd9 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2746,14 +2746,11 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpl { const SfxItemSet& rObjItemSet = GetSdrObject()->GetMergedItemSet(); - const XFillBmpStretchItem* pStretchItem = &rObjItemSet.Get(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = &rObjItemSet.Get(XATTR_FILLBMP_TILE); - - if( pTileItem && pTileItem->GetValue() ) + if (rObjItemSet.Get(XATTR_FILLBMP_TILE).GetValue()) { rValue <<= drawing::BitmapMode_REPEAT; } - else if( pStretchItem && pStretchItem->GetValue() ) + else if (rObjItemSet.Get(XATTR_FILLBMP_STRETCH).GetValue()) { rValue <<= drawing::BitmapMode_STRETCH; } diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 287d2bd18b42..2aadd092824b 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -760,7 +760,7 @@ void SvxTextEditSourceImpl::UpdateData() { if( mpOutliner->GetParagraphCount() > 1 ) { - if( pTextObj && pTextObj->IsTextFrame() && pTextObj->GetTextKind() == OBJ_TITLETEXT ) + if (pTextObj->IsTextFrame() && pTextObj->GetTextKind() == OBJ_TITLETEXT) { while( mpOutliner->GetParagraphCount() > 1 ) { diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index a36298901f5b..1f08b3237e66 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -819,8 +819,7 @@ bool SwCursorShell::CheckTableBoxContent( const SwPosition* pPos ) if( !pPos ) { // get stored position - if( m_pBoxIdx && m_pBoxPtr && - nullptr != ( pSttNd = m_pBoxIdx->GetNode().GetStartNode() ) && + if (nullptr != (pSttNd = m_pBoxIdx->GetNode().GetStartNode()) && SwTableBoxStartNode == pSttNd->GetStartNodeType() && m_pBoxPtr == pSttNd->FindTableNode()->GetTable(). GetTableBox( m_pBoxIdx->GetIndex() ) ) diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index bc1951343c73..a434a20567c2 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -843,7 +843,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, } if ( !bSame ) pCnt = nullptr; - else if ( pCnt && pCnt->IsTextFrame() && static_cast<const SwTextFrame*>(pCnt)->IsHiddenNow() ) // i73332 + else if (pCnt->IsTextFrame() && static_cast<const SwTextFrame*>(pCnt)->IsHiddenNow()) // i73332 { pCnt = (*fnNxtPrv)( pCnt ); pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, true, bInReadOnly, bTableSel ); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 686b64dc89a2..326d0f97c488 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -167,7 +167,7 @@ lcl_MaskRedlines( const SwTextNode& rNode, OUStringBuffer& rText, while ( nRedlineStart < nRedlineEnd && nRedlineStart < nEnd ) { - if ( nRedlineStart >= nStt && nRedlineStart < nEnd ) + if (nRedlineStart >= nStt) { rText[nRedlineStart] = cChar; ++nNumOfMaskedRedlines; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index b05453370191..0ca98cda81e5 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2229,14 +2229,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID) { - const XFillBmpStretchItem* pStretchItem = &rSet.Get(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = &rSet.Get(XATTR_FILLBMP_TILE); - - if( pTileItem && pTileItem->GetValue() ) + if (rSet.Get(XATTR_FILLBMP_TILE).GetValue()) { aAny <<= drawing::BitmapMode_REPEAT; } - else if( pStretchItem && pStretchItem->GetValue() ) + else if (rSet.Get(XATTR_FILLBMP_STRETCH).GetValue()) { aAny <<= drawing::BitmapMode_STRETCH; } @@ -2270,7 +2267,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else throw uno::RuntimeException(); - if(pEntry && pEntry->aType == ::cppu::UnoType<sal_Int16>::get() && pEntry->aType != aAny.getValueType()) + if (pEntry->aType == ::cppu::UnoType<sal_Int16>::get() && pEntry->aType != aAny.getValueType()) { // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here sal_Int32 nValue = 0; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 788d4508feb0..b890d86553da 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -602,8 +602,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() SwPosition* pStart = rUnoCursor.Start(); auto aNewCursor(rUnoCursor.GetDoc()->CreateUnoCursor(*pStart)); // one may also go into tables here - if ((CursorType::TableText != m_eCursorType) && - (CursorType::SelectionInTable != m_eCursorType)) + if (CursorType::SelectionInTable != m_eCursorType) { aNewCursor->SetRemainInSection( false ); } @@ -612,8 +611,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() // of a selection; if there is no selection we don't have to care SwTableNode *const pTableNode = aNewCursor->GetNode().FindTableNode(); bool bMovedFromTable = false; - if (((CursorType::TableText != m_eCursorType) && - (CursorType::SelectionInTable != m_eCursorType)) && pTableNode) + if (CursorType::SelectionInTable != m_eCursorType && pTableNode) { aNewCursor->GetPoint()->nNode = pTableNode->EndOfSectionIndex(); aNewCursor->Move(fnMoveForward, GoInNode); diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index cd87c8692d7a..bf9abc3bf68c 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -462,14 +462,11 @@ void SwXParagraph::Impl::GetSinglePropertyValue_Impl( } case OWN_ATTR_FILLBMP_MODE: { - const XFillBmpStretchItem* pStretchItem = &rSet.Get(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = &rSet.Get(XATTR_FILLBMP_TILE); - - if( pTileItem && pTileItem->GetValue() ) + if (rSet.Get(XATTR_FILLBMP_TILE).GetValue()) { rAny <<= drawing::BitmapMode_REPEAT; } - else if( pStretchItem && pStretchItem->GetValue() ) + else if (rSet.Get(XATTR_FILLBMP_STRETCH).GetValue()) { rAny <<= drawing::BitmapMode_STRETCH; } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 216bfd1f2916..2dffb00e7492 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1182,7 +1182,7 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen } m_pDocShell->GetDoc()->SetOutlineNumRule( aNumRule ); } - else if(!m_pNumRule && m_pDoc && !m_sCreatedNumRuleName.isEmpty() && + else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty() && nullptr != (pRule = m_pDoc->FindNumRulePtr( m_sCreatedNumRuleName ))) { SwXNumberingRules::SetNumberingRuleByIndex( *pRule, @@ -1617,7 +1617,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( std::unique_ptr<SwFormatVertOrient> pSetVOrient; bool bCharStyleNameSet = false; - for(size_t i = 0; i < SAL_N_ELEMENTS( aNumPropertyNames ) && !bExcept && !bWrongArg; ++i) + for (size_t i = 0; i < SAL_N_ELEMENTS(aNumPropertyNames) && !bWrongArg; ++i) { PropertyValue const*const pProp( lcl_FindProperty(aNumPropertyNames[i], aPropertyValues)); @@ -2028,7 +2028,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( break; } } - if(!bExcept && !bWrongArg && (pSetBrush || pSetSize || pSetVOrient)) + if(!bWrongArg && (pSetBrush || pSetSize || pSetVOrient)) { if(!pSetBrush && aFormat.GetBrush()) pSetBrush.reset(new SvxBrushItem(*aFormat.GetBrush())); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 0ce7aeff4179..74fb4be9512c 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2290,11 +2290,9 @@ uno::Any SwXStyle::GetStyleProperty<OWN_ATTR_FILLBMP_MODE>(const SfxItemProperty { PrepareStyleBase(rBase); const SfxItemSet& rSet = rBase.GetItemSet(); - const XFillBmpTileItem* pTileItem = &rSet.Get(XATTR_FILLBMP_TILE); - if(pTileItem && pTileItem->GetValue()) + if (rSet.Get(XATTR_FILLBMP_TILE).GetValue()) return uno::makeAny(drawing::BitmapMode_REPEAT); - const XFillBmpStretchItem* pStretchItem = &rSet.Get(XATTR_FILLBMP_STRETCH); - if(pStretchItem && pStretchItem->GetValue()) + if (rSet.Get(XATTR_FILLBMP_STRETCH).GetValue()) return uno::makeAny(drawing::BitmapMode_STRETCH); return uno::makeAny(drawing::BitmapMode_NO_REPEAT); } @@ -3980,14 +3978,11 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( } case OWN_ATTR_FILLBMP_MODE: { - const XFillBmpStretchItem* pStretchItem = &mpSet->Get(XATTR_FILLBMP_STRETCH); - const XFillBmpTileItem* pTileItem = &mpSet->Get(XATTR_FILLBMP_TILE); - - if( pTileItem && pTileItem->GetValue() ) + if (mpSet->Get(XATTR_FILLBMP_TILE).GetValue()) { aTarget <<= drawing::BitmapMode_REPEAT; } - else if( pStretchItem && pStretchItem->GetValue() ) + else if (mpSet->Get(XATTR_FILLBMP_STRETCH).GetValue()) { aTarget <<= drawing::BitmapMode_STRETCH; } diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index ad6b68a6cfd5..19562ec3382a 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -274,7 +274,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, if(!pGlosGroup || pGlosGroup->GetError()) throw uno::RuntimeException(); - sal_uInt16 nIdx = pGlosGroup->GetIndex( aElementName); + const sal_uInt16 nIdx = pGlosGroup->GetIndex( aElementName); if(USHRT_MAX == nIdx) throw lang::IllegalArgumentException(); OUString aNewShort(aNewElementName); @@ -282,9 +282,8 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, sal_uInt16 nOldLongIdx = pGlosGroup->GetLongIndex( aNewShort ); sal_uInt16 nOldIdx = pGlosGroup->GetIndex( aNewName ); - if( nIdx != USHRT_MAX && - (nOldLongIdx == USHRT_MAX || nOldLongIdx == nIdx )&& - (nOldIdx == USHRT_MAX || nOldIdx == nIdx )) + if ((nOldLongIdx == USHRT_MAX || nOldLongIdx == nIdx) + && (nOldIdx == USHRT_MAX || nOldIdx == nIdx)) { pGlosGroup->Rename( nIdx, &aNewShort, &aNewName ); if(pGlosGroup->GetError() != ERRCODE_NONE) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 90bd2622ef87..ae3ce232557d 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -797,7 +797,7 @@ void ToolBox::ImplCalcFloatSizes() nCalcSize += mnMaxItemWidth; nTempLines = ImplCalcBreaks( nCalcSize, &nMaxLineWidth, true ); } - while ( (nCalcSize < upperBoundWidth) && (nLines < nTempLines) && (nTempLines != 1) ); + while ((nCalcSize < upperBoundWidth) && (nLines < nTempLines)); // implies nTempLines>1 if ( nTempLines < nLines ) nLines = nTempLines; } |