Kaydet (Commit) 693d40fe authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantparam in oox,registry,reportdesign

Change-Id: I914fa6c6ef2f660eb6b8570c9c5f86cef477be80
Reviewed-on: https://gerrit.libreoffice.org/44093Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c0cf07d3
......@@ -130,8 +130,7 @@ namespace OleHelper
*/
OOX_DLLPUBLIC bool importStdPic(
StreamDataSequence& orGraphicData,
BinaryInputStream& rInStrm,
bool bWithGuid );
BinaryInputStream& rInStrm );
}
class OOX_DLLPUBLIC OleFormCtrlExportHelper final
......
......@@ -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 ) :
......
......@@ -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;
}
......
......@@ -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 );
}
}
......
......@@ -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;
......
......@@ -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.
......
......@@ -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()
......
......@@ -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()
......
......@@ -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;
......
......@@ -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);
......
......@@ -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:
......
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