[Libreoffice-commits] core.git: filter/source forms/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Jun 23 10:40:57 UTC 2017
filter/source/flash/swfwriter2.cxx | 5 ---
filter/source/graphicfilter/ieps/ieps.cxx | 2 -
filter/source/graphicfilter/itiff/itiff.cxx | 4 +-
filter/source/msfilter/escherex.cxx | 14 +++-------
filter/source/msfilter/mscodec.cxx | 2 -
filter/source/msfilter/msdffimp.cxx | 26 ++++++-------------
filter/source/msfilter/svdfppt.cxx | 3 --
filter/source/msfilter/util.cxx | 6 +---
filter/source/pdf/pdfexport.cxx | 3 --
filter/source/svg/svgexport.cxx | 3 --
filter/source/svg/svgfilter.cxx | 4 +-
filter/source/svg/svgimport.cxx | 4 +-
filter/source/t602/t602filter.cxx | 4 --
filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 6 +---
filter/source/xsltdialog/xmlfilterjar.cxx | 9 ++----
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 9 ++----
filter/source/xsltdialog/xmlfiltertestdialog.cxx | 6 +---
forms/source/component/imgprod.cxx | 3 --
forms/source/component/propertybaghelper.cxx | 2 -
forms/source/runtime/formoperations.cxx | 2 -
forms/source/solar/control/navtoolbar.cxx | 3 --
forms/source/xforms/binding.cxx | 3 --
forms/source/xforms/submission/submission_post.cxx | 3 --
forms/source/xforms/xpathlib/xpathlib.cxx | 2 -
24 files changed, 46 insertions(+), 82 deletions(-)
New commits:
commit 8c6b84c2c5834ab877c3edd96fd243606cfefe39
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Jun 23 10:23:07 2017 +0200
loplugin:oncevar filter..forms
Change-Id: I70a8ed6dbfe08b22dbf7b7b86e9518d73c5e393a
Reviewed-on: https://gerrit.libreoffice.org/39154
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx
index 5d8acaed1150..dd8b3d158ac5 100644
--- a/filter/source/flash/swfwriter2.cxx
+++ b/filter/source/flash/swfwriter2.cxx
@@ -594,12 +594,9 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const
aGradientRecords.push_back( GradRecord( 0x00, maGradient.GetEndColor() ) );
aGradientRecords.push_back( GradRecord( 0x80, maGradient.GetStartColor() ) );
aGradientRecords.push_back( GradRecord( 0xff, maGradient.GetEndColor() ) );
- double tx = ( 32768.0 / 2.0 );
- double ty = ( 32768.0 / 2.0 );
double scalex = (double)maBoundRect.GetWidth() / 32768.0;
double scaley = (double)maBoundRect.GetHeight() / 32768.0;
-
- m.translate( tx, ty );
+ m.translate( 32768.0 / 2.0, 32768.0 / 2.0 );
m.scale( scalex, scaley );
}
break;
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 81841d8b0891..845b5ea854ff 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -435,7 +435,7 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32
nSizeTIFF = aTIFFBuf.size();
SvMemoryStream aReplacement( nSizeWMF + nSizeTIFF + 28 );
- sal_uInt32 nMagic = 0xc6d3d0c5;
+ sal_uInt32 const nMagic = 0xc6d3d0c5;
sal_uInt32 nPPos = 28 + nSizeWMF + nSizeTIFF;
sal_uInt32 nWPos = nSizeWMF ? 28 : 0;
sal_uInt32 nTPos = nSizeTIFF ? 28 + nSizeWMF : 0;
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index af1707379a44..f785ab5a7666 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -373,7 +373,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
nNumStripOffsets = 0;
sal_uInt32 nOldNumSO = nNumStripOffsets;
nDataLen += nOldNumSO;
- size_t nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
+ size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
size_t nMaxRecordsAvailable = pTIFF->remainingSize() / DataTypeSize();
if (nDataLen > nOldNumSO && nDataLen < nMaxAllocAllowed &&
(nDataLen - nOldNumSO) <= nMaxRecordsAvailable)
@@ -421,7 +421,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
nNumStripByteCounts = 0; // to be on the safe side
sal_uInt32 nOldNumSBC = nNumStripByteCounts;
nDataLen += nOldNumSBC;
- size_t nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
+ size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / sizeof(sal_uInt32);
size_t nMaxRecordsAvailable = pTIFF->remainingSize() / DataTypeSize();
if (nDataLen > nOldNumSBC && nDataLen < nMaxAllocAllowed &&
(nDataLen - nOldNumSBC) <= nMaxRecordsAvailable)
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index bd42cd8cac1b..870e94373149 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1755,17 +1755,13 @@ tools::PolyPolygon EscherPropertyContainer::GetPolyPolygon( const css::uno::Refe
css::uno::Any aAny( rXShape->queryInterface(
cppu::UnoType<css::beans::XPropertySet>::get()));
- OUString sPolyPolygonBezier ( "PolyPolygonBezier" );
- OUString sPolyPolygon ( "PolyPolygon" );
- OUString sPolygon ( "Polygon" );
-
if ( aAny >>= aXPropSet )
{
- bool bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygonBezier, true );
+ bool bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "PolyPolygonBezier", true );
if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygon, true );
+ bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "PolyPolygon", true );
if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolygon, true );
+ bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "Polygon", true );
if ( bHasProperty )
aRetPolyPoly = GetPolyPolygon( aAny );
}
@@ -2231,8 +2227,8 @@ bool EscherPropertyContainer::CreateConnectorProperties(
rGeoRect.Width = -rGeoRect.Width;
}
}
- sal_uInt32 nAdjustValue1, nAdjustValue2, nAdjustValue3;
- nAdjustValue1 = nAdjustValue2 = nAdjustValue3 = 0x2a30;
+ sal_uInt32 nAdjustValue1, nAdjustValue2;
+ nAdjustValue1 = nAdjustValue2 = 0x2a30;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, "EdgeStartConnection" ) )
aAny >>= aShapeA;
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx
index 83dee6c37223..ede93598bfa5 100644
--- a/filter/source/msfilter/mscodec.cxx
+++ b/filter/source/msfilter/mscodec.cxx
@@ -360,7 +360,7 @@ void MSCodec_CryptoAPI::InitKey (
const sal_uInt16 pPassData[16],
const sal_uInt8 pDocId[16])
{
- sal_uInt32 saltSize = 16;
+ sal_uInt32 const saltSize = 16;
// Prepare initial data -> salt + password (in 16-bit chars)
std::vector<sal_uInt8> initialData(pDocId, pDocId + saltSize);
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index f4dca1e4c2e7..06b9fc1dde61 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -941,7 +941,6 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
rSet.Put(XLineStyleItem( drawing::LineStyle_SOLID ) );
else
{
- css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT;
sal_uInt16 nDots = 1;
sal_uInt32 nDotLen = nLineWidth / 360;
sal_uInt16 nDashes = 0;
@@ -997,7 +996,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
break;
}
- rSet.Put( XLineDashItem( OUString(), XDash( eDash, nDots, nDotLen, nDashes, nDashLen, nDistance ) ) );
+ rSet.Put( XLineDashItem( OUString(), XDash( css::drawing::DashStyle_RECT, nDots, nDotLen, nDashes, nDashLen, nDistance ) ) );
rSet.Put( XLineStyleItem( drawing::LineStyle_DASH ) );
}
rSet.Put( XLineColorItem( OUString(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_lineColor, 0 ) ) ) );
@@ -1974,26 +1973,23 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
if ( nFlags & SvxMSDffHandleFlags::MIRRORED_X )
{
- bool bMirroredX = true;
const OUString sHandleMirroredX( "MirroredX" );
aProp.Name = sHandleMirroredX;
- aProp.Value <<= bMirroredX;
+ aProp.Value <<= true;
aHandlePropVec.push_back( aProp );
}
if ( nFlags & SvxMSDffHandleFlags::MIRRORED_Y )
{
- bool bMirroredY = true;
const OUString sHandleMirroredY( "MirroredY" );
aProp.Name = sHandleMirroredY;
- aProp.Value <<= bMirroredY;
+ aProp.Value <<= true;
aHandlePropVec.push_back( aProp );
}
if ( nFlags & SvxMSDffHandleFlags::SWITCHED )
{
- bool bSwitched = true;
const OUString sHandleSwitched( "Switched" );
aProp.Name = sHandleSwitched;
- aProp.Value <<= bSwitched;
+ aProp.Value <<= true;
aHandlePropVec.push_back( aProp );
}
if ( nFlags & SvxMSDffHandleFlags::POLAR )
@@ -3952,9 +3948,9 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if( bGrfRead && !bLinkGrf && IsProperty( DFF_Prop_pictureId ) )
{
// TODO/LATER: in future probably the correct aspect should be provided here
- sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
// #i32596# - pass <nCalledByGroup> to method
- pRet = ImportOLE( GetPropertyValue( DFF_Prop_pictureId, 0 ), aGraf, rObjData.aBoundRect, aVisArea, rObjData.nCalledByGroup, nAspect );
+ pRet = ImportOLE( GetPropertyValue( DFF_Prop_pictureId, 0 ), aGraf, rObjData.aBoundRect, aVisArea, rObjData.nCalledByGroup,
+ embed::Aspects::MSOLE_CONTENT );
}
if( !pRet )
{
@@ -5269,7 +5265,6 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
bool bTVASet(false);
- SdrTextHorzAdjust eTHA = SDRTEXTHORZADJUST_CENTER;
bool bTHASet(false);
switch( eTextAnchor )
@@ -5316,7 +5311,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
if ( bTVASet )
aSet.Put( SdrTextVertAdjustItem( eTVA ) );
if ( bTHASet )
- aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
+ aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
}
pTextObj->SetMergedItemSet(aSet);
@@ -6575,9 +6570,6 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
xStm->SetVersion( pStor->GetVersion() );
xStm->SetBufferSize( 8192 );
- sal_uInt16 nAspect = ASPECT_CONTENT;
- sal_uLong nAdviseModes = 2;
-
Impl_OlePres aEle;
// Convert the size in 1/100 mm
// If a not applicable MapUnit (device dependent) is used,
@@ -6587,8 +6579,8 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
MapMode aMMDst( MapUnit::Map100thMM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
aEle.SetSize( aSize );
- aEle.SetAspect( nAspect );
- aEle.SetAdviseFlags( nAdviseModes );
+ aEle.SetAspect( ASPECT_CONTENT );
+ aEle.SetAdviseFlags( 2 );
aEle.SetMtf( rMtf );
aEle.Write( *xStm );
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index ea909435fbc0..ad37201db3a9 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5291,10 +5291,9 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHe
PPTCharPropSet aCharPropSet(0);
aCharPropSet.mnOriginalTextPos = 0;
- sal_uInt32 nCharAnzRead = 0;
sal_uInt32 nExtParaFlags = 0, nAnmScheme = 0;
sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
- ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
+ ReadCharProps( rIn, aCharPropSet, aString, nCharCount, 0/*nCharAnzRead*/,
bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
nBuBlip, nHasAnm, nAnmScheme );
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 047d6e486368..8ad5d92a4fdf 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -228,14 +228,13 @@ static const ApiPaperSize spPaperSizeTable[] =
sal_Int32 PaperSizeConv::getMSPaperSizeIndex( const css::awt::Size& rSize )
{
- sal_Int32 nElems = SAL_N_ELEMENTS( spPaperSizeTable );
// Need to find the best match for current size
sal_Int32 nDeltaWidth = 0;
sal_Int32 nDeltaHeight = 0;
sal_Int32 nPaperSizeIndex = 0; // Undefined
const ApiPaperSize* pItem = spPaperSizeTable;
- const ApiPaperSize* pEnd = spPaperSizeTable + nElems;
+ const ApiPaperSize* pEnd = spPaperSizeTable + SAL_N_ELEMENTS( spPaperSizeTable );
for ( ; pItem != pEnd; ++pItem )
{
sal_Int32 nCurDeltaHeight = std::abs( pItem->mnHeight - rSize.Height );
@@ -263,8 +262,7 @@ sal_Int32 PaperSizeConv::getMSPaperSizeIndex( const css::awt::Size& rSize )
const ApiPaperSize& PaperSizeConv::getApiSizeForMSPaperSizeIndex( sal_Int32 nMSOPaperIndex )
{
- sal_Int32 nElems = SAL_N_ELEMENTS( spPaperSizeTable );
- if ( nMSOPaperIndex < 0 || nMSOPaperIndex > nElems - 1 )
+ if ( nMSOPaperIndex < 0 || nMSOPaperIndex > sal_Int32(SAL_N_ELEMENTS( spPaperSizeTable )) - 1 )
return spPaperSizeTable[ 0 ];
return spPaperSizeTable[ nMSOPaperIndex ];
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 146566b9e97f..1d24b3e0bf5e 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1011,7 +1011,6 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData&
basegfx::B2DRange aRangePDF(aSizePDF.getB2DRange());
Point aOrigin;
tools::Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
- bool bRet = true;
rWriter.NewPage( aRangePDF.getWidth(), aRangePDF.getHeight() );
rWriter.SetMapMode( rMtf.GetPrefMapMode() );
@@ -1043,7 +1042,7 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData&
if (!msWatermark.isEmpty())
ImplWriteWatermark( rWriter, Size(aRangePDF.getWidth(), aRangePDF.getHeight()) );
- return bRet;
+ return true;
}
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 2f3537539c6b..75fe00dce7f6 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1236,8 +1236,7 @@ void SVGFilter::implEmbedBulletGlyph( sal_Unicode cBullet, const OUString & sPat
OUString sId = "bullet-char-template-" + OUString::number( (sal_Int32)cBullet );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
- double fFactor = 1.0 / 2048;
- OUString sFactor = OUString::number( fFactor );
+ OUString sFactor = OUString::number( 1.0 / 2048 );
OUString sTransform = "scale(" + sFactor + ",-" + sFactor + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "transform", sTransform );
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 88e0525cc4cc..794fbd8ba502 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -326,13 +326,13 @@ bool SVGFilter::isStreamSvg(const uno::Reference<io::XInputStream>& xInput)
const sal_Int8* pBuffer = aBuffer.getConstArray();
sal_Int8 aMagic1[] = {'<', 's', 'v', 'g'};
- sal_Int32 aMagic1Size = SAL_N_ELEMENTS(aMagic1);
+ sal_Int32 const aMagic1Size = SAL_N_ELEMENTS(aMagic1);
if (std::search(pBuffer, pBuffer + nBytes, aMagic1, aMagic1 + aMagic1Size) != pBuffer + nBytes )
return true;
sal_Int8 aMagic2[] = {'D', 'O', 'C', 'T', 'Y', 'P', 'E', ' ', 's', 'v', 'g'};
- sal_Int32 aMagic2Size = SAL_N_ELEMENTS(aMagic2);
+ sal_Int32 const aMagic2Size = SAL_N_ELEMENTS(aMagic2);
return std::search(pBuffer, pBuffer + nBytes, aMagic2, aMagic2 + aMagic2Size) != pBuffer + nBytes;
}
diff --git a/filter/source/svg/svgimport.cxx b/filter/source/svg/svgimport.cxx
index 445d233fe6d5..6a9dc5c5f93b 100644
--- a/filter/source/svg/svgimport.cxx
+++ b/filter/source/svg/svgimport.cxx
@@ -89,8 +89,8 @@ bool SVGFilter::implImport(const Sequence< PropertyValue >& rDescriptor)
if(!xInputStream.is())
return false;
- OUString sXMLImportService ( "com.sun.star.comp.Draw.XMLOasisImporter" );
- Reference < XDocumentHandler > xInternalHandler( mxContext->getServiceManager()->createInstanceWithContext( sXMLImportService, mxContext ), UNO_QUERY );
+ Reference < XDocumentHandler > xInternalHandler(
+ mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.Draw.XMLOasisImporter", mxContext ), UNO_QUERY );
// The XImporter sets up an empty target document for XDocumentHandler to write to..
uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index d2df9c10b516..b5cebf5ec5fd 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -248,9 +248,7 @@ bool SAL_CALL T602ImportFilter::importImpl( const Sequence< css::beans::Property
}
// An XML import service: what we push sax messages to..
- OUString sXMLImportService ( "com.sun.star.comp.Writer.XMLImporter" );
-
- mxHandler.set( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
+ mxHandler.set( mxMSF->createInstance( "com.sun.star.comp.Writer.XMLImporter" ), UNO_QUERY );
// The XImporter sets up an empty target document for XDocumentHandler to write to..
Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 6266e2f113fd..84277d3b95c0 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -64,14 +64,13 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
OUString udConvertClass = msUserData[0];
const OUString sXMLImportService = msUserData[2];
sal_Int32 nSteps= 0;
- sal_Int32 nProgressRange = 4;
utl::MediaDescriptor aMediaMap(aDescriptor);
Reference< XStatusIndicator > xStatusIndicator(aMediaMap.getUnpackedValueOrDefault(
utl::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >()));
if (xStatusIndicator.is()){
- xStatusIndicator->start( "Loading :",nProgressRange);
+ xStatusIndicator->start( "Loading :", 4);
}
Sequence< Any > aAnys(1);
@@ -182,13 +181,12 @@ bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< css::beans::Property
// Status Bar
sal_Int32 nSteps= 1;
- sal_Int32 nProgressRange(3);
utl::MediaDescriptor aMediaMap(aDescriptor);
Reference< XStatusIndicator > xStatusIndicator(aMediaMap.getUnpackedValueOrDefault(
utl::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >()));
if (xStatusIndicator.is())
- xStatusIndicator->start( "Saving :",nProgressRange);
+ xStatusIndicator->start( "Saving :", 3);
// Set up converter bridge.
Reference< css::xml::XExportFilter > xConverter(mxContext->getServiceManager()->createInstanceWithContext( udConvertClass, mxContext ), UNO_QUERY);
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index 599f3e9091d7..84ca45e96aef 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -165,8 +165,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt
// get root zip folder
Reference< XInterface > xRootFolder;
- OUString szRootFolder("/");
- xIfc->getByHierarchicalName( szRootFolder ) >>= xRootFolder;
+ xIfc->getByHierarchicalName( "/" ) >>= xRootFolder;
// export filters files
XMLFilterVector::const_iterator aIter( rFilters.begin() );
@@ -214,8 +213,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt
}
Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, StreamMode::READ ), true ) );
- OUString szTypeDetection( "TypeDetection.xcu" );
- addFile_( xRootFolder, xFactory, XIS, szTypeDetection );
+ addFile_( xRootFolder, xFactory, XIS, "TypeDetection.xcu" );
Reference< XChangesBatch > xBatch( xIfc, UNO_QUERY );
if( xBatch.is() )
@@ -259,8 +257,7 @@ void XMLFilterJarHelper::openPackage( const OUString& rPackageURL, XMLFilterVect
{
// get root zip folder
Reference< XInterface > xRootFolder;
- OUString szRootFolder("/");
- xIfc->getByHierarchicalName( szRootFolder ) >>= xRootFolder;
+ xIfc->getByHierarchicalName( "/" ) >>= xRootFolder;
OUString szTypeDetection("TypeDetection.xcu");
if( xIfc->hasByHierarchicalName( szTypeDetection ) )
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index dbf14e752ceb..f1da2804e979 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -352,13 +352,12 @@ static Sequence< OUString > createExtensionsSequence( const OUString& rExtension
OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilterName )
{
OUString aFilterName( rFilterName );
- OUString aSpace(" ");
sal_Int32 nId = 2;
while( mxFilterContainer->hasByName( aFilterName ) )
{
- aFilterName = rFilterName + aSpace + OUString::number( nId++ );
+ aFilterName = rFilterName + " " + OUString::number( nId++ );
}
return aFilterName;
@@ -369,13 +368,12 @@ OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilte
OUString XMLFilterSettingsDialog::createUniqueTypeName( const OUString& rTypeName )
{
OUString aTypeName( rTypeName );
- OUString aSpace(" ");
sal_Int32 nId = 2;
while( mxFilterContainer->hasByName( aTypeName ) )
{
- aTypeName = rTypeName + aSpace + OUString::number( nId++ );
+ aTypeName = rTypeName + " " + OUString::number( nId++ );
}
return aTypeName;
@@ -804,9 +802,8 @@ void XMLFilterSettingsDialog::onDelete()
{
filter_info_impl* pInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
- OUString aPlaceHolder( "%s" );
OUString aMessage(XsltResId(STR_WARN_DELETE));
- aMessage = aMessage.replaceFirst( aPlaceHolder, pInfo->maFilterName );
+ aMessage = aMessage.replaceFirst( "%s", pInfo->maFilterName );
ScopedVclPtrInstance< WarningBox > aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage );
if( aWarnBox->Execute() == RET_YES )
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index bc07a5ae176d..66daa63b3778 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -413,11 +413,10 @@ void XMLFilterTestDialog::onExportBrowse()
Reference< XDesktop2 > xLoader = Desktop::create( mxContext );
Reference< XInteractionHandler2 > xInter = InteractionHandler::createWithParent(mxContext, nullptr);
- OUString aFrame( "_default" );
Sequence< PropertyValue > aArguments(1);
aArguments[0].Name = "InteractionHandler";
aArguments[0].Value <<= xInter;
- Reference< XComponent > xComp( xLoader->loadComponentFromURL( m_sExportRecentFile, aFrame, 0, aArguments ) );
+ Reference< XComponent > xComp( xLoader->loadComponentFromURL( m_sExportRecentFile, "_default", 0, aArguments ) );
if( xComp.is() )
{
doExport( xComp );
@@ -591,14 +590,13 @@ void XMLFilterTestDialog::import( const OUString& rURL )
Reference< XDesktop2 > xLoader = Desktop::create( mxContext );
Reference< XInteractionHandler2 > xInter = InteractionHandler::createWithParent(mxContext, nullptr);
- OUString aFrame( "_default" );
Sequence< PropertyValue > aArguments(2);
aArguments[0].Name = "FilterName";
aArguments[0].Value <<= m_pFilterInfo->maFilterName;
aArguments[1].Name = "InteractionHandler";
aArguments[1].Value <<= xInter;
- xLoader->loadComponentFromURL( rURL, aFrame, 0, aArguments );
+ xLoader->loadComponentFromURL( rURL, "_default", 0, aArguments );
if( m_pCBXDisplaySource->IsChecked() )
{
diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx
index dc18ff8edc76..b49bbfd82678 100644
--- a/forms/source/component/imgprod.cxx
+++ b/forms/source/component/imgprod.cxx
@@ -95,7 +95,6 @@ ErrCode ImgProdLockBytes::ReadAt(sal_uInt64 const nPos,
else
{
const std::size_t nSeqLen = maSeq.getLength();
- ErrCode nErr = ERRCODE_NONE;
if( nPos < nSeqLen )
{
@@ -108,7 +107,7 @@ ErrCode ImgProdLockBytes::ReadAt(sal_uInt64 const nPos,
else
*pRead = 0UL;
- return nErr;
+ return ERRCODE_NONE;
}
}
diff --git a/forms/source/component/propertybaghelper.cxx b/forms/source/component/propertybaghelper.cxx
index 49a10ee95a99..c9f5ca0e4016 100644
--- a/forms/source/component/propertybaghelper.cxx
+++ b/forms/source/component/propertybaghelper.cxx
@@ -114,7 +114,7 @@ namespace frm
// search a free handle in <math>F_1009</math>
if ( nHandle == -1 )
{
- sal_Int32 nPrime = 1009;
+ sal_Int32 const nPrime = 1009;
sal_Int32 nFactor = 11;
sal_Int32 nNum = nFactor;
while ( nNum != 1 )
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 665c61a8631f..011f6ce135b1 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -1184,7 +1184,7 @@ namespace frm
FormFeature::SaveRecordChanges,
FormFeature::UndoRecordChanges
};
- size_t nFeatureCount = SAL_N_ELEMENTS( pModifyDependentFeatures );
+ size_t const nFeatureCount = SAL_N_ELEMENTS( pModifyDependentFeatures );
s_aModifyDependentFeatures = Sequence< sal_Int16 >( pModifyDependentFeatures, nFeatureCount );
}
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index 169ceb3ff635..dd183941eb61 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -270,9 +270,8 @@ namespace frm
{ FormFeature::RemoveFilterAndSort, false, false },
};
- size_t nSupportedFeatures = SAL_N_ELEMENTS( aSupportedFeatures );
FeatureDescription* pSupportedFeatures = aSupportedFeatures;
- FeatureDescription* pSupportedFeaturesEnd = aSupportedFeatures + nSupportedFeatures;
+ FeatureDescription* pSupportedFeaturesEnd = aSupportedFeatures + SAL_N_ELEMENTS( aSupportedFeatures );
for ( ; pSupportedFeatures < pSupportedFeaturesEnd; ++pSupportedFeatures )
{
if ( pSupportedFeatures->nId )
diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx
index 75e4f0de1817..440309f7b656 100644
--- a/forms/source/xforms/binding.cxx
+++ b/forms/source/xforms/binding.cxx
@@ -707,9 +707,8 @@ void Binding::valueModified()
void Binding::distributeMIP( const css::uno::Reference<css::xml::dom::XNode> & rxNode ) {
- OUString sEventName("xforms-generic");
css::xforms::XFormsEventConcrete *pEvent = new css::xforms::XFormsEventConcrete;
- pEvent->initXFormsEvent(sEventName, true, false);
+ pEvent->initXFormsEvent("xforms-generic", true, false);
Reference<XEvent> xEvent(pEvent);
// naive depth-first traversal
diff --git a/forms/source/xforms/submission/submission_post.cxx b/forms/source/xforms/submission/submission_post.cxx
index db9b868b26fc..d055de2d6a62 100644
--- a/forms/source/xforms/submission/submission_post.cxx
+++ b/forms/source/xforms/submission/submission_post.cxx
@@ -53,7 +53,6 @@ CSubmission::SubmissionResult CSubmissionPost::submit(const css::uno::Reference<
ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::DecodeMechanism::NONE), aEnvironment, comphelper::getProcessComponentContext());
// use post command
- OUString aCommandName("post");
PostCommandArgument2 aPostArgument;
aPostArgument.Source = apSerialization->getInputStream();
css::uno::Reference< XActiveDataSink > aSink(new ucbhelper::ActiveDataSink);
@@ -62,7 +61,7 @@ CSubmission::SubmissionResult CSubmissionPost::submit(const css::uno::Reference<
aPostArgument.Referer.clear();
Any aCommandArgument;
aCommandArgument <<= aPostArgument;
- aContent.executeCommand( aCommandName, aCommandArgument);
+ aContent.executeCommand( "post", aCommandArgument);
try {
m_aResultStream = aSink->getInputStream();
diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx
index b5e498266c41..c60f5bdd10e5 100644
--- a/forms/source/xforms/xpathlib/xpathlib.cxx
+++ b/forms/source/xforms/xpathlib/xpathlib.cxx
@@ -294,7 +294,7 @@ static bool parseDateTime(const OUString& aString, DateTime& aDateTime)
return false;
sal_Int32 nDateLength = 10;
- sal_Int32 nTimeLength = 8;
+ sal_Int32 const nTimeLength = 8;
OUString aDateString = aDateTimeString.copy(0, nDateLength);
OUString aTimeString = aDateTimeString.copy(nDateLength+1, nTimeLength);
More information about the Libreoffice-commits
mailing list