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