[Libreoffice-commits] core.git: sc/inc sc/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Sun Oct 20 12:45:02 UTC 2019
sc/inc/rangeutl.hxx | 2 +-
sc/source/core/tool/rangeutl.cxx | 1 -
sc/source/ui/app/inputwin.cxx | 1 -
sc/source/ui/dbgui/consdlg.cxx | 10 ++++------
sc/source/ui/inc/consdlg.hxx | 1 -
sc/source/ui/miscdlgs/anyrefdg.cxx | 1 -
sc/source/ui/miscdlgs/optsolver.cxx | 1 -
sc/source/ui/unoobj/cellsuno.cxx | 1 -
sc/source/ui/unoobj/docuno.cxx | 1 -
sc/source/ui/view/tabvwsh3.cxx | 1 -
10 files changed, 5 insertions(+), 15 deletions(-)
New commits:
commit ae453b7018f2fa1a0f0bc37c0557bd4e2eae9a71
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Oct 20 14:33:35 2019 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Oct 20 14:44:06 2019 +0200
ScRangeUtil is utility class; don't instantiate it
Change-Id: Id5bf48b62c644fa3c37faf324b9f5b971ca18557
Reviewed-on: https://gerrit.libreoffice.org/81162
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx
index 54aba7bf817c..a6e395a38b26 100644
--- a/sc/inc/rangeutl.hxx
+++ b/sc/inc/rangeutl.hxx
@@ -38,7 +38,7 @@ enum RutlNameScope { RUTL_NONE=0, RUTL_NAMES, RUTL_DBASE };
class SC_DLLPUBLIC ScRangeUtil
{
public:
- ScRangeUtil() {}
+ ScRangeUtil() = delete;
static bool MakeArea ( const OUString& rAreaStr,
ScArea& rArea,
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index aed6ed61e5b1..a2d146ff694b 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -241,7 +241,6 @@ bool ScRangeUtil::MakeRangeFromName (
ScAddress::Details const & rDetails )
{
bool bResult = false;
- ScRangeUtil aRangeUtil;
SCTAB nTab = 0;
SCCOL nColStart = 0;
SCCOL nColEnd = 0;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 4ff8735e0950..6e8ee9bc2cb6 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2161,7 +2161,6 @@ static ScNameInputType lcl_GetInputType( const OUString& rText )
ScRange aRange;
ScAddress aAddress;
- ScRangeUtil aRangeUtil;
SCTAB nNameTab;
sal_Int32 nNumeric;
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 3cb87621353e..3378a92f8bb8 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -76,7 +76,6 @@ ScConsolidateDlg::ScConsolidateDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::W
GetViewData() )
, pDoc ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
GetViewData().GetDocument() )
- , pRangeUtil ( new ScRangeUtil )
, nAreaDataCount ( 0 )
, nWhichCons ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) )
, bDlgLostFocus ( false )
@@ -109,7 +108,7 @@ ScConsolidateDlg::~ScConsolidateDlg()
void ScConsolidateDlg::Init()
{
- OSL_ENSURE( pDoc && pRangeUtil, "Error in Ctor" );
+ OSL_ENSURE( pDoc, "Error in Ctor" );
OUString aStr;
sal_uInt16 i=0;
@@ -215,7 +214,7 @@ void ScConsolidateDlg::FillAreaLists()
m_xLbDataArea->append_text( aStrUndefined );
m_xLbDestArea->append_text( aStrUndefined );
- if ( pRangeUtil && pAreaData && (nAreaDataCount > 0) )
+ if ( pAreaData && (nAreaDataCount > 0) )
{
for ( size_t i=0;
(i<nAreaDataCount) && (!pAreaData[i].aStrName.isEmpty());
@@ -284,7 +283,7 @@ void ScConsolidateDlg::Deactivate()
bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd )
{
- if ( !pRangeUtil || !pDoc ||
+ if ( !pDoc ||
((pEd != m_xEdDataArea.get()) && (pEd != m_xEdDestArea.get())) )
return false;
@@ -449,8 +448,7 @@ IMPL_LINK( ScConsolidateDlg, SelectCBHdl, weld::ComboBox&, rLb, void )
formula::RefEdit* pEd = (&rLb == m_xLbDataArea.get()) ? m_xEdDataArea.get() : m_xEdDestArea.get();
const sal_Int32 nSelPos = rLb.get_active();
- if ( pRangeUtil
- && (nSelPos > 0)
+ if ( (nSelPos > 0)
&& (nAreaDataCount > 0)
&& (pAreaData != nullptr) )
{
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index 067944402a18..9d292c156e4a 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -49,7 +49,6 @@ private:
ScConsolidateParam const theConsData;
ScViewData& rViewData;
ScDocument* const pDoc;
- std::unique_ptr<ScRangeUtil> pRangeUtil;
std::unique_ptr<ScAreaData[]> pAreaData;
size_t nAreaDataCount;
sal_uInt16 const nWhichCons;
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 3a21ac941788..406c9bf57cdb 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -144,7 +144,6 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUStr
return true;
ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
- ScRangeUtil aRangeUtil;
bool bError = false;
sal_Int32 nIdx {0};
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 12c26f40fc22..e7ff94257ee0 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -748,7 +748,6 @@ void ScOptSolverDlg::ShowError( bool bCondition, formula::RefEdit* pFocus )
bool ScOptSolverDlg::ParseRef( ScRange& rRange, const OUString& rInput, bool bAllowRange )
{
- ScRangeUtil aRangeUtil;
ScAddress::Details aDetails(mrDoc.GetAddressConvention(), 0, 0);
ScRefFlags nFlags = rRange.ParseAny( rInput, &mrDoc, aDetails );
if ( nFlags & ScRefFlags::VALID )
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index f7339ba9f568..d7280b666477 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4755,7 +4755,6 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
}
else
{
- ScRangeUtil aRangeUtil;
if ( ScRangeUtil::MakeRangeFromName( aName, &rDoc, nTab, aCellRange ) ||
ScRangeUtil::MakeRangeFromName( aName, &rDoc, nTab, aCellRange, RUTL_DBASE ) )
bFound = true;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b7e932b5fcf2..eb7f2d7281b2 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1316,7 +1316,6 @@ static bool lcl_ParseTarget( const OUString& rTarget, ScRange& rTargetRange, too
// test in same order as in SID_CURRENTCELL execute
ScAddress aAddress;
- ScRangeUtil aRangeUtil;
SCTAB nNameTab;
sal_Int32 nNumeric = 0;
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 87f0548b8cc5..2a6fdf574997 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -352,7 +352,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// Is it a named area (first named ranges then database ranges)?
else
{
- ScRangeUtil aRangeUtil;
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
if( ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_NAMES, eConv ) ||
ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_DBASE, eConv ) )
More information about the Libreoffice-commits
mailing list