-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Mark OOSTyle as invalid if no defaultStyle #5471
Changes from 1 commit
bf8dd0d
29c8fe7
852b487
fafdad7
3a0e6af
918b263
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,7 @@ public class OOBibStyle implements Comparable<OOBibStyle> { | |
private File styleFile; | ||
private long styleFileModificationTime = Long.MIN_VALUE; | ||
private String localCopy; | ||
private boolean setDefault; | ||
public OOBibStyle(File styleFile, LayoutFormatterPreferences prefs, | ||
Charset encoding) throws IOException { | ||
this.prefs = Objects.requireNonNull(prefs); | ||
|
@@ -143,7 +144,7 @@ public OOBibStyle(String resourcePath, LayoutFormatterPreferences prefs) throws | |
} | ||
|
||
public Layout getDefaultBibLayout() { | ||
return defaultBibLayout; | ||
return defaultBibLayout ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the added space |
||
} | ||
|
||
private void setDefaultProperties() { | ||
|
@@ -272,7 +273,7 @@ private void readFormatFile(Reader in) throws IOException { | |
if (!line.isEmpty() && (line.charAt(line.length() - 1) == '\r')) { | ||
line = line.substring(0, line.length() - 1); | ||
} | ||
// Check for empty line or comment: | ||
// Check for empty lin e or comment: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this change
Siedlerchr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (line.trim().isEmpty() || (line.charAt(0) == '#')) { | ||
continue; | ||
} | ||
|
@@ -321,13 +322,11 @@ private void readFormatFile(Reader in) throws IOException { | |
} | ||
|
||
} | ||
|
||
// Set validity boolean based on whether we found anything interesting | ||
// in the file: | ||
if (mode != BibStyleMode.NONE) { | ||
if ((mode != BibStyleMode.NONE) && setDefault) { | ||
valid = true; | ||
} | ||
|
||
} | ||
|
||
/** | ||
|
@@ -350,7 +349,7 @@ private void handleStructureLine(String line) { | |
int index = line.indexOf('='); | ||
if ((index > 0) && (index < (line.length() - 1))) { | ||
String formatString = line.substring(index + 1); | ||
boolean setDefault = line.substring(0, index).equals(OOBibStyle.DEFAULT_MARK); | ||
setDefault = line.substring(0, index).equals(OOBibStyle.DEFAULT_MARK); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix the ident |
||
EntryType type = EntryTypeFactory.parse(line.substring(0, index)); | ||
try { | ||
Layout layout = new LayoutHelper(new StringReader(formatString), this.prefs).getLayoutFromText(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename the variable to
setDefaultLayout
or smething?Currently, the name is not that readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes yes yes, I knew it. In the pipeline