Kaydet (Commit) 2e0a25ce authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantparam

Change-Id: Ic87f0cc863490858b7cc7e74a7f90ec31992dd53
Reviewed-on: https://gerrit.libreoffice.org/42089Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b02b3bcf
......@@ -36,8 +36,8 @@
#include <o3tl/make_unique.hxx>
#include <i18nutil/searchopt.hxx>
CommandCategoryListBox::CommandCategoryListBox(vcl::Window* pParent, WinBits nStyle)
: ListBox( pParent, nStyle)
CommandCategoryListBox::CommandCategoryListBox(vcl::Window* pParent)
: ListBox( pParent, WB_BORDER | WB_DROPDOWN)
{
SetDropDownLineCount(25);
......
......@@ -37,7 +37,7 @@ class CommandCategoryListBox : public ListBox
i18nutil::SearchOptions2 m_searchOptions;
public:
CommandCategoryListBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN );
CommandCategoryListBox( vcl::Window* pParent );
virtual ~CommandCategoryListBox() override;
virtual void dispose() override;
void ClearAll();
......
......@@ -150,7 +150,7 @@ DefItems::DefItems()
// Features
rDefItems[51] = new SfxVoidItem( EE_FEATURE_TAB );
rDefItems[52] = new SfxVoidItem( EE_FEATURE_LINEBR );
rDefItems[53] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV );
rDefItems[53] = new SvxCharSetColorItem( Color( COL_RED ), EE_FEATURE_NOTCONV );
rDefItems[54] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD );
assert(EDITITEMCOUNT == 55 && "ITEMCOUNT changed, adjust DefItems!");
......
......@@ -1813,11 +1813,10 @@ SvxCharSetColorItem::SvxCharSetColorItem( const sal_uInt16 nId ) :
SvxCharSetColorItem::SvxCharSetColorItem( const Color& rCol,
const rtl_TextEncoding _eFrom,
const sal_uInt16 nId ) :
SvxColorItem( rCol, nId ),
eFrom( _eFrom )
eFrom( RTL_TEXTENCODING_DONTKNOW )
{
}
......
......@@ -35,8 +35,7 @@ class EDITENG_DLLPUBLIC SvxCharSetColorItem : public SvxColorItem
rtl_TextEncoding eFrom;
public:
explicit SvxCharSetColorItem( const sal_uInt16 nId );
SvxCharSetColorItem( const Color& aColor, const rtl_TextEncoding eFrom,
const sal_uInt16 nId );
SvxCharSetColorItem( const Color& aColor, const sal_uInt16 nId );
// "pure virtual Methods" from SfxPoolItem
virtual bool GetPresentation( SfxItemPresentation ePres,
......
......@@ -169,7 +169,7 @@ public:
{ return IsItemPoolable( rItem.Which() ); }
void SetItemInfos( const SfxItemInfo *pInfos );
sal_uInt16 GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich, bool bDeep = true ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich ) const;
sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich ) const;
......
......@@ -88,7 +88,7 @@ public:
SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy );
bool operator==( const SvxMacroTableDtor& rOther ) const;
void Read( SvStream &, sal_uInt16 nVersion = SVX_MACROTBL_AKTVERSION );
void Read( SvStream & );
SvStream& Write( SvStream & ) const;
static sal_uInt16 GetVersion() { return SVX_MACROTBL_AKTVERSION; }
......
......@@ -287,7 +287,7 @@ public:
bool Read( SvStream& rInput, const TextSelection* pSel = nullptr );
bool Write( SvStream& rOutput, const TextSelection* pSel = nullptr, bool bHTML = false );
bool Write( SvStream& rOutput );
TextPaM GetPaM( const Point& rDocPos );
tools::Rectangle PaMtoEditCursor( const TextPaM& rPaM, bool bSpecial = false );
......
......@@ -338,12 +338,10 @@ void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const
|*
\************************************************************************/
SdOptionsContents::SdOptionsContents(bool bImpress, bool bUseConfig) :
SdOptionsGeneric( bImpress, bUseConfig ?
( bImpress ?
SdOptionsContents::SdOptionsContents(bool bImpress) :
SdOptionsGeneric( bImpress, bImpress ?
OUString( "Office.Impress/Content" ) :
OUString( "Office.Draw/Content" ) ) :
OUString() )
OUString( "Office.Draw/Content" ) )
{
EnableModify( true );
}
......@@ -1363,7 +1361,7 @@ void SdOptionsPrintItem::SetOptions( SdOptions* pOpts ) const
SdOptions::SdOptions(bool bImpress) :
SdOptionsLayout( bImpress, true ),
SdOptionsContents( bImpress, true ),
SdOptionsContents( bImpress ),
SdOptionsMisc( bImpress, true ),
SdOptionsSnap( bImpress, true ),
SdOptionsZoom( bImpress ),
......
......@@ -171,7 +171,7 @@ protected:
public:
SdOptionsContents(bool bImpress, bool bUseConfig);
SdOptionsContents(bool bImpress);
bool operator==( const SdOptionsContents& rOpt ) const;
};
......
......@@ -906,14 +906,14 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, bool bDeep ) const
}
sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, bool bDeep ) const
sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich ) const
{
if ( !IsWhich(nWhich) )
return nWhich;
if ( !IsInRange( nWhich ) )
{
if ( pImpl->mpSecondary && bDeep )
if ( pImpl->mpSecondary )
return pImpl->mpSecondary->GetSlotId(nWhich);
assert(false && "unknown WhichId - cannot get slot-id");
return 0;
......
......@@ -94,10 +94,10 @@ bool SvxMacroTableDtor::operator==( const SvxMacroTableDtor& rOther ) const
return true;
}
void SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion )
void SvxMacroTableDtor::Read( SvStream& rStrm )
{
if( SVX_MACROTBL_VERSION40 <= nVersion )
rStrm.ReadUInt16( nVersion );
sal_uInt16 nVersion;
rStrm.ReadUInt16( nVersion );
short nMacro(0);
rStrm.ReadInt16(nMacro);
......
......@@ -210,7 +210,7 @@ protected:
static vcl::Window* ImplCreateWindow( VCLXWindow** ppNewComp, const css::awt::WindowDescriptor& rDescriptor, vcl::Window* pParent,
WinBits nWinBits, MessBoxStyle nMessBoxStyle );
css::uno::Reference< css::awt::XWindowPeer > ImplCreateWindow( const css::awt::WindowDescriptor& Descriptor,
WinBits nForceWinBits, MessBoxStyle nForceMessBoxStyle );
MessBoxStyle nForceMessBoxStyle );
public:
......@@ -764,7 +764,7 @@ css::awt::Rectangle VCLXToolkit::getWorkArea( )
css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createWindow( const css::awt::WindowDescriptor& rDescriptor )
{
return ImplCreateWindow( rDescriptor, WinBits(0), MessBoxStyle::NONE );
return ImplCreateWindow( rDescriptor, MessBoxStyle::NONE );
}
css::uno::Reference< css::awt::XDevice > VCLXToolkit::createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height )
......@@ -1216,7 +1216,7 @@ extern "C" vcl::Window* SAL_CALL CreateWindow( VCLXWindow** ppNewComp, const css
css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
const css::awt::WindowDescriptor& rDescriptor,
WinBits nForceWinBits, MessBoxStyle nForceMessBoxStyle )
MessBoxStyle nForceMessBoxStyle )
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
......@@ -1238,7 +1238,6 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
std::pair<WinBits, MessBoxStyle> aPair = ImplGetWinBits( rDescriptor.WindowAttributes,
ImplGetComponentType( rDescriptor.WindowServiceName ) );
WinBits nWinBits = aPair.first;
nWinBits |= nForceWinBits;
aPair.second |= nForceMessBoxStyle;
VCLXWindow* pNewComp = nullptr;
......@@ -1468,7 +1467,7 @@ css::uno::Reference< css::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessage
aDescriptor.Parent = aParent;
aDescriptor.WindowAttributes = nWindowAttributes;
css::uno::Reference< css::awt::XMessageBox > xMsgBox(
ImplCreateWindow( aDescriptor, 0, nAddWinBits ), css::uno::UNO_QUERY );
ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY );
css::uno::Reference< css::awt::XWindow > xWindow( xMsgBox, css::uno::UNO_QUERY );
if ( xMsgBox.is() && xWindow.is() )
{
......
......@@ -2440,24 +2440,13 @@ bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
return rInput.GetError() == ERRCODE_NONE;
}
bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML )
bool TextEngine::Write( SvStream& rOutput )
{
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
const sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
TextNode* pNode = mpDoc->GetNodes()[ nParas - 1 ];
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().getLength() );
}
if ( bHTML )
{
rOutput.WriteLine( "<HTML>" );
rOutput.WriteLine( "<BODY>" );
}
const sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
TextNode* pSelNode = mpDoc->GetNodes()[ nParas - 1 ];
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pSelNode->GetText().getLength() );
for ( sal_uInt32 nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); ++nPara )
{
......@@ -2469,37 +2458,24 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML
? aSel.GetEnd().GetIndex() : pNode->GetText().getLength();
OUStringBuffer aText;
if ( !bHTML )
aText = "<P STYLE=\"margin-bottom: 0cm\">";
if ( nStartPos == nEndPos )
{
aText = pNode->GetText().copy( nStartPos, nEndPos-nStartPos );
// Empty lines will be removed by Writer
aText.append( "<BR>" );
}
else
{
aText = "<P STYLE=\"margin-bottom: 0cm\">";
if ( nStartPos == nEndPos )
{
// Empty lines will be removed by Writer
aText.append( "<BR>" );
}
else
{
// Text before Attribute
aText.append( pNode->GetText().copy( nStartPos, nEndPos-nStartPos ) );
}
aText.append( "</P>" );
// Text before Attribute
aText.append( pNode->GetText().copy( nStartPos, nEndPos-nStartPos ) );
}
aText.append( "</P>" );
rOutput.WriteLine(OUStringToOString(aText.makeStringAndClear(),
rOutput.GetStreamCharSet()));
}
if ( bHTML )
{
rOutput.WriteLine( "</BODY>" );
rOutput.WriteLine( "</HTML>" );
}
return rOutput.GetError() == ERRCODE_NONE;
}
......
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