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

loplugin:constantparam in linguistic..sfx2

Change-Id: I0e8c506df0beb0b05d9c32723876b11b6577280a
Reviewed-on: https://gerrit.libreoffice.org/50938Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ae510e67
......@@ -1038,13 +1038,12 @@ VclPtr<AbstractSvxSearchSimilarityDialog> AbstractDialogFactory_Impl::CreateSvxS
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
const SfxItemSet& rCoreSet,
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles)
{
VclPtrInstance<SvxBorderBackgroundDlg> pDlg(
pParent,
rCoreSet,
bEnableSelector,
/*bEnableSelector*/true,
bEnableDrawingLayerFillStyles);
return VclPtr<CuiAbstractTabDialog_Impl>::Create(pDlg);
......
......@@ -519,8 +519,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
const SfxItemSet& rCoreSet,
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles = false) override;
bool bEnableDrawingLayerFillStyles) override;
virtual VclPtr<AbstractSvxTransformTabDialog> CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
......
......@@ -216,7 +216,7 @@ public:
void WriteLinespacing( const css::style::LineSpacing& rLineSpacing );
OUString WriteBlip( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet,
const OUString& rURL, bool bRelPathToMedia, const Graphic *pGraphic=nullptr );
const OUString& rURL, bool bRelPathToMedia );
OUString WriteXGraphicBlip(css::uno::Reference<css::beans::XPropertySet> const & rXPropSet,
css::uno::Reference<css::graphic::XGraphic> const & rxGraphic,
......
......@@ -163,15 +163,12 @@ public:
OUString readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding eTextEnc );
/** Reads a Unicode character array and returns the string.
NUL characters are replaced by question marks (default).
@param nChars
Number of 16-bit characters to read from the stream.
@param bAllowNulChars
True = NUL characters are inserted into the imported string.
False = NUL characters are replaced by question marks (default).
*/
OUString readUnicodeArray( sal_Int32 nChars, bool bAllowNulChars = false );
OUString readUnicodeArray( sal_Int32 nChars );
/** Reads a Unicode character array (may be compressed) and returns the
string.
......
......@@ -480,7 +480,7 @@ public:
virtual ~CustomPropertiesControl() override;
virtual void dispose() override;
void AddLine(const OUString& sName, css::uno::Any const & rAny, bool bInteractive);
void AddLine(css::uno::Any const & rAny);
bool AreAllLinesValid() const { return m_pPropertiesWin->AreAllLinesValid(); }
void ClearAllLines() { m_pPropertiesWin->ClearAllLines(); }
......
......@@ -246,7 +246,6 @@ public:
ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
sal_Int16 nDialogType,
FileDialogFlags nFlags,
const OUString& rFact,
std::vector<OUString>& rpURLList,
OUString& rFilter,
SfxItemSet *& rpSet,
......
......@@ -86,8 +86,7 @@ friend class SfxStyleDialog;
virtual bool FillItemSet(SfxItemSet *) override;
virtual void Reset(const SfxItemSet *) override;
static bool Execute_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr,
sal_uInt16 nFamily );
static bool Execute_Impl( sal_uInt16 nId, const OUString& rStr, sal_uInt16 nFamily );
using TabPage::ActivatePage;
virtual void ActivatePage(const SfxItemSet &) override;
using TabPage::DeactivatePage;
......
......@@ -380,8 +380,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
const SfxItemSet& rCoreSet,
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles = false) = 0;
bool bEnableDrawingLayerFillStyles) = 0;
virtual VclPtr<AbstractSvxTransformTabDialog> CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
......
......@@ -41,15 +41,15 @@ using namespace com::sun::star;
/// @see GetDictionaryPaths
enum class DictionaryPathFlags
{
NONE = 0x00,
INTERNAL = 0x01,
USER = 0x02,
WRITABLE = 0x04
};
namespace o3tl
{
template<> struct typed_flags<DictionaryPathFlags> : is_typed_flags<DictionaryPathFlags, 0x07> {};
template<> struct typed_flags<DictionaryPathFlags> : is_typed_flags<DictionaryPathFlags, 0x03> {};
}
#define PATH_FLAG_ALL (DictionaryPathFlags::INTERNAL | DictionaryPathFlags::USER | DictionaryPathFlags::WRITABLE)
#define PATH_FLAG_ALL (DictionaryPathFlags::INTERNAL | DictionaryPathFlags::USER)
namespace linguistic
{
......@@ -112,7 +112,7 @@ static std::vector< OUString > GetMultiPaths_Impl(
++nMaxEntries;
aRes.resize( nMaxEntries );
sal_Int32 nCount = 0; // number of actually added entries
if ((nPathFlags & DictionaryPathFlags::WRITABLE) && !aWritablePath.isEmpty())
if (!aWritablePath.isEmpty())
aRes[ nCount++ ] = aWritablePath;
for (int i = 0; i < 2; ++i)
{
......@@ -134,7 +134,7 @@ static std::vector< OUString > GetMultiPaths_Impl(
OUString GetDictionaryWriteablePath()
{
std::vector< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", DictionaryPathFlags::WRITABLE ) );
std::vector< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", DictionaryPathFlags::NONE ) );
DBG_ASSERT( aPaths.size() == 1, "Dictionary_writable path corrupted?" );
OUString aRes;
if (aPaths.size() > 0)
......
......@@ -1086,7 +1086,7 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X
}
}
OUString DrawingML::WriteBlip( const Reference< XPropertySet >& rXPropSet, const OUString& rURL, bool bRelPathToMedia, const Graphic *pGraphic )
OUString DrawingML::WriteBlip( const Reference< XPropertySet >& rXPropSet, const OUString& rURL, bool bRelPathToMedia )
{
OUString sRelId;
BitmapChecksum nChecksum = 0;
......@@ -1101,7 +1101,7 @@ OUString DrawingML::WriteBlip( const Reference< XPropertySet >& rXPropSet, const
}
if (sRelId.isEmpty())
{
sRelId = pGraphic ? WriteImage( *pGraphic, bRelPathToMedia ) : WriteImage( rURL, bRelPathToMedia );
sRelId = WriteImage( rURL, bRelPathToMedia );
if (!rURL.isEmpty() && mpTextExport)
mpTextExport->CacheRelId(nChecksum, sRelId);
}
......
......@@ -74,7 +74,7 @@ OUString BinaryInputStream::readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding
return OStringToOUString( readCharArray( nChars ), eTextEnc );
}
OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars, bool bAllowNulChars )
OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars )
{
if( nChars <= 0 )
return OUString();
......@@ -85,8 +85,8 @@ OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars, bool bAllowNulCh
return OUString();
aBuffer.resize( static_cast< size_t >( nCharsRead ) );
if( !bAllowNulChars )
::std::replace( aBuffer.begin(), aBuffer.begin() + nCharsRead, '\0', '?' );
// don't allow nul chars
::std::replace( aBuffer.begin(), aBuffer.begin() + nCharsRead, '\0', '?' );
OUStringBuffer aStringBuffer;
aStringBuffer.ensureCapacity( nCharsRead );
......
......@@ -102,7 +102,7 @@ union DecodedDouble
{
// SequenceInputStream always supports getRemaining()
nCharCount = ::std::min( nCharCount, static_cast< sal_Int32 >( rStrm.getRemaining() / 2 ) );
aString = rStrm.readUnicodeArray( nCharCount, false/*bAllowNulChars*/ );
aString = rStrm.readUnicodeArray( nCharCount );
}
}
return aString;
......
......@@ -651,7 +651,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
ErrCode nErr = sfx2::FileOpenDialog_Impl(GetTopWindow(),
nDialogType,
eDialogFlags, OUString(), aURLList,
eDialogFlags, aURLList,
aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList);
if ( nErr == ERRCODE_ABORT )
......
......@@ -244,7 +244,7 @@ void SfxEventConfiguration::ConfigureEvent( const OUString& aName, const SvxMacr
SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc )
{
return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, true/*bBlowUp*/ );
return SfxEvents_Impl::ConvertToMacro( rElement, pDoc );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -2124,12 +2124,12 @@ IMPL_LINK_NOARG(CustomPropertiesControl, RemovedHdl, void*, void)
m_pVertScroll->DoScrollAction ( ScrollType::LineUp );
}
void CustomPropertiesControl::AddLine( const OUString& sName, Any const & rAny, bool bInteractive )
void CustomPropertiesControl::AddLine( Any const & rAny )
{
m_pPropertiesWin->AddLine( sName, rAny );
m_pPropertiesWin->AddLine( OUString(), rAny );
long nLineCount = m_pPropertiesWin->GetTotalLineCount();
m_pVertScroll->SetRangeMax(nLineCount + 1);
if ( bInteractive && m_pPropertiesWin->GetOutputSizePixel().Height() < nLineCount * m_pPropertiesWin->GetLineHeight() )
if ( m_pPropertiesWin->GetOutputSizePixel().Height() < nLineCount * m_pPropertiesWin->GetLineHeight() )
m_pVertScroll->DoScroll(nLineCount + 1);
}
......@@ -2162,8 +2162,7 @@ void SfxCustomPropertiesPage::dispose()
IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, Button*, void)
{
Any aAny;
m_pPropertiesCtrl->AddLine( OUString(), aAny, true );
m_pPropertiesCtrl->AddLine( Any() );
}
bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet )
......
......@@ -2633,7 +2633,6 @@ void FileDialogHelper::DialogClosed( const DialogClosedEvent& _rEvent )
ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
sal_Int16 nDialogType,
FileDialogFlags nFlags,
const OUString& rFact,
std::vector<OUString>& rpURLList,
OUString& rFilter,
SfxItemSet *& rpSet,
......@@ -2650,7 +2649,7 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
if (nFlags & FileDialogFlags::SignPDF)
pDialog.reset(new FileDialogHelper(nDialogType, nFlags, SfxResId(STR_SFX_FILTERNAME_PDF), "pdf", rStandardDir, rBlackList, pParent));
else
pDialog.reset(new FileDialogHelper(nDialogType, nFlags, rFact, nDialog, SfxFilterFlags::NONE, SfxFilterFlags::NONE, rStandardDir, rBlackList, pParent));
pDialog.reset(new FileDialogHelper(nDialogType, nFlags, OUString(), nDialog, SfxFilterFlags::NONE, SfxFilterFlags::NONE, rStandardDir, rBlackList, pParent));
OUString aPath;
if ( pPath )
......
......@@ -348,7 +348,7 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, ListBox&, voi
IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl, Button*, void )
{
OUString aTemplName(m_pFollowLb->GetSelectedEntry());
Execute_Impl(SID_STYLE_EDIT, aTemplName, OUString(), static_cast<sal_uInt16>(pStyle->GetFamily()));
Execute_Impl(SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()));
}
IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl, ListBox&, void )
......@@ -364,25 +364,22 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void )
{
OUString aTemplName(m_pBaseLb->GetSelectedEntry());
if (aTemplName != SfxResId(STR_NONE))
Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),static_cast<sal_uInt16>(pStyle->GetFamily()) );
Execute_Impl( SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()) );
}
// Internal: Perform functions through the Dispatcher
bool SfxManageStyleSheetPage::Execute_Impl(
sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily)
sal_uInt16 nId, const OUString &rStr, sal_uInt16 nFamily)
{
SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl();
SfxStringItem aItem(nId, rStr);
SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily);
SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr );
const SfxPoolItem* pItems[ 6 ];
sal_uInt16 nCount = 0;
if( !rStr.isEmpty() )
pItems[ nCount++ ] = &aItem;
pItems[ nCount++ ] = &aFamily;
if ( !rRefStr.isEmpty() )
pItems[ nCount++ ] = &aRefName;
pItems[ nCount++ ] = nullptr;
......
......@@ -79,7 +79,8 @@ public:
// --- ::lang::XEventListener ---
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
static SvxMacro* ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc, bool bNormalizeMacro );
// convert and normalize
static SvxMacro* ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc );
static void NormalizeMacro( const css::uno::Any& rIn, css::uno::Any& rOut, SfxObjectShell* pDoc );
static void NormalizeMacro(
const ::comphelper::NamedValueCollection& i_eventDescriptor,
......
......@@ -330,15 +330,12 @@ SfxEvents_Impl::~SfxEvents_Impl()
}
SvxMacro* SfxEvents_Impl::ConvertToMacro( const uno::Any& rElement, SfxObjectShell* pObjShell, bool bNormalizeMacro )
SvxMacro* SfxEvents_Impl::ConvertToMacro( const uno::Any& rElement, SfxObjectShell* pObjShell )
{
SvxMacro* pMacro = nullptr;
uno::Sequence < beans::PropertyValue > aProperties;
uno::Any aAny;
if ( bNormalizeMacro )
NormalizeMacro( rElement, aAny, pObjShell );
else
aAny = rElement;
NormalizeMacro( rElement, aAny, pObjShell );
if ( aAny >>= aProperties )
{
......
......@@ -92,7 +92,7 @@ namespace svx {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg( pParent, *pBBSet, true/*bEnableBackgroundSelector*/ ));
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg( pParent, *pBBSet, false/*bEnableDrawingLayerFillStyles*/ ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
{
......@@ -680,7 +680,6 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, Button*, void)
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg(
this,
*pBBSet,
true/*EnableBackgroundSelector*/,
mbEnableDrawingLayerFillStyles));
DBG_ASSERT(pDlg,"Dialog creation failed!");
......
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