You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2020/07/31 15:36:41 UTC

[openoffice] 05/05: Deal with a test that expects strikeout style (X, /, bold, etc.) to be preserved when saving to .doc, even though neither the fileformat, nor apparently MS Office itself, support that.

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 87fe75f03a3a0bfa9515b1bb7a7adfd7a3851882
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Fri Jul 31 07:30:41 2020 +0200

    Deal with a test that expects strikeout style (X, /, bold, etc.)
    to be preserved when saving to .doc, even though neither
    the fileformat, nor apparently MS Office itself, support that.
    
    Closes i120656 - the bold,with / and with X strike through change to single when save to doc
    
    Patch by: me
    
    (cherry picked from commit 4e588b9e25e0ea797c0e7d78b564a1b48a56819e)
---
 .../uno/sw/puretext/CharacterStrikeThrough.java    | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java b/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
index 689bd66..9b86142 100644
--- a/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
+++ b/test/testuno/source/fvt/uno/sw/puretext/CharacterStrikeThrough.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.*;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Testspace;
@@ -51,7 +50,7 @@ public class CharacterStrikeThrough {
 		app.close();
 	}
 
-	@Test@Ignore("Bug #120656 - [testUNO patch]bold,/,X strike through change to single when save to doc")
+	@Test
 	public void testCharacterStrikeThroughSetting() throws Exception {
 		XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document
 		xText = xTextDocument.getText();
@@ -141,26 +140,27 @@ public class CharacterStrikeThrough {
 		XTextCursor xTextCursor_assert_doc=assertDocument_doc.getText().createTextCursor();
 		XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert_doc);
 		//verify set property
+                // Bug #120656 - [testUNO patch]bold,/,X strike through change to single when save to doc
 		xTextCursor_assert_doc.gotoStart(false);
 		xTextCursor_assert_doc.goRight((short) 100, true);
-		assertEquals("assert strikethrough is bold",com.sun.star.awt.FontStrikeout.BOLD,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-		xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+		assertEquals("for .doc assert strikethrough is SINGLE instead of bold",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+		xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
 		xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is don'tknow",com.sun.star.awt.FontStrikeout.NONE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        assertEquals("for .doc assert strikethrough is SINGLE instead of don'tknow",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is double",com.sun.star.awt.FontStrikeout.DOUBLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is without",com.sun.star.awt.FontStrikeout.NONE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
         assertEquals("assert strikethrough is single",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is with /",com.sun.star.awt.FontStrikeout.SLASH,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
-        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_odt, false);
+        assertEquals("for .doc assert strikethrough is SINGLE instead of /",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false);
         xTextCursor_assert_doc.goRight((short) 100, true);
-        assertEquals("assert strikethrough is with X",com.sun.star.awt.FontStrikeout.X,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
+        assertEquals("for .doc assert strikethrough is SINGLE instead of X",com.sun.star.awt.FontStrikeout.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharStrikeout"));
 	}
 }