Kaydet (Commit) 890afecb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:buriedassign in dbaccess..oox

Change-Id: Ic0ca695a1d9d05418213475a68e233953136cc8e
Reviewed-on: https://gerrit.libreoffice.org/63468
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst faa63cd1
......@@ -1865,7 +1865,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
sal_Int32 searchIndex=1;
while(aColumnMap.find(sAlias) != aColumnMap.end())
{
(sAlias = sName) += OUString::number(searchIndex++);
sAlias = sName + OUString::number(searchIndex++);
}
sName = sAlias;
}
......
......@@ -465,7 +465,8 @@ namespace
bool bRet = _xNameContainer->hasByName(sName);
if ( bRet )
{
_rRet = _xNameContainer->getByName(_sSimpleName = sName);
_sSimpleName = sName;
_rRet = _xNameContainer->getByName(_sSimpleName);
while ( nIndex != -1 && bRet )
{
sName = _sName.getToken(0,'/',nIndex);
......
......@@ -628,11 +628,16 @@ void OCopyTableWizard::construct()
{
SetSizePixel(Size(700, 350));
AddButton( m_pbHelp = VclPtr<HelpButton>::Create(this, WB_TABSTOP) );
AddButton( m_pbCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP) );
AddButton( m_pbPrev = VclPtr<PushButton>::Create(this, WB_TABSTOP));
AddButton( m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP));
AddButton( m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP));
m_pbHelp = VclPtr<HelpButton>::Create(this, WB_TABSTOP);
AddButton(m_pbHelp);
m_pbCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP);
AddButton(m_pbCancel);
m_pbPrev = VclPtr<PushButton>::Create(this, WB_TABSTOP);
AddButton(m_pbPrev);
m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP);
AddButton(m_pbNext);
m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP);
AddButton(m_pbFinish);
m_pbHelp->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) );
m_pbCancel->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) );
......
......@@ -334,7 +334,7 @@ namespace
bBrace = true;
_rJoin = _rJoin.replaceAt(_rJoin.getLength()-1,1,OUString(' '));
}
(_rJoin += C_AND) += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
_rJoin += C_AND + BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
if(bBrace)
_rJoin += ")";
_pEntryConn->SetVisited(true);
......
......@@ -158,15 +158,15 @@ namespace emfplushelper
{
case EmfPlusObjectTypeBrush:
{
EMFPBrush *brush;
maEMFPObjects[index].reset(brush = new EMFPBrush());
EMFPBrush *brush = new EMFPBrush();
maEMFPObjects[index].reset(brush);
brush->Read(rObjectStream, *this);
break;
}
case EmfPlusObjectTypePen:
{
EMFPPen *pen;
maEMFPObjects[index].reset(pen = new EMFPPen());
EMFPPen *pen = new EMFPPen();
maEMFPObjects[index].reset(pen);
pen->Read(rObjectStream, *this);
break;
}
......@@ -178,22 +178,22 @@ namespace emfplushelper
rObjectStream.ReadUInt32(header).ReadInt32(points).ReadUInt32(pathFlags);
SAL_INFO("drawinglayer", "EMF+\tpath");
SAL_INFO("drawinglayer", "EMF+\theader: 0x" << std::hex << header << " points: " << std::dec << points << " additional flags: 0x" << std::hex << pathFlags << std::dec);
EMFPPath *path;
maEMFPObjects[index].reset(path = new EMFPPath(points));
EMFPPath *path = new EMFPPath(points);
maEMFPObjects[index].reset(path);
path->Read(rObjectStream, pathFlags);
break;
}
case EmfPlusObjectTypeRegion:
{
EMFPRegion *region;
maEMFPObjects[index].reset(region = new EMFPRegion());
EMFPRegion *region = new EMFPRegion();
maEMFPObjects[index].reset(region);
region->ReadRegion(rObjectStream, *this);
break;
}
case EmfPlusObjectTypeImage:
{
EMFPImage *image;
maEMFPObjects[index].reset(image = new EMFPImage);
EMFPImage *image = new EMFPImage;
maEMFPObjects[index].reset(image);
image->type = 0;
image->width = 0;
image->height = 0;
......@@ -204,8 +204,8 @@ namespace emfplushelper
}
case EmfPlusObjectTypeFont:
{
EMFPFont *font;
maEMFPObjects[index].reset(font = new EMFPFont);
EMFPFont *font = new EMFPFont;
maEMFPObjects[index].reset(font);
font->emSize = 0;
font->sizeUnit = 0;
font->fontFlags = 0;
......@@ -214,8 +214,8 @@ namespace emfplushelper
}
case EmfPlusObjectTypeStringFormat:
{
EMFPStringFormat *stringFormat;
maEMFPObjects[index].reset(stringFormat = new EMFPStringFormat());
EMFPStringFormat *stringFormat = new EMFPStringFormat();
maEMFPObjects[index].reset(stringFormat);
stringFormat->Read(rObjectStream);
break;
}
......
......@@ -1252,12 +1252,15 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
if( bIsReplaceQuote )
{
sal_Unicode cPrev;
bool bSttQuote = !nInsPos ||
NonFieldWordDelim( ( cPrev = rTxt[ nInsPos-1 ])) ||
bool bSttQuote = !nInsPos;
if (!bSttQuote)
{
cPrev = rTxt[ nInsPos-1 ];
bSttQuote = NonFieldWordDelim(cPrev) ||
lcl_IsInAsciiArr( "([{", cPrev ) ||
( cEmDash == cPrev ) ||
( cEnDash == cPrev );
}
InsertQuote( rDoc, nInsPos, cChar, bSttQuote, bInsert );
break;
}
......@@ -1890,15 +1893,15 @@ OUString SvxAutoCorrect::GetAutoCorrFileName( const LanguageTag& rLanguageTag,
sExt = "_" + sExt + ".dat";
if( bNewFile )
( sRet = sUserAutoCorrFile ) += sExt;
sRet = sUserAutoCorrFile + sExt;
else if( !bTst )
( sRet = sShareAutoCorrFile ) += sExt;
sRet = sShareAutoCorrFile + sExt;
else
{
// test first in the user directory - if not exist, then
( sRet = sUserAutoCorrFile ) += sExt;
sRet = sUserAutoCorrFile + sExt;
if( !FStatHelper::IsDocument( sRet ))
( sRet = sShareAutoCorrFile ) += sExt;
sRet = sShareAutoCorrFile + sExt;
}
return sRet;
}
......
......@@ -55,7 +55,7 @@ namespace pcr
sal_Int32 nPostfixNumber = 1;
do
{
( sInitialName = sNameBase ) += OUString::number(nPostfixNumber++);
sInitialName = sNameBase + OUString::number(nPostfixNumber++);
}
while ( m_aProhibitedNames.find( sInitialName ) != m_aProhibitedNames.end() );
......
......@@ -145,7 +145,8 @@ void GIFLZWCompressor::StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize )
for (i=0; i<4096; i++)
{
pTable[i].pBrother = pTable[i].pFirstChild = nullptr;
pTable[i].nValue = static_cast<sal_uInt8>( pTable[i].nCode = i );
pTable[i].nCode = i;
pTable[i].nValue = static_cast<sal_uInt8>( i );
}
pPrefix = nullptr;
......
......@@ -2507,7 +2507,8 @@ void PSWriter::StartCompression()
for ( i = 0; i < 4096; i++ )
{
pTable[ i ].pBrother = pTable[ i ].pFirstChild = nullptr;
pTable[ i ].nValue = static_cast<sal_uInt8>( pTable[ i ].nCode = i );
pTable[ i ].nCode = i;
pTable[ i ].nValue = static_cast<sal_uInt8>( i );
}
pPrefix = nullptr;
WriteBits( nClearCode, nCodeSize );
......
......@@ -503,7 +503,8 @@ void TIFFWriter::StartCompression()
for ( i = 0; i < 4096; i++)
{
pTable[ i ].pBrother = pTable[ i ].pFirstChild = nullptr;
pTable[ i ].nValue = static_cast<sal_uInt8>( pTable[ i ].nCode = i );
pTable[ i ].nCode = i;
pTable[ i ].nValue = static_cast<sal_uInt8>( i );
}
pPrefix = nullptr;
......
......@@ -53,9 +53,10 @@ void CGM::ImplDoClass5()
else
nWidth = static_cast<sal_uInt32>(ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize )) * 25; // scaling in 1/4 mm
( pElement->nAspectSourceFlags & ASF_LINEWIDTH )
? pElement->pLineBundle->nLineWidth = nWidth
: pElement->aLineBundle.nLineWidth = nWidth;
if ( pElement->nAspectSourceFlags & ASF_LINEWIDTH )
pElement->pLineBundle->nLineWidth = nWidth;
else
pElement->aLineBundle.nLineWidth = nWidth;
}
break;
case 0x04 : /*Line Color*/
......@@ -90,9 +91,10 @@ void CGM::ImplDoClass5()
}
else
nWidth = static_cast<sal_uInt32>(ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize )) * 25;
( pElement->nAspectSourceFlags & ASF_MARKERSIZE )
? pElement->pMarkerBundle->nMarkerSize = nWidth
: pElement->aMarkerBundle.nMarkerSize = nWidth;
if ( pElement->nAspectSourceFlags & ASF_MARKERSIZE )
pElement->pMarkerBundle->nMarkerSize = nWidth;
else
pElement->aMarkerBundle.nMarkerSize = nWidth;
}
break;
case 0x08 : /*Marker Color*/
......@@ -268,9 +270,10 @@ void CGM::ImplDoClass5()
}
else
nWidth = static_cast<sal_uInt32>(ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize )) * 25;
( pElement->nAspectSourceFlags & ASF_EDGEWIDTH )
? pElement->pEdgeBundle->nEdgeWidth = nWidth
: pElement->aEdgeBundle.nEdgeWidth = nWidth;
if ( pElement->nAspectSourceFlags & ASF_EDGEWIDTH )
pElement->pEdgeBundle->nEdgeWidth = nWidth;
else
pElement->aEdgeBundle.nEdgeWidth = nWidth;
}
break;
case 0x1d : /*Edge Color*/
......
......@@ -154,11 +154,13 @@ bool DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE)
aColor=ConvertColor(static_cast<sal_uInt8>(nColor));
if (aActLineColor!=aColor) {
pVirDev->SetLineColor( aActLineColor = aColor );
aActLineColor = aColor;
pVirDev->SetLineColor( aActLineColor );
}
if (aActFillColor!=COL_TRANSPARENT) {
pVirDev->SetFillColor(aActFillColor = COL_TRANSPARENT);
aActFillColor = COL_TRANSPARENT;
pVirDev->SetFillColor(aActFillColor);
}
return true;
}
......@@ -174,11 +176,13 @@ bool DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE)
aColor=ConvertColor(static_cast<sal_uInt8>(nColor));
if (aActLineColor!=aColor) {
pVirDev->SetLineColor( aActLineColor = aColor );
aActLineColor = aColor;
pVirDev->SetLineColor( aActLineColor );
}
if ( aActFillColor == COL_TRANSPARENT || aActFillColor != aColor) {
pVirDev->SetFillColor( aActFillColor = aColor );
aActFillColor = aColor;
pVirDev->SetFillColor( aActFillColor );
}
return true;
}
......
......@@ -336,7 +336,10 @@ void TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect
TBCMenuSpecific* pMenu = getMenuSpecific();
if ( pMenu )
aProp.Value <<= sMenuBar += pMenu->Name(); // name of popup
{
sMenuBar += pMenu->Name();
aProp.Value <<= sMenuBar; // name of popup
}
nStyle |= ui::ItemStyle::DROP_DOWN;
props.push_back( aProp );
}
......
......@@ -189,7 +189,8 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
pVDev->SetFont( aFont );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr += OUString::number( ++mnCurFontId ) );
aCurIdStr += OUString::number( ++mnCurFontId );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", aUnitsPerEM );
{
......
......@@ -224,8 +224,8 @@ void SVGAttributeWriter::AddGradientDef( const tools::Rectangle& rObjRect, const
aEndColor.SetGreen( static_cast<sal_uInt8>( ( aEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100 ) );
aEndColor.SetBlue( static_cast<sal_uInt8>( ( aEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100 ) );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId,
( rGradientId = "Gradient_" ) += OUString::number( nCurGradientId++ ) );
rGradientId = "Gradient_" + OUString::number( nCurGradientId++ );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, rGradientId );
{
std::unique_ptr< SvXMLElementExport > apGradient;
......@@ -3705,11 +3705,14 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm,
mpVDev->Push();
Size aSize( OutputDevice::LogicToLogic(rSize100thmm, MapMode(MapUnit::Map100thMM), aMapMode) );
aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) );
aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) );
aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() );
aMapMode.SetScaleX( aFractionX );
aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() );
aMapMode.SetScaleY( aFractionY );
Point aOffset( OutputDevice::LogicToLogic(rPos100thmm, MapMode(MapUnit::Map100thMM), aMapMode ) );
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
aOffset += aMapMode.GetOrigin();
aMapMode.SetOrigin( aOffset );
mpVDev->SetMapMode( aMapMode );
......
......@@ -167,8 +167,8 @@ Calendar_gregorian::init(const Era *_eraArray)
* */
icu::Locale aIcuLocale( "", nullptr, nullptr, "calendar=gregorian");
UErrorCode status;
body.reset( icu::Calendar::createInstance( aIcuLocale, status = U_ZERO_ERROR) );
UErrorCode status = U_ZERO_ERROR;
body.reset( icu::Calendar::createInstance( aIcuLocale, status) );
if (!body || !U_SUCCESS(status)) throw ERROR;
eraArray=_eraArray;
}
......@@ -300,8 +300,8 @@ Calendar_gregorian::setDateTime( double fTimeInDays )
double fR = rtl::math::round( fM );
SAL_INFO_IF( fM != fR, "i18npool",
"Calendar_gregorian::setDateTime: " << std::fixed << fM << " rounded to " << fR);
UErrorCode status;
body->setTime( fR, status = U_ZERO_ERROR);
UErrorCode status = U_ZERO_ERROR;
body->setTime( fR, status);
if ( !U_SUCCESS(status) ) throw ERROR;
getValue();
}
......@@ -313,8 +313,8 @@ Calendar_gregorian::getDateTime()
setValue();
getValue();
}
UErrorCode status;
double fR = body->getTime(status = U_ZERO_ERROR);
UErrorCode status = U_ZERO_ERROR;
double fR = body->getTime(status);
if ( !U_SUCCESS(status) ) throw ERROR;
return fR / U_MILLIS_PER_DAY;
}
......@@ -328,10 +328,11 @@ Calendar_gregorian::setLocalDateTime( double fTimeInDays )
SAL_INFO_IF( fM != fR, "i18npool",
"Calendar_gregorian::setLocalDateTime: " << std::fixed << fM << " rounded to " << fR);
int32_t nZoneOffset, nDSTOffset;
UErrorCode status;
body->getTimeZone().getOffset( fR, TRUE, nZoneOffset, nDSTOffset, status = U_ZERO_ERROR );
UErrorCode status = U_ZERO_ERROR;
body->getTimeZone().getOffset( fR, TRUE, nZoneOffset, nDSTOffset, status );
if ( !U_SUCCESS(status) ) throw ERROR;
body->setTime( fR - (nZoneOffset + nDSTOffset), status = U_ZERO_ERROR );
status = U_ZERO_ERROR;
body->setTime( fR - (nZoneOffset + nDSTOffset), status );
if ( !U_SUCCESS(status) ) throw ERROR;
getValue();
}
......@@ -343,12 +344,14 @@ Calendar_gregorian::getLocalDateTime()
setValue();
getValue();
}
UErrorCode status;
double fTime = body->getTime( status = U_ZERO_ERROR );
UErrorCode status = U_ZERO_ERROR;
double fTime = body->getTime( status );
if ( !U_SUCCESS(status) ) throw ERROR;
int32_t nZoneOffset = body->get( UCAL_ZONE_OFFSET, status = U_ZERO_ERROR );
status = U_ZERO_ERROR;
int32_t nZoneOffset = body->get( UCAL_ZONE_OFFSET, status );
if ( !U_SUCCESS(status) ) throw ERROR;
int32_t nDSTOffset = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR );
status = U_ZERO_ERROR;
int32_t nDSTOffset = body->get( UCAL_DST_OFFSET, status );
if ( !U_SUCCESS(status) ) throw ERROR;
return (fTime + (nZoneOffset + nDSTOffset)) / U_MILLIS_PER_DAY;
}
......@@ -528,8 +531,9 @@ void Calendar_gregorian::getValue()
fieldIndex == CalendarFieldIndex::DST_OFFSET_SECOND_MILLIS)
continue; // not ICU fields
UErrorCode status; sal_Int32 value = body->get( fieldNameConverter(
fieldIndex), status = U_ZERO_ERROR);
UErrorCode status = U_ZERO_ERROR;
sal_Int32 value = body->get( fieldNameConverter(
fieldIndex), status);
if ( !U_SUCCESS(status) ) throw ERROR;
// Convert millisecond to minute for ZONE and DST and set remainder in
......@@ -579,8 +583,8 @@ void SAL_CALL
Calendar_gregorian::addValue( sal_Int16 fieldIndex, sal_Int32 value )
{
// since ZONE and DST could not be add, we don't need to convert value here
UErrorCode status;
body->add(fieldNameConverter(fieldIndex), value, status = U_ZERO_ERROR);
UErrorCode status = U_ZERO_ERROR;
body->add(fieldNameConverter(fieldIndex), value, status);
if ( !U_SUCCESS(status) ) throw ERROR;
getValue();
}
......
......@@ -86,7 +86,8 @@ CollatorImpl::loadCollatorAlgorithm(const OUString& impl, const lang::Locale& rL
if (!cachedItem)
throw RuntimeException(); // impl could not be loaded
cachedItem->xC->loadCollatorAlgorithm(cachedItem->algorithm, nLocale = rLocale, collatorOptions);
nLocale = rLocale;
cachedItem->xC->loadCollatorAlgorithm(cachedItem->algorithm, nLocale, collatorOptions);
return 0;
}
......
......@@ -227,8 +227,12 @@ public:
bool IsValid( SvxBoxInfoItemValidFlags nValid ) const
{ return bool( nValidFlags & nValid ); }
void SetValid( SvxBoxInfoItemValidFlags nValid, bool bValid = true )
{ bValid ? ( nValidFlags |= nValid )
: ( nValidFlags &= ~nValid ); }
{
if (bValid)
nValidFlags |= nValid;
else
nValidFlags &= ~nValid;
}
void ResetFlags();
};
......
......@@ -93,7 +93,7 @@ void LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
while(strlen)
{
strlen>1023?len=1023 :len=strlen;
len = std::min(sal_uInt16(1023), strlen);
len = pObjStrm->QuickRead(buf, len);
buf[len] = '\0';
strBuf.append( OUString(buf, len, aEncoding) );
......
......@@ -553,7 +553,7 @@ void Color::clearTransparence()
case XML_comp:
// comp: rotate hue by 180 degrees, do not change lum/sat
toHsl();
(mnC1 += 180 * PER_DEGREE) %= MAX_DEGREE;
mnC1 = (mnC1 + (180 * PER_DEGREE)) % MAX_DEGREE;
break;
case XML_inv:
// invert percentual RGB values
......
......@@ -682,7 +682,7 @@ bool StringHelper::convertFromDec( sal_Int64& ornData, const OUString& rData )
sal_Unicode cChar = rData[ nPos ];
if( (cChar < '0') || (cChar > '9') )
return false;
(ornData *= 10) += (cChar - '0');
ornData = (ornData * 10) + (cChar - '0');
}
if( bNeg )
ornData *= -1;
......@@ -703,7 +703,7 @@ bool StringHelper::convertFromHex( sal_Int64& ornData, const OUString& rData )
cChar -= ('a' - 10);
else
return false;
(ornData <<= 4) += cChar;
ornData = (ornData << 4) + cChar;
}
return true;
}
......
......@@ -785,7 +785,7 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper&
behaviour is reversed. This means that in this case
a focus of 0% swaps the gradient. */
if( fFocus < -0.5 || fFocus > 0.5 )
(nVmlAngle += 180) %= 360;
nVmlAngle = (nVmlAngle + 180) % 360;
// set the start and stop colors
lcl_setGradientStop( aFillProps.maGradientProps.maGradientStops, 0.0, aColor1 );
lcl_setGradientStop( aFillProps.maGradientProps.maGradientStops, 1.0, aColor2 );
......
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