Code Formatter 2.4.7

Java 7 supports new constructs such as a string literal in the form 0b11_011_111. This type of construct is now supported.
Another new Java 7 feature allows for things such as

int #"I am a strange variable name" = 7;

This construct is also supported.

I added new keywords to C++ related to c++_0xx, and also, C++ now allows for hex constants, binary, and octal constants.

Download extension
Version: 2.4.7 Date: 2011-Apr-21 Size: 47.69 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 8 | Week: 102 | Month: 334 | Year: 3,855

Code Formatter 2.4.6

Added the integer division symbol (\) as a special character and a word separator for Basic. Added numerous previously unsupported keywords. Some keywords are new to OOo, and some were a missing for no good reason. No changes have been made outside of Basic.

Download extension
Version: 2.4.6 Date: 2011-Apr-02 Size: 47.14 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 1 | Month: 4 | Year: 1,082

Code Formatter 2.4.4

The underscore character "_" is no longer considered a word separator. The special case of "_" as the last character is handled separately, but only when not in the context of another words. This means that ending a line with "bob_" will keep "_" as part of the variable rather than colorizing it differently. This also prevents "a_2" from showing the 2 as a number and "_" as a special character.

Perhaps I should not treat "_" as a word separator in other languages either.....

Download extension
Version: 2.4.4 Date: 2010-Jun-24 Size: 46.64 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 1 | Month: 5 | Year: 6,142

Code Formatter 2.4.2

Added support for C#. I use the Java parser, BASIC color scheme, and C# keywords (including conceptual keywords such as get and set).
Modified C++ so that it directly calls the BASIC color scheme rather than duplicating it (shorter code and less error prone).
Updated the descriptions to indicate the languages that can be color-coded.
Added CSharp support to the primary driver module.
Removed a few garbage files that bloated the size (there were two copies of each basic module, oops).

Download extension
Version: 2.4.2 Date: 2009-Dec-14 Size: 46.56 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 2 | Year: 3,808

Code Formatter 2.4.1

Improved French translation for the the configuration dialog courtesy of Camille Moulin... Thanks Camille, I am not able to provide good translations without help.

Download extension
Version: 2.4.1 Date: 2009-Oct-28 Size: 67.33 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 1 | Month: 2 | Year: 1,815

Code Formatter 2.4.0

Fixed a problem for PERL that caused the forward slash in $/ to be recognized as the start of a regular expression.

I created a master module that consolidates the code for handling: colorize the selected text, colorize the fragment at the cursor, and colorize the entire document. The individual routines call the master with arguments that specify the desired language and mode. This consolidates the driver code so that there is one copy. The result is a smaller package with less code.

Download extension
Version: 2.4.0 Date: 2009-Aug-20 Size: 45.17 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 0 | Year: 2,420

Code Formatter 2.3.7

PERL now recognizes the backslash character as a special character; for example \$temp.

A few new keywords were added to PERL. I do not remember them all, but I did add: our, subs, and strict.

Many routines verified that a required paragraph styles was used. This code has been moved to a common location. The end result is that the code is smaller.

As usual, be certain to let me know if you find any problems.

Download extension
Version: 2.3.7 Date: 2009-Aug-18 Size: 45.45 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 0 | Year: 771

Code Formatter 2.3.6

Version 2.3.6 supports BASIC, C++, Java, XML, PERL, and Python. PERL and Python are new. I have tested a bit of PERL, because I am working on an extensive PERL document that I will post when I have time. I have spent much time using PERL, so support is likely pretty good.

I received a special request for Python support. I spent about an hour adding support and I have only tested this on two samples.
Python, however, I added by special request, I have only spent about an hour working on the code. Also, I have not used Python, so I cannot easily test the code.

This extension provides the ability to colorize code segments. There are two modes of operation. The first mode (the least used mode for me) is to select the code that you want to colorize, and then use the menu options under: Tools > Add-Ons > MacroFormatterADP

I use a specific paragraph style for my code. I usually use _OOoComputerCodeLastLine for the last line of code in a segment, and _OOoComputerCode for the rest. So, for four lines of code, the first three use _OOoComputerCode and then the last line uses _OOoComputerCodeLastLine. This group then defines an entire code snippet.

Character styles are used for each portion of the code; for example, there is a character style for keywords, and another for literals. This is how color is assigned.

The code that identifies the specific portions is certainly not complete. In other words, I did not write a complete grammar interpreter for each supported language. My intention is to provide something that is "close enough" for regular use. That said, if you find glaring issues, be certain to let me know so that I can fix them. Also, if you fix errors, please share your solution. This latest version supports PERL. I use variable names such as "shall_print", and I noticed that "print" was colorized as a keyword. I corrected this for PERL. If you find something similar in another language, let me know and I will fix it.

When I say that I am only looking for "good enough" support, this means that I may fail under strange situations. An example of an untested, but expected failure is as follows:

Create a single line of code such as "a = 1; // line comment".

If you select the code inside the double quotes, I expect that the single line comment will continue to the end of the paragraph without verifying that this runs past the ends of the selected text. If this is tested and found to be in error, I will fix the problem.

Download extension
Version: 2.3.6 Date: 2009-Aug-11 Size: 46.14 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 0 | Year: 945

Code Formatter 2.3.0

Numerous locales added. The dialog will show correctly for English and Russian. I added some tentative translation work for Spanish, French, German, and Japanese. If you have language abilities, I would love a little help in this area. Special thanks to ПШ deye for his work in this area. You can thank him for Russian and anything in French that is correct; all the errors are mine :-)

I added code to handle new string syntax for C++0x; for example uR"xyz[I am a raw unicode string]xyz";

Color code XML, C++, Java, or StarBasic for a better appearance. StarBasic is formatted to like like the OOo IDE. Java colors mimic those in Eclipse.

A block of code is assumed to be formatted based on the following paragraph styles: _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

Download extension
Version: 2.3.0 Date: 2009-Jun-20 Size: 39.75 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 2 | Month: 3 | Year: 2,153

Code Formatter 2.2.2

Fixed the library not loaded bug and changed the configuration dialog to choose a different next paragraph style if the one in the database is not present in the current document.

Color code XML, C++, Java, or StarBasic for a better appearance. StarBasic is formatted to like like the OOo IDE. Java colors mimic those in Eclipse.

A block of code is assumed to be formatted based on the following paragraph styles: _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

Download extension
Version: 2.2.2 Date: 2009-Jun-15 Size: 30.97 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 1 | Month: 1 | Year: 1,061

Code Formatter 2.2.1

Source Code fragments in XML, C++, Java, or StarBasic can be color coded for a better appearance.

A block of code is assumed to be formatted based on the following paragraph styles: _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

This version introduces a configuration dialog. There is much that could still be done, but this should allow you to avoid issues such as Poor font choices or paragraph styles that do not exist in your system.

I recommend that you install the upgrade and then restart OOo. Also, the first time you attempt to configure OOo from the menu, it may fail. I have not determined why this is so, but just tell it to try again.

Download extension
Version: 2.2.1 Date: 2009-Jun-15 Size: 30.86 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 0 | Year: 593

Code Formatter 2.1.1

Source Code fragments in XML, C++, Java, or StarBasic can be color coded for a better appearance. StarBasic is formatted to like like the OOo IDE. Java colors mimic those in Eclipse.

A block of code is assumed to be formatted based on the following paragraph styles: _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

I added code to search for default paragraph and character styles in a few different locals (English, French, Spanish, and Russian). If you have the name for other locals, let me know the name of the Default style.

Download extension
Version: 2.1.1 Date: 2009-Jun-07 Size: 23.1 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 1 | Year: 927

Code Formatter 2.1.0

Added support, and menus, for colorizing selected text only. I also add description text. Use Tools > Add-ons > MacroFormatterADP to view the menus.

Source Code fragments in XML, C++, Java, or StarBasic can be color coded for a better appearance. StarBasic is formatted to like like the OOo IDE. Java colors mimic those in Eclipse.

A block of code is assumed to be formatted based on the following paragraph styles: _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line. There is a menu option to create the required paragraph styles.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

Download extension
Version: 2.1.0 Date: 2009-Jun-03 Size: 22.7 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 1 | Year: 554

Code Formatter 2.0.0

New to this realease is support for XML, the ability to create the required paragraph styles, and a menu under Tools > Add-ons.

Fragments in C++, Java, StarBasic, or XML can be color coded for a better appearance. StarBasic is formatted to like like the OOo IDE. Java colors mimic those in Eclipse. This is the macro used to format the examples in AndrewMacro.odt.

The code is written to work with paragraphs. For a paragraph to be color coded, the paragraph should formatted using on of the supported paragraph styles; for example, _OOoComputerCode, _OOoComputerCodeLastLine, _code, _code_first_line, _code_last_line, or _code_one_line.

A menu option is added under Tools > Add-ons to format all the supported types, and also, to create the required paragraph styles in the current document.

Numerous color code examples are shown in AndrewMacro.odt, along with a complete description of the add-in.

Download extension
Version: 2.0.0 Date: 2009-Jun-03 Size: 236.13 KB
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Downloads: Today: 0 | Week: 0 | Month: 3 | Year: 538

Code Formatter 1.1.0

Small changes have been made from the original version. Also, I noticed that you could NOT download the current version.

This release adds menu items to colorize the code under the cursor.

Download extension
Version: 1.1.0 Date: 2008-May-07 Size: 15.79 KB
Operating System: System Independent
Downloads: Today: 0 | Week: 2 | Month: 3 | Year: 9,457