[Libreoffice-commits] core.git: include/sfx2 sfx2/source sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Oct 31 08:41:22 UTC 2017
include/sfx2/app.hxx | 4 ++--
include/sfx2/docfilt.hxx | 3 +--
include/sfx2/evntconf.hxx | 2 +-
include/sfx2/mgetempl.hxx | 2 +-
sfx2/source/config/evntconf.cxx | 4 ++--
sfx2/source/dialog/mgetempl.cxx | 6 +-----
sfx2/source/doc/docfilt.cxx | 12 ++++--------
sfx2/source/view/viewfrm.cxx | 7 ++++---
sw/source/filter/html/htmlbas.cxx | 2 +-
9 files changed, 17 insertions(+), 25 deletions(-)
New commits:
commit 3ad6957dc12c0667a69ca6b8361ccde490f9c1da
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Oct 30 13:30:44 2017 +0200
loplugin:constantparam in sfx2
Change-Id: Id52809401fb848d7169a665903e67ba28f4af598
Reviewed-on: https://gerrit.libreoffice.org/44084
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index ec1747a53cba..d3384e7f5a38 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -163,8 +163,8 @@ public:
static OUString ChooseScript();
static void MacroOrganizer( sal_Int16 nTabId );
static ErrCode CallBasic( const OUString&, BasicManager*, SbxArray *pArgs, SbxValue *pRet );
- static ErrCode CallAppBasic( const OUString& i_macroName, SbxArray* i_args = nullptr )
- { return CallBasic( i_macroName, SfxApplication::GetBasicManager(), i_args, nullptr ); }
+ static ErrCode CallAppBasic( const OUString& i_macroName )
+ { return CallBasic( i_macroName, SfxApplication::GetBasicManager(), nullptr, nullptr ); }
static BasicManager* GetBasicManager();
css::script::XLibraryContainer * GetDialogContainer();
css::script::XLibraryContainer * GetBasicContainer();
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index 95fde5036d06..d5e0507d577a 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -114,8 +114,7 @@ public:
/// @throws css::lang::WrappedTargetException
/// @throws css::uno::RuntimeException
static OUString GetTypeFromStorage(
- const css::uno::Reference<css::embed::XStorage>& xStorage,
- bool bTemplate = false );
+ const css::uno::Reference<css::embed::XStorage>& xStorage );
};
#endif
diff --git a/include/sfx2/evntconf.hxx b/include/sfx2/evntconf.hxx
index 8a4d004c075d..bf59d805a074 100644
--- a/include/sfx2/evntconf.hxx
+++ b/include/sfx2/evntconf.hxx
@@ -98,7 +98,7 @@ class SFX2_DLLPUBLIC SfxEventConfiguration
{
public:
static void ConfigureEvent( const OUString& aName, const SvxMacro&, SfxObjectShell const * pObjSh);
- static SvxMacro* ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc, bool bBlowUp );
+ static SvxMacro* ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc );
};
#endif
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index fb018865cc35..42aeef6c1135 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -87,7 +87,7 @@ friend class SfxStyleDialog;
virtual void Reset(const SfxItemSet *) override;
static bool Execute_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr,
- sal_uInt16 nFamily, sal_uInt16 nMask = 0 );
+ sal_uInt16 nFamily );
using TabPage::ActivatePage;
virtual void ActivatePage(const SfxItemSet &) override;
using TabPage::DeactivatePage;
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 58c6f2251feb..9de6fb043487 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -242,9 +242,9 @@ void SfxEventConfiguration::ConfigureEvent( const OUString& aName, const SvxMacr
}
-SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc, bool bBlowUp )
+SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc )
{
- return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, bBlowUp );
+ return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, true/*bBlowUp*/ );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index e93adca35721..b6e78d3a5ff9 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -371,22 +371,18 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void )
// Internal: Perform functions through the Dispatcher
bool SfxManageStyleSheetPage::Execute_Impl(
- sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily,
- sal_uInt16 nMask)
+ sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily)
{
SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl();
SfxStringItem aItem(nId, rStr);
SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily);
- SfxUInt16Item aMask( SID_STYLE_MASK, nMask );
SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr );
const SfxPoolItem* pItems[ 6 ];
sal_uInt16 nCount = 0;
if( !rStr.isEmpty() )
pItems[ nCount++ ] = &aItem;
pItems[ nCount++ ] = &aFamily;
- if( nMask )
- pItems[ nCount++ ] = &aMask;
if ( !rRefStr.isEmpty() )
pItems[ nCount++ ] = &aRefName;
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index ed5a13c1be80..a71c45412e0a 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -175,7 +175,7 @@ OUString SfxFilter::GetTypeFromStorage( const SotStorage& rStg )
}
OUString SfxFilter::GetTypeFromStorage(
- const uno::Reference<embed::XStorage>& xStorage, bool bTemplate )
+ const uno::Reference<embed::XStorage>& xStorage )
{
SfxFilterMatcher aMatcher;
@@ -191,13 +191,9 @@ OUString SfxFilter::GetTypeFromStorage(
SotClipboardFormatId nClipId = SotExchange::GetFormat( aDataFlavor );
if ( nClipId != SotClipboardFormatId::NONE )
{
- SfxFilterFlags nMust = SfxFilterFlags::IMPORT, nDont = SFX_FILTER_NOTINSTALLED;
- if ( bTemplate )
- // template filter was preselected, try to verify
- nMust |= SfxFilterFlags::TEMPLATEPATH;
- else
- // template filters shouldn't be detected if not explicitly asked for
- nDont |= SfxFilterFlags::TEMPLATEPATH;
+ SfxFilterFlags nMust = SfxFilterFlags::IMPORT;
+ // template filters shouldn't be detected if not explicitly asked for
+ SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED | SfxFilterFlags::TEMPLATEPATH;
// get filter from storage MediaType
std::shared_ptr<const SfxFilter> pFilter = aMatcher.GetFilter4ClipBoardId( nClipId, nMust, nDont );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 7bfb7694ad1b..be33d0c97d62 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2280,7 +2280,7 @@ void SfxViewFrame::Resize( bool bForce )
#define LINE_SEP 0x0A
-void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, bool bEraseTrailingEmptyLines )
+void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines )
{
sal_Int32 nStartPos = 0;
sal_Int32 nLine = 0;
@@ -2308,7 +2308,8 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, bool bEra
rStr = rStr.copy( 0, nStartPos ) + rStr.copy( nEndPos );
}
- if ( bEraseTrailingEmptyLines && nStartPos != -1 )
+ // erase trailing lines
+ if ( nStartPos != -1 )
{
sal_Int32 n = nStartPos;
sal_Int32 nLen = rStr.getLength();
@@ -2393,7 +2394,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro )
pMethod->GetLineRange( nStart, nEnd );
sal_uIntPtr nlStart = nStart;
sal_uIntPtr nlEnd = nEnd;
- CutLines( aOUSource, nlStart-1, nlEnd-nlStart+1, true );
+ CutLines( aOUSource, nlStart-1, nlEnd-nlStart+1 );
}
}
}
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index c38ff3a47638..36686581e1c4 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -317,7 +317,7 @@ void SwHTMLWriter::OutBasicBodyEvents()
uno::Reference < container::XNameReplace > xEvents = xSup->getEvents();
for ( sal_Int32 i=0; i<4; i++ )
{
- SvxMacro* pMacro = SfxEventConfiguration::ConvertToMacro( xEvents->getByName( OUString::createFromAscii(aEventNames[i]) ), pDocSh, true );
+ SvxMacro* pMacro = SfxEventConfiguration::ConvertToMacro( xEvents->getByName( OUString::createFromAscii(aEventNames[i]) ), pDocSh );
if ( pMacro )
{
aDocTable.Insert( aBodyEventTable[i].nEvent, *pMacro );
More information about the Libreoffice-commits
mailing list