Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read named by sheet #10

Closed
wants to merge 36 commits into from
Closed

Read named by sheet #10

wants to merge 36 commits into from

Conversation

spoltier
Copy link
Member

@spoltier spoltier commented Aug 19, 2021

Copy link
Member

@riccardoporreca riccardoporreca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spoltier, see my comments and feedback.

On a general note, it might be good to have more consistency in terms of order of the additional argument, e.g. existsName(String name, String worksheetScope) vs. getReferenceFormula(String worksheetScope, String name). It seems more natural to add it after the name argument.

Copy link
Member

@riccardoporreca riccardoporreca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spoltier, some small refinements from a second pass

if(validOnly && !isValidNamedRegion(namedRegion)) continue;
nameNames.add(namedRegion.getNameName());
}
public String[] getDefinedNames(boolean validOnly, String worksheetScope) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is still a "global"/"any" scope?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given some details below I infer that worksheetScope = null is the "globa"/"any" scope ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarification (see miraisolutions/xlconnect#146 (comment) on the R side): worksheetScope = null means any, worksheetScope = "" means global scope only

public void createName(String name, String formula, boolean overwrite) {
if(existsName(name)) {

public void createName(String name, String worksheetScope, String formula, boolean overwrite) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, the formula may include the worksheet name, in which case worksheetScope would be redundant?

Copy link
Member Author

@spoltier spoltier Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formula may target a specific sheet, but the scope in which the name is defined (i.e. can be referenced) would be defined in worksheetScope. This is at least feasible manually in libreoffice:
image

src/main/java/com/miraisolutions/xlconnect/Workbook.java Outdated Show resolved Hide resolved
@spoltier spoltier force-pushed the feature/#37-named-by-sheet branch 3 times, most recently from 77b6b22 to 5f0e396 Compare January 17, 2024 09:14
@spoltier spoltier force-pushed the feature/#37-named-by-sheet branch from b27657f to ae5c94f Compare February 14, 2024 12:06
@spoltier spoltier closed this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants