View Issue Details

IDProjectCategoryView StatusLast Update
0000162FakturamaOpenOffice / NOApublic2013-09-18 13:21
ReporterNorthbridge Assigned Torheydenr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.4 
Target Version1.6 
Summary0000162: Die Zeilenenden in OpenOffice werden nicht korrekt gesetzt auf Mac OS X / Linux
Description

Fakturama verwendet für mehrzeilige Textfelder immer die Zeilenenden die vom System vorgegeben werden. Dies stimmt leider nicht mit dem Verhalten von OpenOffice überein, welches auf allen Platformen "\r" für Zeilenenden verwendet. Das Resultat ist, dass die Zeilenenden auf Mac OS X und Linux ("\n") keine richtigen Zeilenenden in OpenOffice generieren, sondern nur pseudo Zeilenenden die z.B. bei Blocksatz bewirken, dass die letzte Zeile ebenfalls über die ganze Seite gezogen wird anstatt linksbündig zu sein.
Als Lösung für mich konnte ich die OS Zeilenenden durch "\r" ersetzen und habe anschließend das richtige Resultat bekommen. Ich habe meinen Patch angehangen. Leider konnte ich ihn nur auf OS X und Linux testen. Ob er das Programm auf Windows beschädigt müsste noch getestet werden.

TagsNo tags attached.
Attached Files
FixLineEndings.diff (1,386 bytes)   
Index: src/com/sebulli/fakturama/office/OfficeDocument.java
===================================================================
--- src/com/sebulli/fakturama/office/OfficeDocument.java	(Revision 605)
+++ src/com/sebulli/fakturama/office/OfficeDocument.java	(Arbeitskopie)
@@ -50,6 +50,7 @@
 import ag.ion.noa.graphic.GraphicInfo;
 
 import com.sebulli.fakturama.Activator;
+import com.sebulli.fakturama.OSDependent;
 import com.sebulli.fakturama.Workspace;
 import com.sebulli.fakturama.calculate.Price;
 import com.sebulli.fakturama.calculate.VatSummaryItem;
@@ -1049,9 +1050,16 @@
 	private void replaceText(ITextField placeholder) {
 		// Get the placeholder's text
 		String placeholderDisplayText = placeholder.getDisplayText().toUpperCase();
-
-		// Replace it with the value of the property list.
-		placeholder.getTextRange().setText(properties.getProperty(placeholderDisplayText));
+		
+		// Get the value of the Property list.
+		String text = properties.getProperty(placeholderDisplayText);
+		
+		// If the String is non empty, replace the OS new line with the OpenOffice new line
+		if(text != null){
+			text = text.replaceAll(OSDependent.getNewLine(), "\r");
+		}
+		// Replace the placeholder with the value of the property list.
+		placeholder.getTextRange().setText(text);
 	}
 	
 	static public boolean testOpenAsExisting(DataSetDocument document, String template) {
FixLineEndings.diff (1,386 bytes)   

Relationships

related to 0000221 resolvedrheydenr Zeilenenden in LibreOffice werden falsch angezeigt 

Activities

rheydenr

2013-03-29 21:15

administrator   ~0000106

Test unter Windows verlief mit dem Patch auch erfolgreich.

Issue History

Date Modified Username Field Change
2013-02-11 12:47 Northbridge New Issue
2013-02-11 12:47 Northbridge File Added: FixLineEndings.diff
2013-03-28 01:25 rheydenr Product Version 1.5.2 => 1.5.4
2013-03-28 01:25 rheydenr Target Version => 1.5.5
2013-03-28 01:34 rheydenr Assigned To => rheydenr
2013-03-28 01:34 rheydenr Status new => assigned
2013-03-29 21:15 rheydenr Note Added: 00106
2013-03-29 21:15 rheydenr Status assigned => closed
2013-03-29 21:15 rheydenr Resolution open => fixed
2013-03-29 21:15 rheydenr Fixed in Version => 1.5.5
2013-04-21 22:24 rheydenr Target Version 1.5.5 => 1.6
2013-09-17 02:14 Homer Issue cloned: 0000220
2013-09-18 13:21 rheydenr Relationship added related to 0000221