[Libreoffice-commits] core.git: compilerplugins/clang include/svx svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 27 09:18:37 UTC 2018
compilerplugins/clang/unusedenumconstants.readonly.results | 8 -
include/svx/svdmrkv.hxx | 20 +---
svx/source/svdraw/svdmrkv.cxx | 56 ++-----------
3 files changed, 19 insertions(+), 65 deletions(-)
New commits:
commit 876463415a47113433a5bf92887e0623c6626649
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Nov 26 10:55:46 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 27 10:18:12 2018 +0100
remove unused SdrSearchOptions enum values
Change-Id: I0a8867399699d1c5ce17c2e5dadf96510246f173
Reviewed-on: https://gerrit.libreoffice.org/64067
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results
index 4ec3ea394ce4..b7c602053fa7 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -538,14 +538,6 @@ include/svx/svdedtv.hxx:65
enum SdrInsertFlags NOBROADCAST
include/svx/svdhdl.hxx:108
enum BitmapMarkerKind RectPlus_7x7
-include/svx/svdmrkv.hxx:42
- enum SdrSearchOptions WITHTEXT
-include/svx/svdmrkv.hxx:43
- enum SdrSearchOptions TESTTEXTAREA
-include/svx/svdmrkv.hxx:44
- enum SdrSearchOptions BACKWARD
-include/svx/svdmrkv.hxx:47
- enum SdrSearchOptions PASS3NEAREST
include/svx/svdograf.hxx:52
enum SdrGrafObjTransformsAttrs ROTATE
include/svx/swframeposstrings.hxx:78
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index abffdba68434..fd9d2399e910 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -39,22 +39,18 @@ enum class SdrSearchOptions
TESTMARKABLE = 0x0008, /* just markable objects/points/handles/... */
TESTMACRO = 0x0010, /* Just objects with macro */
TESTTEXTEDIT = 0x0020, /* Just TextEdit-enabled objects */
- WITHTEXT = 0x0040, /* Just objects with text */
- TESTTEXTAREA = 0x0080, /* The textarea of objects with text (TextEditHit) */
- BACKWARD = 0x0100, /* Backwards search */
- MARKED = 0x0400, /* Just marked objects/points/... */
- PASS2BOUND = 0x0800, /* In case of empty search results, then 2nd. try with BoundRectHit */
- PASS3NEAREST = 0x1000, /* In case of empty search results, then new 3rd. Try with NearestBoundRectHit */
- BEFOREMARK = 0x2000, /* if one marked one found, ignore all behind that */
-
- IMPISMASTER = 0x8000, /* MasterPage is being searched right now */
+ MARKED = 0x0040, /* Just marked objects/points/... */
+ PASS2BOUND = 0x0080, /* In case of empty search results, then 2nd. try with BoundRectHit */
+ BEFOREMARK = 0x0100, /* if one marked one found, ignore all behind that */
+
+ IMPISMASTER = 0x0200, /* MasterPage is being searched right now */
PICKMARKABLE = TESTMARKABLE,
PICKTEXTEDIT = DEEP | TESTMARKABLE | TESTTEXTEDIT,
PICKMACRO = DEEP | ALSOONMASTER | WHOLEPAGE | TESTMACRO,
};
namespace o3tl
{
- template<> struct typed_flags<SdrSearchOptions> : is_typed_flags<SdrSearchOptions, 0xbdff> {};
+ template<> struct typed_flags<SdrSearchOptions> : is_typed_flags<SdrSearchOptions, 0x03ff> {};
}
enum class SdrHitKind
@@ -267,13 +263,13 @@ public:
// Pick: Supported options for nOptions are:
// SdrSearchOptions::DEEP SdrSearchOptions::ALSOONMASTER SdrSearchOptions::TESTMARKABLE SdrSearchOptions::TESTTEXTEDIT
- // SdrSearchOptions::WITHTEXT SdrSearchOptions::TESTTEXTAREA SdrSearchOptions::BACKWARD SdrSearchOptions::MARKED
+ // SdrSearchOptions::MARKED
// SdrSearchOptions::WHOLEPAGE
SdrObject* PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions, SdrObject** ppRootObj, bool* pbHitPassDirect=nullptr) const;
SdrObject* PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions=SdrSearchOptions::NONE) const;
bool MarkObj(const Point& rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false);
- // Pick: Supported options for nOptions are SdrSearchOptions::PASS2BOUND and SdrSearchOptions::PASS3NEAREST
+ // Pick: Supported options for nOptions are SdrSearchOptions::PASS2BOUND
bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions) const;
// Selects the most upper of the marked objects (O1) and scans from there
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 00475d96a959..bbad824d3267 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1772,17 +1772,16 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
rpRootObj=nullptr;
if (pOL!=nullptr)
{
- const bool bBack(nOptions & SdrSearchOptions::BACKWARD);
const bool bRemap(
nullptr != pOL->getSdrObjectFromSdrObjList()
&& nullptr != dynamic_cast< const E3dScene* >(pOL->getSdrObjectFromSdrObjList()));
const E3dScene* pRemapScene(bRemap ? static_cast< E3dScene* >(pOL->getSdrObjectFromSdrObjList()) : nullptr);
const size_t nObjCount(pOL->GetObjCount());
- size_t nObjNum(bBack ? 0 : nObjCount);
+ size_t nObjNum(nObjCount);
- while (pRet==nullptr && (bBack ? nObjNum<nObjCount : nObjNum>0))
+ while (pRet==nullptr && nObjNum>0)
{
- if (!bBack) nObjNum--;
+ nObjNum--;
SdrObject* pObj;
if(bRemap)
@@ -1805,7 +1804,6 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
}
pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
if (pRet!=nullptr) rpRootObj=pObj;
- if (bBack) nObjNum++;
}
}
return pRet;
@@ -1825,7 +1823,6 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP
rpPV=nullptr;
bool bMarked(nOptions & SdrSearchOptions::MARKED);
bool bMasters=!bMarked && bool(nOptions & SdrSearchOptions::ALSOONMASTER);
- bool bBack(nOptions & SdrSearchOptions::BACKWARD);
// nOptions & SdrSearchOptions::NEXT: n.i.
// nOptions & SdrSearchOptions::PASS2BOUND: n.i.
// nOptions & SdrSearchOptions::PASS3NEAREST// n.i.
@@ -1833,21 +1830,20 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP
SdrObject* pObj=nullptr;
SdrObject* pHitObj=nullptr;
SdrPageView* pPV=nullptr;
- if (!bBack && static_cast<const SdrObjEditView*>(this)->IsTextEditFrameHit(rPnt)) {
+ if (static_cast<const SdrObjEditView*>(this)->IsTextEditFrameHit(rPnt)) {
pObj=static_cast<const SdrObjEditView*>(this)->GetTextEditObject();
pHitObj=pObj;
pPV=static_cast<const SdrObjEditView*>(this)->GetTextEditPageView();
}
if (bMarked) {
const size_t nMrkCnt=GetMarkedObjectCount();
- size_t nMrkNum=bBack ? 0 : nMrkCnt;
- while (pHitObj==nullptr && (bBack ? nMrkNum<nMrkCnt : nMrkNum>0)) {
- if (!bBack) nMrkNum--;
+ size_t nMrkNum=nMrkCnt;
+ while (pHitObj==nullptr && nMrkNum>0) {
+ nMrkNum--;
SdrMark* pM=GetSdrMarkByIndex(nMrkNum);
pObj=pM->GetMarkedSdrObj();
pPV=pM->GetPageView();
pHitObj=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,nullptr);
- if (bBack) nMrkNum++;
}
}
else
@@ -1866,10 +1862,10 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP
bool bWholePage(nOptions & SdrSearchOptions::WHOLEPAGE);
bool bExtraPassForWholePage=bWholePage && pPage!=pPV->GetObjList();
if (bExtraPassForWholePage) nPgCount++; // First search in AktObjList, then on the entire page
- sal_uInt16 nPgNum=bBack ? 0 : nPgCount;
- while (pHitObj==nullptr && (bBack ? nPgNum<nPgCount : nPgNum>0)) {
+ sal_uInt16 nPgNum=nPgCount;
+ while (pHitObj==nullptr && nPgNum>0) {
SdrSearchOptions nTmpOptions=nOptions;
- if (!bBack) nPgNum--;
+ nPgNum--;
const SdrLayerIDSet* pMVisLay=nullptr;
SdrObjList* pObjList=nullptr;
if (pbHitPassDirect!=nullptr) *pbHitPassDirect = true;
@@ -1892,7 +1888,6 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP
nTmpOptions=nTmpOptions | SdrSearchOptions::IMPISMASTER;
}
pHitObj=CheckSingleSdrObjectHit(rPnt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj,&(GetMarkedObjectList()));
- if (bBack) nPgNum++;
}
}
}
@@ -1913,14 +1908,6 @@ SdrObject* SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrPageView*& rpP
aHitRec.pPageView=pPV;
if (!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec)) pObj=nullptr;
}
- if (pObj!=nullptr && (nOptions & SdrSearchOptions::WITHTEXT) && pObj->GetOutlinerParaObject()==nullptr) pObj=nullptr;
- if (pObj!=nullptr && (nOptions & SdrSearchOptions::TESTTEXTAREA) && pPV)
- {
- if(!SdrObjectPrimitiveHit(*pObj, rPnt, 0, *pPV, nullptr, true))
- {
- pObj = nullptr;
- }
- }
if (pObj!=nullptr) {
pRet=pObj;
rpPV=pPV;
@@ -1933,7 +1920,6 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie
{
SortMarkedObjects();
const bool bBoundCheckOn2ndPass(nOptions & SdrSearchOptions::PASS2BOUND);
- const bool bCheckNearestOn3rdPass(nOptions & SdrSearchOptions::PASS3NEAREST);
rpObj=nullptr;
rpPV=nullptr;
const size_t nMarkCount=GetMarkedObjectCount();
@@ -1948,10 +1934,7 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie
return true;
}
}
- if (bBoundCheckOn2ndPass || bCheckNearestOn3rdPass) {
- SdrObject* pBestObj=nullptr;
- SdrPageView* pBestPV=nullptr;
- sal_uIntPtr nBestDist=ULONG_MAX;
+ if (bBoundCheckOn2ndPass) {
for (size_t nMarkNum=nMarkCount; nMarkNum>0;) {
--nMarkNum;
SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
@@ -1967,23 +1950,6 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie
rpPV=pPV;
return true;
}
- if (bCheckNearestOn3rdPass) {
- sal_uIntPtr nDist=0;
- if (rPnt.X()<aRect.Left()) nDist+=aRect.Left()-rPnt.X();
- if (rPnt.X()>aRect.Right()) nDist+=rPnt.X()-aRect.Right();
- if (rPnt.Y()<aRect.Top()) nDist+=aRect.Top()-rPnt.Y();
- if (rPnt.Y()>aRect.Bottom()) nDist+=rPnt.Y()-aRect.Bottom();
- if (nDist<nBestDist) {
- nBestDist = nDist;
- pBestObj=pObj;
- pBestPV=pPV;
- }
- }
- }
- if (bCheckNearestOn3rdPass) {
- rpObj=pBestObj;
- rpPV=pBestPV;
- return pBestObj!=nullptr;
}
}
return false;
More information about the Libreoffice-commits
mailing list