Fix Balloon Next Index Persistance
- next sequential number for balloon on Page was not being preserved across save/restore
This commit is contained in:
@@ -101,6 +101,9 @@ DrawPage::DrawPage(void)
|
||||
}
|
||||
|
||||
ADD_PROPERTY_TYPE(Scale, (1.0), group, (App::PropertyType)(App::Prop_None), "Scale factor for this Page");
|
||||
ADD_PROPERTY_TYPE(NextBalloonIndex, (1), group, (App::PropertyType)(App::Prop_None),
|
||||
"Auto-numbering for Balloons");
|
||||
|
||||
Scale.setConstraints(&scaleRange);
|
||||
double defScale = hGrp->GetFloat("DefaultScale",1.0);
|
||||
Scale.setValue(defScale);
|
||||
@@ -406,6 +409,14 @@ void DrawPage::unsetupObject()
|
||||
Template.setValue(nullptr);
|
||||
}
|
||||
|
||||
int DrawPage::getNextBalloonIndex(void)
|
||||
{
|
||||
int result = NextBalloonIndex.getValue();
|
||||
int newValue = result + 1;
|
||||
NextBalloonIndex.setValue(newValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
void DrawPage::Restore(Base::XMLReader &reader)
|
||||
{
|
||||
reader.readElement("Properties");
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
|
||||
App::PropertyFloatConstraint Scale;
|
||||
App::PropertyEnumeration ProjectionType; // First or Third Angle
|
||||
|
||||
App::PropertyInteger NextBalloonIndex;
|
||||
|
||||
/** @name methods override Feature */
|
||||
//@{
|
||||
@@ -91,7 +93,9 @@ public:
|
||||
void requestPaint(void);
|
||||
std::vector<App::DocumentObject*> getAllViews(void) ;
|
||||
bool balloonPlacing;
|
||||
DrawViewPart *balloonParent;
|
||||
DrawViewPart *balloonParent; //could be many balloons on page?
|
||||
|
||||
int getNextBalloonIndex(void);
|
||||
|
||||
protected:
|
||||
void onBeforeChange(const App::Property* prop);
|
||||
|
||||
Reference in New Issue
Block a user