Bug 947281 - Fix calcuations for how many actionbar items to show. r=sriram,margaret