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:
sal_uInt16 nVarArgsStart; /**< Start of variable arguments, for numbering */
OString sHelpId; /**< HelpId of function */
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 */
};
......
......@@ -101,7 +101,6 @@ ScFuncDesc::ScFuncDesc() :
nArgCount (0),
nVarArgsStart (0),
bIncomplete (false),
bHasSuppressedArgs(false),
mbHidden (false)
{}
......@@ -134,7 +133,6 @@ void ScFuncDesc::Clear()
nCategory = 0;
sHelpId.clear();
bIncomplete = false;
bHasSuppressedArgs = false;
mbHidden = false;
}
......@@ -272,20 +270,7 @@ OUString ScFuncDesc::getFormula( const ::std::vector< OUString >& _aArguments )
sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
{
if (!bHasSuppressedArgs || !pDefArgFlags)
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;
return nArgCount;
}
OUString ScFuncDesc::getFunctionName() const
......@@ -316,15 +301,11 @@ sal_Int32 ScFuncDesc::getSuppressedArgumentCount() const
void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const
{
if (!bHasSuppressedArgs || !pDefArgFlags)
{
_rArguments.resize( nArgCount);
sal_uInt16 value = 0;
for (auto & argument : _rArguments)
argument = value++;
}
_rArguments.resize( nArgCount);
sal_uInt16 value = 0;
for (auto & argument : _rArguments)
argument = value++;
_rArguments.reserve( nArgCount);
sal_uInt16 nArgs = nArgCount;
if (nArgs >= PAIRED_VAR_ARGS)
nArgs -= PAIRED_VAR_ARGS - 2;
......
......@@ -228,21 +228,18 @@ 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
FSEND);
if (rEntry.meType == Worksheet)
{
pDefStrm->startElement(XML_cacheSource,
XML_type, "worksheet",
FSEND);
pDefStrm->startElement(XML_cacheSource,
XML_type, "worksheet",
FSEND);
OUString aSheetName;
GetDoc().GetName(rEntry.maSrcRange.aStart.Tab(), aSheetName);
pDefStrm->singleElement(XML_worksheetSource,
XML_ref, XclXmlUtils::ToOString(rEntry.maSrcRange).getStr(),
XML_sheet, XclXmlUtils::ToOString(aSheetName).getStr(),
FSEND);
OUString aSheetName;
GetDoc().GetName(rEntry.maSrcRange.aStart.Tab(), aSheetName);
pDefStrm->singleElement(XML_worksheetSource,
XML_ref, XclXmlUtils::ToOString(rEntry.maSrcRange).getStr(),
XML_sheet, XclXmlUtils::ToOString(aSheetName).getStr(),
FSEND);
pDefStrm->endElement(XML_cacheSource);
}
pDefStrm->endElement(XML_cacheSource);
size_t nCount = rCache.GetFieldCount();
pDefStrm->startElement(XML_cacheFields,
......@@ -449,7 +446,6 @@ void XclExpXmlPivotTableManager::Initialize()
maCacheIdMap.emplace(*it, aCaches.size()+1);
XclExpXmlPivotCaches::Entry aEntry;
aEntry.meType = XclExpXmlPivotCaches::Worksheet;
aEntry.mpCache = pCache;
aEntry.maSrcRange = rRange;
aCaches.push_back(aEntry); // Cache ID equals position + 1.
......
......@@ -23,12 +23,9 @@ class ScDPObject;
class XclExpXmlPivotCaches : public XclExpRecordBase, protected XclExpRoot
{
public:
enum EntryType { Worksheet, Name, Database };
struct Entry
{
const ScDPCache* mpCache;
EntryType meType;
ScRange maSrcRange;
};
......
......@@ -37,7 +37,6 @@ FuPoor::FuPoor(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP,
pWindow(pWin),
pDrDoc(pDoc),
aSfxRequest(rReq),
pDialog(nullptr),
bIsInDragMode(false),
// remember MouseButton state
mnCode(0)
......@@ -53,26 +52,16 @@ FuPoor::~FuPoor()
{
aDragTimer.Stop();
aScrollTimer.Stop();
pDialog.disposeAndClear();
}
void FuPoor::Activate()
{
if (pDialog)
{
pDialog->Show();
}
}
void FuPoor::Deactivate()
{
aDragTimer.Stop();
aScrollTimer.Stop();
if (pDialog)
{
pDialog->Hide();
}
}
// Scroll when reached the window border; is called from MouseMove
......
......@@ -108,12 +108,8 @@ private:
m_aHelper;
SfxBindings* const m_pMyBindings;
VclPtr<vcl::Window> m_pActiveWin;
Idle m_aIdle;
OUString m_aDocName; // document on which the dialog was opened
DECL_LINK( UpdateFocusHdl, Timer*, void );
protected:
void disposeRefHandler();
bool DoClose( sal_uInt16 nId );
......
......@@ -47,7 +47,6 @@ protected:
SdrModel* pDrDoc;
SfxRequest const aSfxRequest;
VclPtr<Dialog> pDialog;
Timer aScrollTimer; // for Autoscrolling
DECL_LINK( ScrollHdl, Timer *, void );
......
......@@ -54,7 +54,6 @@ private:
InsertDeleteFlags nShortCutInsContentsCmdBits;
bool bShortCutTranspose;
InsCellCmd nShortCutMoveMode;
std::unique_ptr<weld::CheckButton> mxBtnInsAll;
......
......@@ -754,11 +754,9 @@ ScRefHandler::ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef
m_rWindow( &rWindow ),
m_bInRefMode( false ),
m_aHelper(this,pB),
m_pMyBindings( pB ),
m_pActiveWin(nullptr)
m_pMyBindings( pB )
{
m_aHelper.SetWindow(m_rWindow.get());
m_aIdle.SetInvokeHandler(LINK( this, ScRefHandler, UpdateFocusHdl));
if( bBindRef ) EnterRefMode();
}
......@@ -821,7 +819,6 @@ ScRefHandler::~ScRefHandler()
void ScRefHandler::disposeRefHandler()
{
m_rWindow.clear();
m_pActiveWin.clear();
LeaveRefMode();
m_aHelper.dispose();
}
......@@ -932,14 +929,6 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton*
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 )
{
return m_aHelper.ParseWithNames( rRanges, rStr, pDoc );
......
......@@ -38,7 +38,6 @@ ScInsertContentsDlg::ScInsertContentsDlg(weld::Window* pParent,
, bUsedShortCut(false)
, nShortCutInsContentsCmdBits(InsertDeleteFlags::NONE )
, bShortCutTranspose(false)
, nShortCutMoveMode(INS_NONE)
, mxBtnInsAll(m_xBuilder->weld_check_button("paste_all"))
, mxBtnInsStrings(m_xBuilder->weld_check_button("text"))
, mxBtnInsNumbers(m_xBuilder->weld_check_button("numbers"))
......@@ -136,7 +135,7 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const
InsCellCmd ScInsertContentsDlg::GetMoveMode()
{
if (bUsedShortCut)
return nShortCutMoveMode;
return INS_NONE;
if ( mxRbMoveDown->get_active() )
return INS_CELLSDOWN;
if ( mxRbMoveRight->get_active() )
......@@ -291,7 +290,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME;
bShortCutTranspose = false;
nShortCutMoveMode = INS_NONE;
m_xDialog->response(RET_OK);
}
else if (&rBtn == mxBtnShortCutPasteValuesFormats.get())
......@@ -299,7 +297,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::STRING | InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::ATTRIB;
bShortCutTranspose = false;
nShortCutMoveMode = INS_NONE;
m_xDialog->response(RET_OK);
}
else if (&rBtn == mxBtnShortCutPasteTranspose.get())
......@@ -307,7 +304,6 @@ IMPL_LINK(ScInsertContentsDlg, ShortCutHdl, weld::Button&, rBtn, void)
bUsedShortCut = true;
nShortCutInsContentsCmdBits = InsertDeleteFlags::ALL;
bShortCutTranspose = true;
nShortCutMoveMode = INS_NONE;
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