public void addASection(ASection aSection, AData data) {

	int st = aSection.getStartOffset();
	int en = aSection.getEndOffset();
	int beg = Math.min(st, en);
	int len = Math.abs(st-en);	
	
	// удаляет сегменты с такими же границами
	Set<ASection> s = aDataMap.keySet();
	Iterator<ASection> it = s.iterator ();
	
	while(it.hasNext()){
		ASection sect = it.next(); 
		if (sect.getStartOffset() == beg && sect.getEndOffset() == beg+len) it.remove();
	}
	
	//startCompoundEdit();

	setCharacterAttributes(beg, len, aSection.getAttributes(), false);
	aDataMap.put(aSection, data);
	fireUndoableEditUpdate(new UndoableEditEvent(this,new ASectionAdditionEdit(aSection,data)));
	//endCompoundEdit();
	
	fireADocumentChanged();
}