only read pattern if there are any elements
only read pattern if there are any elements

Change-Id: Ife3fc87a169f2fcf58092fa1193668913a02356f

LibreOffice/libetonyek,LibreOffice/libetonyek,LibreOffice/libetonyek