Get a slide index on impress

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
HCL
Posts: 22
Joined: Thu Jul 22, 2021 3:55 am

Get a slide index on impress

Post by HCL »

How to get a slide index?

====================================
I found a way to get indirectly.

But I think it's not smart, and may make some accident.

Code: Select all

	public static int get_index(XDrawPage xpage) {
		XNamed xnamed = UnoRuntime.queryInterface(XNamed.class, xpage); // The name is "Page00"
		Pattern p = Pattern.compile("(\\d+)"); // Get the name using regex expression
		Matcher m = p.matcher(xnamed.getName());
		m.find();
		int page = Integer.parseInt(m.group()) - 1;
		return page;
	}
OpenOffice 3.1 on Windows 10
Post Reply