mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-29 11:49:29 +00:00
tidying
This commit is contained in:
parent
8633d082b3
commit
486180e423
@ -168,16 +168,25 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
public String getText ()
|
public String getText ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
return showDebugText ? getHexText () : getProgramText ();
|
if (showDebugText)
|
||||||
|
return getHexText ();
|
||||||
|
|
||||||
|
StringBuilder text =
|
||||||
|
basicPreferences.formatApplesoft ? getFormatted () : originalFormat ();
|
||||||
|
|
||||||
|
if (basicPreferences.showAllXref)
|
||||||
|
addXref (text);
|
||||||
|
|
||||||
|
while (text.length () > 0 && text.charAt (text.length () - 1) == '\n')
|
||||||
|
text.deleteCharAt (text.length () - 1);
|
||||||
|
|
||||||
|
return text.toString ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
private String getProgramText ()
|
private StringBuilder getFormatted ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
if (!basicPreferences.formatApplesoft)
|
|
||||||
return originalFormat ();
|
|
||||||
|
|
||||||
int indentSize = 2;
|
int indentSize = 2;
|
||||||
boolean insertBlankLine = false;
|
boolean insertBlankLine = false;
|
||||||
|
|
||||||
@ -340,14 +349,14 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
fullText.append ("\n");
|
fullText.append ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basicPreferences.showAllXref)
|
// if (basicPreferences.showAllXref)
|
||||||
addXref (fullText);
|
// addXref (fullText);
|
||||||
|
//
|
||||||
|
// if (fullText.length () > 0)
|
||||||
|
// while (fullText.charAt (fullText.length () - 1) == '\n')
|
||||||
|
// fullText.deleteCharAt (fullText.length () - 1); // remove trailing newlines
|
||||||
|
|
||||||
if (fullText.length () > 0)
|
return fullText;
|
||||||
while (fullText.charAt (fullText.length () - 1) == '\n')
|
|
||||||
fullText.deleteCharAt (fullText.length () - 1); // remove trailing newlines
|
|
||||||
|
|
||||||
return fullText.toString ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
@ -929,7 +938,7 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
private String originalFormat ()
|
private StringBuilder originalFormat ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
StringBuilder text = new StringBuilder ();
|
StringBuilder text = new StringBuilder ();
|
||||||
@ -959,12 +968,6 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
text.append ("\n");
|
text.append ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basicPreferences.showAllXref)
|
return text;
|
||||||
addXref (text);
|
|
||||||
|
|
||||||
if (text.length () > 0)
|
|
||||||
text.deleteCharAt (text.length () - 1);
|
|
||||||
|
|
||||||
return text.toString ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user