Fix Balloon Next Index Persistance

- next sequential number for balloon on Page was
  not being preserved across save/restore
This commit is contained in:
wandererfan
2019-05-25 11:48:23 -04:00
committed by wmayer
parent da047abdd9
commit a0ea8b656b
6 changed files with 46 additions and 23 deletions

View File

@@ -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");