@@ -64,6 +64,9 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
6464#include " stacksecurity.h"
6565#include " stackfileformat.h"
6666
67+ #include " paragraf.h"
68+ #include " MCBlock.h"
69+
6770#include " exec.h"
6871#include " graphicscontext.h"
6972
@@ -5133,6 +5136,50 @@ bool MCObject::haswidgets(void)
51335136 return t_visitor . found_widget;
51345137}
51355138
5139+ struct MCRequiredStackFileVersionVisitor : public MCObjectVisitor
5140+ {
5141+ uint32_t required_version;
5142+
5143+ bool OnObject (MCObject *p_object)
5144+ {
5145+ required_version = MCMax (required_version, p_object->getminimumstackfileversion ());
5146+
5147+ // keep looking if current required version is less than the maximum
5148+ return required_version < kMCStackFileFormatCurrentVersion ;
5149+ }
5150+
5151+ // make sure blocks and paragraphs are checked
5152+ bool OnParagraph (MCParagraph *p_paragraph)
5153+ {
5154+ required_version = MCMax (required_version, p_paragraph->getminimumstackfileversion ());
5155+
5156+ // keep looking if current required version is less than the maximum
5157+ return required_version < kMCStackFileFormatCurrentVersion ;
5158+ }
5159+
5160+ bool OnBlock (MCBlock *p_block)
5161+ {
5162+ required_version = MCMax (required_version, p_block->getminimumstackfileversion ());
5163+
5164+ // keep looking if current required version is less than the maximum
5165+ return required_version < kMCStackFileFormatCurrentVersion ;
5166+ }
5167+ };
5168+
5169+ uint32_t MCObject::geteffectiveminimumstackfileversion (void )
5170+ {
5171+ MCRequiredStackFileVersionVisitor t_visitor;
5172+ t_visitor.required_version = kMCStackFileFormatMinimumExportVersion ;
5173+ visit (kMCObjectVisitorRecursive , 0 , &t_visitor);
5174+ return t_visitor.required_version ;
5175+ }
5176+
5177+ uint32_t MCObject::getminimumstackfileversion (void )
5178+ {
5179+ // Default minimum stack file version
5180+ return kMCStackFileFormatMinimumExportVersion ;
5181+ }
5182+
51365183// AL-2015-06-30: [[ Bug 15556 ]] Refactored function to sync mouse focus
51375184void MCObject::sync_mfocus (void )
51385185{
0 commit comments