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

loplugin:singlevalfields in sc

Change-Id: I7b87680b9d76bb390a0657f5f1783c3a7c9edbc4
Reviewed-on: https://gerrit.libreoffice.org/63127
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 65d2d264
...@@ -218,7 +218,6 @@ public: ...@@ -218,7 +218,6 @@ public:
sal_uInt16 nVarArgsStart; /**< Start of variable arguments, for numbering */ sal_uInt16 nVarArgsStart; /**< Start of variable arguments, for numbering */
OString sHelpId; /**< HelpId of function */ OString sHelpId; /**< HelpId of function */
bool bIncomplete :1; /**< Incomplete argument info (set for add-in info from configuration) */ bool bIncomplete :1; /**< Incomplete argument info (set for add-in info from configuration) */
bool bHasSuppressedArgs :1; /**< Whether there is any suppressed parameter. */
bool mbHidden :1; /**< Whether function is hidden */ bool mbHidden :1; /**< Whether function is hidden */
}; };
......
...@@ -101,7 +101,6 @@ ScFuncDesc::ScFuncDesc() : ...@@ -101,7 +101,6 @@ ScFuncDesc::ScFuncDesc() :
nArgCount (0), nArgCount (0),
nVarArgsStart (0), nVarArgsStart (0),
bIncomplete (false), bIncomplete (false),
bHasSuppressedArgs(false),
mbHidden (false) mbHidden (false)
{} {}
...@@ -134,7 +133,6 @@ void ScFuncDesc::Clear() ...@@ -134,7 +133,6 @@ void ScFuncDesc::Clear()
nCategory = 0; nCategory = 0;
sHelpId.clear(); sHelpId.clear();
bIncomplete = false; bIncomplete = false;
bHasSuppressedArgs = false;
mbHidden = false; mbHidden = false;
} }
...@@ -272,20 +270,7 @@ OUString ScFuncDesc::getFormula( const ::std::vector< OUString >& _aArguments ) ...@@ -272,20 +270,7 @@ OUString ScFuncDesc::getFormula( const ::std::vector< OUString >& _aArguments )
sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
{ {
if (!bHasSuppressedArgs || !pDefArgFlags)
return nArgCount; return nArgCount;
sal_uInt16 nArgs = nArgCount;
if (nArgs >= PAIRED_VAR_ARGS)
nArgs -= PAIRED_VAR_ARGS - 2;
else if (nArgs >= VAR_ARGS)
nArgs -= VAR_ARGS - 1;
sal_uInt16 nCount = nArgs;
if (nArgCount >= PAIRED_VAR_ARGS)
nCount += PAIRED_VAR_ARGS - 2;
else if (nArgCount >= VAR_ARGS)
nCount += VAR_ARGS - 1;
return nCount;
} }
OUString ScFuncDesc::getFunctionName() const OUString ScFuncDesc::getFunctionName() const
...@@ -316,15 +301,11 @@ sal_Int32 ScFuncDesc::getSuppressedArgumentCount() const ...@@ -316,15 +301,11 @@ sal_Int32 ScFuncDesc::getSuppressedArgumentCount() const
void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const
{ {
if (!bHasSuppressedArgs || !pDefArgFlags)
{
_rArguments.resize( nArgCount); _rArguments.resize( nArgCount);
sal_uInt16 value = 0; sal_uInt16 value = 0;
for (auto & argument : _rArguments) for (auto & argument : _rArguments)
argument = value++; argument = value++;
}
_rArguments.reserve( nArgCount);
sal_uInt16 nArgs = nArgCount; sal_uInt16 nArgs = nArgCount;
if (nArgs >= PAIRED_VAR_ARGS) if (nArgs >= PAIRED_VAR_ARGS)
nArgs -= PAIRED_VAR_ARGS - 2; nArgs -= PAIRED_VAR_ARGS - 2;
......
...@@ -228,8 +228,6 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr ...@@ -228,8 +228,6 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
XML_createdVersion, "3", // MS Excel 2007, tdf#112936: setting version number makes MSO to handle the pivot table differently XML_createdVersion, "3", // MS Excel 2007, tdf#112936: setting version number makes MSO to handle the pivot table differently
FSEND); FSEND);
if (rEntry.meType == Worksheet)
{
pDefStrm->startElement(XML_cacheSource, pDefStrm->startElement(XML_cacheSource,
XML_type, "worksheet", XML_type, "worksheet",
FSEND); FSEND);
...@@ -242,7 +240,6 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr ...@@ -242,7 +240,6 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
FSEND); FSEND);
pDefStrm->endElement(XML_cacheSource); pDefStrm->endElement(XML_cacheSource);
}
size_t nCount = rCache.GetFieldCount(); size_t nCount = rCache.GetFieldCount();
pDefStrm->startElement(XML_cacheFields, pDefStrm->startElement(XML_cacheFields,
...@@ -449,7 +446,6 @@ void XclExpXmlPivotTableManager::Initialize() ...@@ -449,7 +446,6 @@ void XclExpXmlPivotTableManager::Initialize()
maCacheIdMap.emplace(*it, aCaches.size()+1); maCacheIdMap.emplace(*it, aCaches.size()+1);
XclExpXmlPivotCaches::Entry aEntry; XclExpXmlPivotCaches::Entry aEntry;
aEntry.meType = XclExpXmlPivotCaches::Worksheet;
aEntry.mpCache = pCache; aEntry.mpCache = pCache;
aEntry.maSrcRange = rRange; aEntry.maSrcRange = rRange;
aCaches.push_back(aEntry); // Cache ID equals position + 1. aCaches.push_back(aEntry); // Cache ID equals position + 1.
......
...@@ -23,12 +23,9 @@ class ScDPObject; ...@@ -23,12 +23,9 @@ class ScDPObject;
class XclExpXmlPivotCaches : public XclExpRecordBase, protected XclExpRoot class XclExpXmlPivotCaches : public XclExpRecordBase, protected XclExpRoot
{ {
public: public:
enum EntryType { Worksheet, Name, Database };
struct Entry struct Entry
{ {
const ScDPCache* mpCache; const ScDPCache* mpCache;
EntryType meType;
ScRange maSrcRange; ScRange maSrcRange;
}; };
......
...@@ -37,7 +37,6 @@ FuPoor::FuPoor(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, ...@@ -37,7 +37,6 @@ FuPoor::FuPoor(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP,
pWindow(pWin), pWindow(pWin),
pDrDoc(pDoc), pDrDoc(pDoc),
aSfxRequest(rReq), aSfxRequest(rReq),
pDialog(nullptr),
bIsInDragMode(false), bIsInDragMode(false),
// remember MouseButton state // remember MouseButton state
mnCode(0) mnCode(0)
...@@ -53,26 +52,16 @@ FuPoor::~FuPoor() ...@@ -53,26 +52,16 @@ FuPoor::~FuPoor()
{ {
aDragTimer.Stop(); aDragTimer.Stop();
aScrollTimer.Stop(); aScrollTimer.Stop();
pDialog.disposeAndClear();
} }
void FuPoor::Activate() void FuPoor::Activate()
{ {
if (pDialog)
{
pDialog->Show();
}
} }
void FuPoor::Deactivate() void FuPoor::Deactivate()
{ {
aDragTimer.Stop(); aDragTimer.Stop();
aScrollTimer.Stop(); aScrollTimer.Stop();
if (pDialog)
{
pDialog->Hide();
}
} }
// Scroll when reached the window border; is called from MouseMove // Scroll when reached the window border; is called from MouseMove
......
...@@ -108,12 +108,8 @@ private: ...@@ -108,12 +108,8 @@ private:
m_aHelper; m_aHelper;
SfxBindings* const m_pMyBindings; SfxBindings* const m_pMyBindings;
VclPtr<vcl::Window> m_pActiveWin;
Idle m_aIdle;
OUString m_aDocName; // document on which the dialog was opened OUString m_aDocName; // document on which the dialog was opened
DECL_LINK( UpdateFocusHdl, Timer*, void );
protected: protected:
void disposeRefHandler(); void disposeRefHandler();
bool DoClose( sal_uInt16 nId ); bool DoClose( sal_uInt16 nId );
......
...@@ -47,7 +47,6 @@ protected: ...@@ -47,7 +47,6 @@ protected:
SdrModel* pDrDoc; SdrModel* pDrDoc;
SfxRequest const aSfxRequest; SfxRequest const aSfxRequest;
VclPtr<Dialog> pDialog;
Timer aScrollTimer; // for Autoscrolling Timer aScrollTimer; // for Autoscrolling
DECL_LINK( ScrollHdl, Timer *, void ); DECL_LINK( ScrollHdl, Timer *, void );
......
...@@ -54,7 +54,6 @@ private: ...@@ -54,7 +54,6 @@ private:
InsertDeleteFlags nShortCutInsContentsCmdBits; InsertDeleteFlags nShortCutInsContentsCmdBits;
bool bShortCutTranspose; bool bShortCutTranspose;
InsCellCmd nShortCutMoveMode;
std::unique_ptr<weld::CheckButton> mxBtnInsAll; std::unique_ptr<weld::CheckButton> mxBtnInsAll;
......
...@@ -754,11 +754,9 @@ ScRefHandler::ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef ...@@ -754,11 +754,9 @@ ScRefHandler::ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef
m_rWindow( &rWindow ), m_rWindow( &rWindow ),
m_bInRefMode( false ), m_bInRefMode( false ),
m_aHelper(this,pB), m_aHelper(this,pB),
m_pMyBindings( pB ), m_pMyBindings( pB )
m_pActiveWin(nullptr)
{ {
m_aHelper.SetWindow(m_rWindow.get()); m_aHelper.SetWindow(m_rWindow.get());
m_aIdle.SetInvokeHandler(LINK( this, ScRefHandler, UpdateFocusHdl));
if( bBindRef ) EnterRefMode(); if( bBindRef ) EnterRefMode();
} }
...@@ -821,7 +819,6 @@ ScRefHandler::~ScRefHandler() ...@@ -821,7 +819,6 @@ ScRefHandler::~ScRefHandler()
void ScRefHandler::disposeRefHandler() void ScRefHandler::disposeRefHandler()
{ {
m_rWindow.clear(); m_rWindow.clear();
m_pActiveWin.clear();
LeaveRefMode(); LeaveRefMode();
m_aHelper.dispose(); m_aHelper.dispose();
} }
...@@ -932,14 +929,6 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* ...@@ -932,14 +929,6 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton*
m_aHelper.ToggleCollapsed( pEdit, pButton ); m_aHelper.ToggleCollapsed( pEdit, pButton );
} }
IMPL_LINK_NOARG(ScRefHandler, UpdateFocusHdl, Timer *, void)
{
if (m_pActiveWin)
{
m_pActiveWin->GrabFocus();
}
}
bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc ) bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc )
{ {
return m_aHelper.ParseWithNames( rRanges, rStr, pDoc ); return m_aHelper.ParseWithNames( rRanges, rStr, pDoc );
......
...@@ -38,7 +38,6 @@ ScInsertContentsDlg::ScInsertContentsDlg(weld::Window* pParent, ...@@ -38,7 +38,6 @@ ScInsertContentsDlg::ScInsertContentsDlg(weld::Window* pParent,
, bUsedShortCut(false) , bUsedShortCut(false)
, nShortCutInsContentsCmdBits(InsertDeleteFlags::NONE ) , nShortCutInsContentsCmdBits(InsertDeleteFlags::NONE )
, bShortCutTranspose(false) , bShortCutTranspose(false)
, nShortCutMoveMode(INS_NONE)
, mxBtnInsAll(m_xBuilder->weld_check_button("paste_all")) , mxBtnInsAll(m_xBuilder->weld_check_button("paste_all"))
, mxBtnInsStrings(m_xBuilder->weld_check_button("text")) , mxBtnInsStrings(m_xBuilder->weld_check_button("text"))
, mxBtnInsNumbers(m_xBuilder->weld_check_button("numbers")) , mxBtnInsNumbers(m_xBuilder->weld_check_button("numbers"))
...@@ -136,7 +135,7 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const ...@@ -136,7 +135,7 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const
InsCellCmd ScInsertContentsDlg::GetMoveMode() InsCellCmd ScInsertContentsDlg::GetMoveMode()
{ {
if (bUsedShortCut) if (bUsedShortCut)
return nShortCutMoveMode; return INS_NONE;
if ( mxRbMoveDown->get_active() ) if ( mxRbMoveDown->get_active() )
return INS_CELLSDOWN; return INS_CELLSDOWN;
if ( mxRbMoveRight->get_active() ) if ( mxRbMoveRight->get_active() )
...@@ -291,7 +290,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void) ...@@ -291,7 +290,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true; bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME; nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME;
bShortCutTranspose = false; bShortCutTranspose = false;
nShortCutMoveMode = INS_NONE;
m_xDialog->response(RET_OK); m_xDialog->response(RET_OK);
} }
else if (&rBtn == mxBtnShortCutPasteValuesFormats.get()) else if (&rBtn == mxBtnShortCutPasteValuesFormats.get())
...@@ -299,7 +297,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void) ...@@ -299,7 +297,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true; bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::ATTRIB; nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::ATTRIB;
bShortCutTranspose = false; bShortCutTranspose = false;
nShortCutMoveMode = INS_NONE;
m_xDialog->response(RET_OK); m_xDialog->response(RET_OK);
} }
else if (&rBtn == mxBtnShortCutPasteTranspose.get()) else if (&rBtn == mxBtnShortCutPasteTranspose.get())
...@@ -307,7 +304,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void) ...@@ -307,7 +304,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true; bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::ALL; nShortCutInsContentsCmdBits = InsertDeleteFlags::ALL;
bShortCutTranspose = true; bShortCutTranspose = true;
nShortCutMoveMode = INS_NONE;
m_xDialog->response(RET_OK); m_xDialog->response(RET_OK);
} }
} }
......
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