summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 08:50:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 12:58:31 +0100
commit693d40fed862614e05fbad167f7f09005683d6da (patch)
treea908faedb0c82264de7051a30cfded2c9e6e3289
parentc0cf07d3da5245e594f8f1ad11479e85bd15b88f (diff)
loplugin:constantparam in oox,registry,reportdesign
Change-Id: I914fa6c6ef2f660eb6b8570c9c5f86cef477be80 Reviewed-on: https://gerrit.libreoffice.org/44093 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/oox/ole/olehelper.hxx3
-rw-r--r--oox/source/ole/axbinaryreader.cxx2
-rw-r--r--oox/source/ole/axbinarywriter.cxx6
-rw-r--r--oox/source/ole/axcontrol.cxx8
-rw-r--r--oox/source/ole/olehelper.cxx13
-rw-r--r--registry/inc/regapi.hxx6
-rw-r--r--registry/source/reflread.cxx6
-rw-r--r--registry/source/reflwrit.cxx8
-rw-r--r--registry/source/registry.cxx5
-rw-r--r--registry/tools/regview.cxx2
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx8
11 files changed, 29 insertions, 38 deletions
diff --git a/include/oox/ole/olehelper.hxx b/include/oox/ole/olehelper.hxx
index 128b49796334..1a34748f79ee 100644
--- a/include/oox/ole/olehelper.hxx
+++ b/include/oox/ole/olehelper.hxx
@@ -130,8 +130,7 @@ namespace OleHelper
*/
OOX_DLLPUBLIC bool importStdPic(
StreamDataSequence& orGraphicData,
- BinaryInputStream& rInStrm,
- bool bWithGuid );
+ BinaryInputStream& rInStrm );
}
class OOX_DLLPUBLIC OleFormCtrlExportHelper final
diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx
index 9c9cb5db7c17..5a1ae682df11 100644
--- a/oox/source/ole/axbinaryreader.cxx
+++ b/oox/source/ole/axbinaryreader.cxx
@@ -168,7 +168,7 @@ bool AxBinaryPropertyReader::FontProperty::readProperty( AxAlignedInputStream& r
bool AxBinaryPropertyReader::PictureProperty::readProperty( AxAlignedInputStream& rInStrm )
{
- return OleHelper::importStdPic( mrPicData, rInStrm, true );
+ return OleHelper::importStdPic( mrPicData, rInStrm );
}
AxBinaryPropertyReader::AxBinaryPropertyReader( BinaryInputStream& rInStrm, bool b64BitPropFlags ) :
diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx
index 0feeb9dc71c8..a0e4b83f23ce 100644
--- a/oox/source/ole/axbinarywriter.cxx
+++ b/oox/source/ole/axbinarywriter.cxx
@@ -86,10 +86,10 @@ void AxAlignedOutputStream::align( size_t nSize )
namespace {
-void lclWriteString( AxAlignedOutputStream& rOutStrm, OUString const & rValue, sal_uInt32 nSize, bool bArrayString )
+void lclWriteString( AxAlignedOutputStream& rOutStrm, OUString const & rValue, sal_uInt32 nSize )
{
bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED );
- rOutStrm.writeCompressedUnicodeArray( rValue, bCompressed || bArrayString );
+ rOutStrm.writeCompressedUnicodeArray( rValue, bCompressed );
}
} // namespace
@@ -106,7 +106,7 @@ bool AxBinaryPropertyWriter::PairProperty::writeProperty( AxAlignedOutputStream&
bool AxBinaryPropertyWriter::StringProperty::writeProperty( AxAlignedOutputStream& rOutStrm )
{
- lclWriteString( rOutStrm, mrValue, mnSize, false );
+ lclWriteString( rOutStrm, mrValue, mnSize );
return true;
}
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 326931b674fe..7ab805691c82 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -743,7 +743,7 @@ bool ComCtlModelBase::importComplexPart( BinaryInputStream& rInStrm )
sal_uInt32 nContFlags = rInStrm.readuInt32();
bool bReadOk =
(!getFlag( nContFlags, COMCTL_COMPLEX_FONT ) || OleHelper::importStdFont( maFontData, rInStrm, true )) &&
- (!getFlag( nContFlags, COMCTL_COMPLEX_MOUSEICON ) || OleHelper::importStdPic( maMouseIcon, rInStrm, true ));
+ (!getFlag( nContFlags, COMCTL_COMPLEX_MOUSEICON ) || OleHelper::importStdPic( maMouseIcon, rInStrm ));
return bReadOk && !rInStrm.isEof();
}
return false;
@@ -978,7 +978,7 @@ void AxCommandButtonModel::importPictureData( sal_Int32 nPropId, BinaryInputStre
{
switch( nPropId )
{
- case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm, true ); break;
+ case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
default: AxFontDataModel::importPictureData( nPropId, rInStrm );
}
}
@@ -1242,7 +1242,7 @@ void AxImageModel::importPictureData( sal_Int32 nPropId, BinaryInputStream& rInS
{
switch( nPropId )
{
- case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm, true ); break;
+ case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
default: AxControlModelBase::importPictureData( nPropId, rInStrm );
}
}
@@ -1426,7 +1426,7 @@ void AxMorphDataModelBase::importPictureData( sal_Int32 nPropId, BinaryInputStre
{
switch( nPropId )
{
- case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm, true ); break;
+ case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
default: AxFontDataModel::importPictureData( nPropId, rInStrm );
}
}
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index d1090c6421aa..27703ef6c537 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -300,15 +300,12 @@ bool OleHelper::importStdFont( StdFontInfo& orFontInfo, BinaryInputStream& rInSt
return !rInStrm.isEof() && (nVersion <= 1);
}
-bool OleHelper::importStdPic( StreamDataSequence& orGraphicData, BinaryInputStream& rInStrm, bool bWithGuid )
+bool OleHelper::importStdPic( StreamDataSequence& orGraphicData, BinaryInputStream& rInStrm )
{
- if( bWithGuid )
- {
- bool bIsStdPic = importGuid( rInStrm ) == OLE_GUID_STDPIC;
- OSL_ENSURE( bIsStdPic, "OleHelper::importStdPic - unexpected header GUID, expected StdPic" );
- if( !bIsStdPic )
- return false;
- }
+ bool bIsStdPic = importGuid( rInStrm ) == OLE_GUID_STDPIC;
+ OSL_ENSURE( bIsStdPic, "OleHelper::importStdPic - unexpected header GUID, expected StdPic" );
+ if( !bIsStdPic )
+ return false;
sal_uInt32 nStdPicId;
sal_Int32 nBytes;
diff --git a/registry/inc/regapi.hxx b/registry/inc/regapi.hxx
index 31bf1d8ee219..35c4ddda35a9 100644
--- a/registry/inc/regapi.hxx
+++ b/registry/inc/regapi.hxx
@@ -59,16 +59,14 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRootKey(RegHandle hRegistry,
RegKeyHandle* phRootKey);
-/** This function opens a registry with the specified name.
+/** This function opens a registry with the specified name. in readonly mode.
@param registryName points to a null terminated string specifying the name of the registry.
@param phRegistry points to a handle of the opened registry if the function succeeds otherwise NULL.
- @param accessMode specifies the accessmode of the registry, RegAccessMode::READONLY or RegAccessMode::READWRITE.
@return REG_NO_ERROR if succeeds else an error code.
*/
REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
- RegHandle* phRegistry,
- RegAccessMode accessMode);
+ RegHandle* phRegistry);
/** This function closes a registry.
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 7065adea01cb..1a06dab771e3 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -1237,10 +1237,10 @@ bool TYPEREG_CALLTYPE typereg_reader_create(
}
}
-static TypeReaderImpl TYPEREG_CALLTYPE createEntry(const sal_uInt8* buffer, sal_uInt32 len, bool copyBuffer)
+static TypeReaderImpl TYPEREG_CALLTYPE createEntry(const sal_uInt8* buffer, sal_uInt32 len)
{
void * handle;
- typereg_reader_create(buffer, len, copyBuffer, TYPEREG_VERSION_1, &handle);
+ typereg_reader_create(buffer, len, false/*copyBuffer*/, TYPEREG_VERSION_1, &handle);
return handle;
}
@@ -1718,7 +1718,7 @@ RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
sal_uInt32 bufferLen)
: m_hImpl(nullptr)
{
- m_hImpl = createEntry(buffer, bufferLen, false/*copyData*/);
+ m_hImpl = createEntry(buffer, bufferLen);
}
RegistryTypeReader::~RegistryTypeReader()
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index c729029b6e3b..fd57ebc2047a 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1282,14 +1282,14 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setSuperTypeName(
static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
RTTypeClass typeClass, rtl_uString const * typeName, rtl_uString const * superTypeName,
- sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount)
+ sal_uInt16 fieldCount)
{
OUString empty;
sal_uInt16 superTypeCount = rtl_uString_getLength(superTypeName) == 0
? 0 : 1;
TypeWriterImpl t = typereg_writer_create(
TYPEREG_VERSION_0, empty.pData, empty.pData, typeClass, false, typeName,
- superTypeCount, fieldCount, methodCount, referenceCount);
+ superTypeCount, fieldCount, 0/*methodCount*/, 0/*referenceCount*/);
if (superTypeCount > 0) {
typereg_writer_setSuperTypeName(t, 0, superTypeName);
}
@@ -1307,9 +1307,7 @@ RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass,
m_hImpl = createEntry(RTTypeClass,
typeName.pData,
superTypeName.pData,
- fieldCount,
- 0,
- 0);
+ fieldCount);
}
RegistryTypeWriter::~RegistryTypeWriter()
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index 157887d9d28c..61b2c7ba1445 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -357,13 +357,12 @@ RegError REGISTRY_CALLTYPE reg_openRootKey(RegHandle hRegistry,
// reg_openRegistry
RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
- RegHandle* phRegistry,
- RegAccessMode accessMode)
+ RegHandle* phRegistry)
{
RegError _ret;
ORegistry* pReg = new ORegistry();
- if ((_ret = pReg->initRegistry(registryName, accessMode)) != RegError::NO_ERROR)
+ if ((_ret = pReg->initRegistry(registryName, RegAccessMode::READONLY)) != RegError::NO_ERROR)
{
delete pReg;
*phRegistry = nullptr;
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index 178289fc297d..56aa343f4254 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -46,7 +46,7 @@ int __cdecl main( int argc, char * argv[] )
}
OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
- if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY) != RegError::NO_ERROR)
+ if (reg_openRegistry(regName.pData, &hReg) != RegError::NO_ERROR)
{
fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
exit(1);
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 3bf1d24d4b32..3479f3bfdfc7 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -54,7 +54,7 @@ namespace rptui
using namespace ::com::sun::star;
using namespace ::comphelper;
-bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification, bool _bBoundRects)
+bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification)
{
bool bMoveAllowed = _nXMov != 0 || _nYMov != 0;
if ( bMoveAllowed )
@@ -80,7 +80,7 @@ bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _n
pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj);
if ( pOverlappedObj && _pObj != pOverlappedObj )
{
- tools::Rectangle aOverlappingRect = (_bBoundRects ? pOverlappedObj->GetCurrentBoundRect() : pOverlappedObj->GetSnapRect());
+ tools::Rectangle aOverlappingRect = pOverlappedObj->GetSnapRect();
sal_Int32 nXTemp = _nXMov;
sal_Int32 nYTemp = _nYMov;
switch(_nControlModification)
@@ -842,7 +842,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
*pValue = aGetFun(&aBound) - aGetFun(&aObjRect);
}
- if ( lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification,false) )
+ if ( lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification) )
{
const Size aSize(nXMov,nYMov);
pView->AddUndo(pView->GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,aSize));
@@ -863,7 +863,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
nXMov = aObjRect.getWidth();
else if ( _nControlModification == ControlModification::WIDTH_GREATEST )
nYMov = aObjRect.getHeight();
- lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification,false);
+ lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification);
SAL_FALLTHROUGH;
case ControlModification::WIDTH_SMALLEST:
case ControlModification::HEIGHT_SMALLEST: