Kaydet (Commit) 45ba5f2f authored tarafından Noel Grandin's avatar Noel Grandin

convert IMPSDR_ constants to scoped enum

Change-Id: Id267196397e2aa743d75f03932b3301ad462d800
üst 11bce321
...@@ -83,9 +83,13 @@ enum SdrViewEditMode {SDREDITMODE_EDIT, // Also known as arrow or poin ...@@ -83,9 +83,13 @@ enum SdrViewEditMode {SDREDITMODE_EDIT, // Also known as arrow or poin
SDREDITMODE_CREATE, // Tool for object creation SDREDITMODE_CREATE, // Tool for object creation
SDREDITMODE_GLUEPOINTEDIT}; // Glue point editing mode SDREDITMODE_GLUEPOINTEDIT}; // Glue point editing mode
#define IMPSDR_POINTSDESCRIPTION 0x0001 /** options for ImpTakeDescriptionStr() */
#define IMPSDR_GLUEPOINTSDESCRIPTION 0x0002 enum class ImpTakeDescriptionOptions
{
NONE = 0,
POINTS = 1,
GLUEPOINTS = 2,
};
class ImplMarkingOverlay; class ImplMarkingOverlay;
...@@ -161,7 +165,7 @@ protected: ...@@ -161,7 +165,7 @@ protected:
SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const; SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const; SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const;
bool ImpIsFrameHandles() const; bool ImpIsFrameHandles() const;
void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal=0, sal_uInt16 nOpt=0) const; void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal=0, ImpTakeDescriptionOptions nOpt=ImpTakeDescriptionOptions::NONE) const;
// Generates a string including degrees symbol, from an angel specification in 1/100deg // Generates a string including degrees symbol, from an angel specification in 1/100deg
bool ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark); bool ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark);
......
...@@ -563,11 +563,11 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag() ...@@ -563,11 +563,11 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag()
void SdrDragMethod::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal) const void SdrDragMethod::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal) const
{ {
sal_uInt16 nOpt=0; ImpTakeDescriptionOptions nOpt=ImpTakeDescriptionOptions::NONE;
if (IsDraggingPoints()) { if (IsDraggingPoints()) {
nOpt=IMPSDR_POINTSDESCRIPTION; nOpt=ImpTakeDescriptionOptions::POINTS;
} else if (IsDraggingGluePoints()) { } else if (IsDraggingGluePoints()) {
nOpt=IMPSDR_GLUEPOINTSDESCRIPTION; nOpt=ImpTakeDescriptionOptions::GLUEPOINTS;
} }
getSdrDragView().ImpTakeDescriptionStr(nStrCacheID,rStr,nVal,nOpt); getSdrDragView().ImpTakeDescriptionStr(nStrCacheID,rStr,nVal,nOpt);
} }
......
...@@ -2023,18 +2023,18 @@ const Rectangle& SdrMarkView::GetMarkedObjRect() const ...@@ -2023,18 +2023,18 @@ const Rectangle& SdrMarkView::GetMarkedObjRect() const
void SdrMarkView::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal, sal_uInt16 nOpt) const void SdrMarkView::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, OUString& rStr, sal_uInt16 nVal, ImpTakeDescriptionOptions nOpt) const
{ {
rStr = ImpGetResStr(nStrCacheID); rStr = ImpGetResStr(nStrCacheID);
sal_Int32 nPos = rStr.indexOf("%1"); sal_Int32 nPos = rStr.indexOf("%1");
if(nPos != -1) if(nPos != -1)
{ {
if(nOpt == IMPSDR_POINTSDESCRIPTION) if(nOpt == ImpTakeDescriptionOptions::POINTS)
{ {
rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedPoints()); rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedPoints());
} }
else if(nOpt == IMPSDR_GLUEPOINTSDESCRIPTION) else if(nOpt == ImpTakeDescriptionOptions::GLUEPOINTS)
{ {
rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedGluePoints()); rStr = rStr.replaceAt(nPos, 2, GetDescriptionOfMarkedGluePoints());
} }
......
...@@ -1282,11 +1282,11 @@ OUString SdrView::GetStatusText() ...@@ -1282,11 +1282,11 @@ OUString SdrView::GetStatusText()
ImpTakeDescriptionStr(STR_ViewMarked,aStr); ImpTakeDescriptionStr(STR_ViewMarked,aStr);
if (IsGluePointEditMode()) { if (IsGluePointEditMode()) {
if (HasMarkedGluePoints()) { if (HasMarkedGluePoints()) {
ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_GLUEPOINTSDESCRIPTION); ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,ImpTakeDescriptionOptions::GLUEPOINTS);
} }
} else { } else {
if (HasMarkedPoints()) { if (HasMarkedPoints()) {
ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_POINTSDESCRIPTION); ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,ImpTakeDescriptionOptions::POINTS);
} }
} }
} else { } else {
......
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