summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/xeformula.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:22:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:36 +0100
commitde29ac09535d814e4be7e1bf0f10beb9f0f847e3 (patch)
tree139f75d657cb825622e812254b8b7df4e509140b /sc/source/filter/excel/xeformula.cxx
parent60c40af090e420a8619b5236bde1ff4ef79100c6 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
Diffstat (limited to 'sc/source/filter/excel/xeformula.cxx')
-rw-r--r--sc/source/filter/excel/xeformula.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 90c1a1452bfd..7ef64cc074bf 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -38,9 +38,9 @@ using namespace ::formula;
// External reference log =====================================================
XclExpRefLogEntry::XclExpRefLogEntry() :
- mpUrl( 0 ),
- mpFirstTab( 0 ),
- mpLastTab( 0 ),
+ mpUrl( nullptr ),
+ mpFirstTab( nullptr ),
+ mpLastTab( nullptr ),
mnFirstXclTab( EXC_TAB_DELETED ),
mnLastXclTab( EXC_TAB_DELETED )
{
@@ -57,8 +57,8 @@ struct XclExpScToken
const FormulaToken* mpScToken; /// Currently processed Calc token.
sal_uInt8 mnSpaces; /// Number of spaces before the Calc token.
- inline explicit XclExpScToken() : mpScToken( 0 ), mnSpaces( 0 ) {}
- inline bool Is() const { return mpScToken != 0; }
+ inline explicit XclExpScToken() : mpScToken( nullptr ), mnSpaces( 0 ) {}
+ inline bool Is() const { return mpScToken != nullptr; }
inline StackVar GetType() const { return mpScToken ? mpScToken->GetType() : static_cast< StackVar >( svUnknown ); }
inline OpCode GetOpCode() const { return mpScToken ? mpScToken->GetOpCode() : static_cast< OpCode >( ocNone ); }
};
@@ -199,7 +199,7 @@ void XclExpFuncData::IncParamInfoIdx()
++mpParamInfo;
// if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it
else if( IsExcelOnlyParam() || IsCalcOnlyParam() )
- mpParamInfo = 0;
+ mpParamInfo = nullptr;
// points to last info, but parameter pairs expected, move to previous info
else if( mrFuncInfo.IsParamPairs() )
--mpParamInfo;
@@ -278,12 +278,12 @@ struct XclExpCompData
XclExpCompData::XclExpCompData( const XclExpCompConfig* pCfg ) :
mrCfg( pCfg ? *pCfg : spConfigTable[ 0 ] ),
- mpLinkMgr( 0 ),
- mpRefLog( 0 ),
- mpScBasePos( 0 ),
+ mpLinkMgr( nullptr ),
+ mpRefLog( nullptr ),
+ mpScBasePos( nullptr ),
mbStopAtSep( false ),
mbVolatile( false ),
- mbOk( pCfg != 0 )
+ mbOk( pCfg != nullptr )
{
OSL_ENSURE( pCfg, "XclExpFmlaCompImpl::Init - unknown formula type" );
}
@@ -299,7 +299,7 @@ public:
/** Creates an Excel token array from the passed Calc token array. */
XclTokenArrayRef CreateFormula(
XclFormulaType eType, const ScTokenArray& rScTokArr,
- const ScAddress* pScBasePos = 0, XclExpRefLog* pRefLog = 0 );
+ const ScAddress* pScBasePos = nullptr, XclExpRefLog* pRefLog = nullptr );
/** Creates a single error token containing the passed error code. */
XclTokenArrayRef CreateErrorFormula( sal_uInt8 nErrCode );
/** Creates a single token for a special cell reference. */
@@ -559,7 +559,7 @@ const XclExpCompConfig* XclExpFmlaCompImpl::GetConfigForType( XclFormulaType eTy
{
XclExpCompConfigMap::const_iterator aIt = maCfgMap.find( eType );
OSL_ENSURE( aIt != maCfgMap.end(), "XclExpFmlaCompImpl::GetConfigForType - unknown formula type" );
- return (aIt == maCfgMap.end()) ? 0 : &aIt->second;
+ return (aIt == maCfgMap.end()) ? nullptr : &aIt->second;
}
void XclExpFmlaCompImpl::Init( XclFormulaType eType )
@@ -583,12 +583,12 @@ void XclExpFmlaCompImpl::Init( XclFormulaType eType, const ScTokenArray& rScTokA
case EXC_FMLATYPE_CELL:
case EXC_FMLATYPE_MATRIX:
case EXC_FMLATYPE_CHART:
- mxData->mbOk = pScBasePos != 0;
+ mxData->mbOk = pScBasePos != nullptr;
OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" );
mxData->mpScBasePos = pScBasePos;
break;
case EXC_FMLATYPE_SHARED:
- mxData->mbOk = pScBasePos != 0;
+ mxData->mbOk = pScBasePos != nullptr;
assert(mxData->mbOk && "XclExpFmlaCompImpl::Init - missing cell address");
if (mxData->mbOk)
{
@@ -1346,7 +1346,7 @@ void XclExpFmlaCompImpl::ProcessFunction( const XclExpScToken& rTokData )
}
}
- mxData->mbOk = pFuncInfo != 0;
+ mxData->mbOk = pFuncInfo != nullptr;
if( !mxData->mbOk ) return;
// internal functions equivalent to an existing add-in
@@ -1897,7 +1897,7 @@ XclExpRefLogEntry* XclExpFmlaCompImpl::GetNewRefLogEntry()
mxData->mpRefLog->resize( mxData->mpRefLog->size() + 1 );
return &mxData->mpRefLog->back();
}
- return 0;
+ return nullptr;
}
void XclExpFmlaCompImpl::ProcessCellRef( const XclExpScToken& rTokData )
@@ -1925,7 +1925,7 @@ void XclExpFmlaCompImpl::ProcessCellRef( const XclExpScToken& rTokData )
mxData->mpLinkMgr->StoreCell(aRefData, *mxData->mpScBasePos);
// create the tRef, tRefErr, tRefN, tRef3d, or tRefErr3d token
- if (!mxData->mrCfg.mb3DRefOnly && IsRef2D(aRefData, mxData->mpLinkMgr != 0))
+ if (!mxData->mrCfg.mb3DRefOnly && IsRef2D(aRefData, mxData->mpLinkMgr != nullptr))
{
// 2D reference (not in defined names, but allowed in range lists)
sal_uInt8 nBaseId = (!mxData->mpScBasePos && lclIsRefRel2D( aRefData )) ? EXC_TOKID_REFN :
@@ -1970,7 +1970,7 @@ void XclExpFmlaCompImpl::ProcessRangeRef( const XclExpScToken& rTokData )
mxData->mpLinkMgr->StoreCellRange(aRefData, *mxData->mpScBasePos);
// create the tArea, tAreaErr, tAreaN, tArea3d, or tAreaErr3d token
- if (!mxData->mrCfg.mb3DRefOnly && IsRef2D(aRefData, mxData->mpLinkMgr != 0))
+ if (!mxData->mrCfg.mb3DRefOnly && IsRef2D(aRefData, mxData->mpLinkMgr != nullptr))
{
// 2D reference (not in name formulas, but allowed in range lists)
sal_uInt8 nBaseId = (!mxData->mpScBasePos && lclIsRefRel2D( aRefData )) ? EXC_TOKID_AREAN :
. It is now strong since otherwise the SdrObject will go away very eagerly. (*) SdrObject still has a weak reference to SvxShape (*) In the existing places that an SdrObject is being deleted, we now just clear the reference (*) instead of SwVirtFlyDrawObj removing itself from the page that contains inside it's destructor, make the call site do the removing from the page. (*) Needed to take the SolarMutex in UndoManagerHelper_Impl::impl_clear because this can be called from UNO (e.g. sfx2_complex JUnit test) and the SdrObjects need the SolarMutex when destructing. (*) handle a tricky situation with SwDrawVirtObj in the SwDrawModel destructor because the existing code wants mpDrawObj in SwAnchoredObject to be sometimes owning, sometimes not, which results in a cycle with the new code. Change-Id: I4d79df1660e386388e5d51030653755bca02a163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-07-29svx: manipulate SdrObject::m_aOutRect indirectlyTomaž Vajngerl Change-Id: I0d8a8e4df06595250c07a61181fbd76fe1da5662 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137571 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> 2022-03-11loplugin:constparamsNoel Grandin Change-Id: I5f184f93dbdb414514855c85c9dc1624e7ec8636 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131337 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-03-03Recheck modules sv* with IWYUGabor Kelemen See tdf#42949 for motivation Change-Id: I25779cbfb1aa93c31d6e12ac95e136b3bdbbc058 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130403 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> 2022-01-07remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enumNoel Grandin We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is in the right range. Which exposes some dodgy code in DrawViewShell::GetMenuStateSel SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) || SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) || which has been there ever since commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b Date: Mon Sep 18 16:07:07 2000 +0000 initial import just remove that. In SwFEShell::ImpEndCreate() move some logic around to avoid using an out-of-range SdrObjKind value Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-09-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins 2021-09-17tdf#143550 - use the term "gluepoints" consistentlyrocso Change-Id: Id10dc2ef13f54a148a800003cc4bd88ca1a0056f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122233 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> 2021-08-22no need to use unique_ptr for XPolygonNoel Grandin it is already a COW type Change-Id: I94370d20fbe9d7f6b1bd57f339911a75cbef6484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120824 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-08-17rename SetRectsDirty->SetBoundAndSnapRectsDirtyNoel Grandin because there are lots of things being marked dirty, and I like to be sure I know what the code is doing Change-Id: Ifd0380c5560adc4a054495551885fe33af4f3e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120460 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-06-08-Werror,-Wunused-but-set-variable (Clang 13 trunk)Stephan Bergmann ...ever since the code's introduction in ea1ca189b561e47d3b872f40628e6af224355626 "added api for glue points" Change-Id: I221632d243c8c778c711c3f001676ff26043d0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2021-04-29loplugin:stringadd simplify some *StringBuffer operationsNoel Grandin pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-04-27loplugin:moveoptNoel Grandin An attempt that did not find anything convincing enough to finish it up and make it permanently active. So just leave it in /store for now. Change-Id: I1750e177655a4a510da100f880ba81bf762be277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114742 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-04-20lok: Pass object ord num in the uno commandmerttumer When multiple objects' glue points collide the ordnum will be used to decide which glue point to connect to for the connectors. Without that the default logic chooses the lowest ordered object which is searched and found in the object list Change-Id: I64579d28bbe6cbd92bab745838fe2995585b6a3f Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113517 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114032 Tested-by: Jenkins 2021-04-12svx: prefix members of SdrObjectMiklos Vajna So that nOrdNum doesn't cause -Wshadow in SwDrawVirtObj::AddToDrawingPage(). Change-Id: Ie7b1401f5c3cb07bfa653c4268dbdce7ba7abea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113966 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins 2021-04-09Recheck include/ with IWYUGabor Kelemen See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> 2021-03-02Convert MapModeUnits If necessary.mert Connecting to a glue point or handle callback messages contain points which may need a unit conversion depending on the module Change-Id: Icc0b2bc5981bb7d135efd38e60ac06fe12a70480 Signed-off-by: mert <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111193 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111513 Tested-by: Jenkins 2021-03-01Fix connectors cannot select a glue pointmert Change-Id: I6b6d2dad27910ac6d5de43e9d0992e3565f5be5e Signed-off-by: mert <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111511 Tested-by: Jenkins 2021-02-11ofz#30805 Null-dereference READCaolán McNamara presumably since... commit 09cb778b6eb7d3a5b9029965a1320b49c90e7295 Date: Tue Feb 9 13:42:22 2021 +0200 clean up SdrObject cloning Change-Id: I5e87c6ac7b786d691d625e16c31b8916e0b7da76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110754 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins 2021-02-11rename RestGeoData->RestoreGeoDataNoel Grandin Change-Id: I5d584f40949e5c7f2fc7e126cd9cae81eed4db70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-02-10clean up SdrObject cloningNoel using operator= implies that overwriting an SdrObject is a useful operation, but that is not at all true - they are typically linked into and referred to by many other things. So rather use a copy-constructor. Also clean up a couple of weird "do some stuff after the clone" code into the main copy constructor. Change-Id: Iefc1481b527602748b5f3abed06e7cca66c0581c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-02-09return by unique_ptr from NewGeoDataNoel Grandin Change-Id: Iab806959d79ce828069cb16b6a7883981d85dfaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-01-02introduce Degree100 strong_int typeNoel Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-11-06make SdrObject Identifiers SdrObjKind enum membersCaolán McNamara with unique values so that, e.g. if (pObj->GetObjIdentifier() == OBJ_LINE) is only true if pObj is a SdrPathObj and not a E3dScene Change-Id: I30c91e57eb27141390c644dec42e2a4bee96edf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105374 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-10-26switching long to a 64-bit type on 64-bit windowsNoel (*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-08-06loplugin:flatten in svx/svdrawNoel Grandin Change-Id: I8379e5ebaee2090d2b4dbd05d55b55000915cd7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>