File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,35 @@ procedure Register;
9595
9696implementation
9797
98- uses LCLType;
98+ uses LCLType, XMLRead ;
9999
100100procedure Register ;
101101begin
102102 RegisterComponents(' BGRA Themes' , [TBGRASVGImageList]);
103103end ;
104104
105+ { $IF FPC_FULLVERSION < 30203}
106+ type
107+
108+ { TPatchedXMLConfig }
109+
110+ TPatchedXMLConfig = class (TXMLConfig)
111+ public
112+ procedure LoadFromStream (S : TStream); reintroduce;
113+ end ;
114+
115+
116+ { TPatchedXMLConfig }
117+
118+ procedure TPatchedXMLConfig.LoadFromStream (S: TStream);
119+ begin
120+ FreeAndNil(Doc);
121+ ReadXMLFile(Doc,S);
122+ FModified := False;
123+ if (Doc.DocumentElement.NodeName<>RootName) then
124+ raise EXMLConfigError.CreateFmt(SWrongRootName,[RootName,Doc.DocumentElement.NodeName]);
125+ end ;
126+ { $ENDIF}
105127{ TBGRASVGImageList }
106128
107129procedure TBGRASVGImageList.ReadData (Stream: TStream);
@@ -140,7 +162,7 @@ procedure TBGRASVGImageList.ReadData(Stream: TStream);
140162 FDataLineBreak:= GetLineEnding(Stream);
141163 // Actually load the XML file
142164 Stream.Position := 0 ;
143- FXMLConf.LoadFromStream(Stream);
165+ { $IF FPC_FULLVERSION < 30203 } TPatchedXMLConfig( FXMLConf) { $ELSE } FXMLConf { $ENDIF } .LoadFromStream(Stream);
144166 Load(FXMLConf);
145167 finally
146168 FXMLConf.Free;
You can’t perform that action at this time.
0 commit comments