Bug 105532 - [Text] NPE if TextFlow's layout manager is changed after it has been added to parent
Summary: [Text] NPE if TextFlow's layout manager is changed after it has been added to...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-28 18:04 EDT by Pratik Shah CLA
Modified: 2010-11-04 17:27 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Shah CLA 2005-07-28 18:04:14 EDT
FlowPage page = new FlowPage();
TextFlow text = new TextFlow();
page.add(text);
text.setLayoutManager(new ParagraphTextLayout(text));
text.setText("some text");
page.setFont(new Font(null, "Tahoma", 8, 0));
page.setSize(100, 30);
page.validate();

The NPE will be encountered during page.validate() because the text flow's new 
layout's context is null.

I think this is an unnecessary restriction on the user of Draw2d and we can 
fix this by caching the context in the FlowFigure instead of the 
FlowFigureLayout.  The layout can then just get it from the figure.