-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance the excel output to get the formatting option of text-indent (#…
…1667) * Enhance the excel output to get the formatting option of text indent (#1666) * Add a new option to define the indent mode for the internal calculation
- Loading branch information
1 parent
dca1895
commit 71ce2d9
Showing
7 changed files
with
333 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
* Copyright (c) 2011, 2012, 2013 James Talbut. | ||
* [email protected] | ||
* | ||
* | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* | ||
* Contributors: | ||
* James Talbut - Initial implementation. | ||
************************************************************************************/ | ||
|
@@ -40,6 +40,7 @@ public class ClientAnchorConversions { | |
private static final short EXCEL_COLUMN_WIDTH_FACTOR = 256; | ||
private static final int UNIT_OFFSET_LENGTH = 7; | ||
private static final int[] UNIT_OFFSET_MAP = { 0, 36, 73, 109, 146, 182, 219 }; | ||
private static final double MILLIMETRE_INDENT_FACTOR = 2.38; | ||
|
||
/** | ||
* Convert a measure in column width units (1/256th of a character) to a measure | ||
|
@@ -69,6 +70,17 @@ public static int millimetres2WidthUnits(double millimetres) { | |
return widthUnits; | ||
} | ||
|
||
/** | ||
* Convert a measure of millimetres to indent units. | ||
* | ||
* @param millimetres The size in millimetres. | ||
* @return The size in indent units. | ||
*/ | ||
public static int millimetres2IndentUnits(double millimetres) { | ||
int indentUnits = (int) Math.round(millimetres / MILLIMETRE_INDENT_FACTOR); | ||
return indentUnits; | ||
} | ||
|
||
/** | ||
* Convert a measure of pixels to millimetres (for column widths). | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.