Fix for subscript/superscript conversion for 6.2 and lower
This commit is contained in:
parent
bb40dc7935
commit
7ee4a43c49
1 changed files with 59 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark11
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark12
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -863,6 +863,30 @@ Private Sub fromTextSubscript
|
|||
convertEnclosuresToFormat(CHR(872), styleNames, styleValues)
|
||||
End Sub
|
||||
|
||||
Private Sub toTextSuperscriptOld
|
||||
styleNames = Array("CharEscapementHeight","CharEscapement")
|
||||
styleValues = Array(58,101)
|
||||
convertFormatToEnclosure(CHR(871), styleNames, styleValues)
|
||||
End Sub
|
||||
|
||||
Private Sub fromTextSuperscriptOld
|
||||
styleNames = Array("CharEscapementHeight","CharEscapement")
|
||||
styleValues = Array(58,101)
|
||||
convertEnclosuresToFormat(CHR(871), styleNames, styleValues)
|
||||
End Sub
|
||||
|
||||
Private Sub toTextSubscriptOld
|
||||
styleNames = Array("CharEscapementHeight","CharEscapement")
|
||||
styleValues = Array(58,-101)
|
||||
convertFormatToEnclosure(CHR(872), styleNames, styleValues)
|
||||
End Sub
|
||||
|
||||
Private Sub fromTextSubscriptOld
|
||||
styleNames = Array("CharEscapementHeight","CharEscapement")
|
||||
styleValues = Array(58,-101)
|
||||
convertEnclosuresToFormat(CHR(872), styleNames, styleValues)
|
||||
End Sub
|
||||
|
||||
Private Sub toTextSparce
|
||||
styleNames = Array("CharKerning")
|
||||
For i=70 To 70
|
||||
|
@ -881,19 +905,43 @@ End Sub
|
|||
|
||||
|
||||
Private Sub convertFormattingToText
|
||||
Dim version As String
|
||||
Dim smallNum As String
|
||||
Dim bigNum As String
|
||||
version = Trim(getVersion())
|
||||
bigNum = Left(version, 1)
|
||||
smallNum = Right(version, 1)
|
||||
toTextBold
|
||||
toTextItalic
|
||||
toTextStrikeout
|
||||
toTextUnderline
|
||||
toTextSuperscript
|
||||
toTextSubscript
|
||||
If CInt(bigNum) < 6 OR (CInt(bigNum) = 6 AND CInt(smallNum < 3) ) Then
|
||||
toTextSuperscriptOld
|
||||
toTextSubscriptOld
|
||||
Else
|
||||
toTextSuperscript
|
||||
toTextSubscript
|
||||
EndIf
|
||||
|
||||
toTextSparce
|
||||
End Sub
|
||||
|
||||
Private Sub convertFormattingFromText
|
||||
Dim version As String
|
||||
version = Trim(getVersion())
|
||||
Dim smallNum As String
|
||||
Dim bigNum As String
|
||||
version = Trim(getVersion())
|
||||
bigNum = Left(version, 1)
|
||||
smallNum = Right(version, 1)
|
||||
fromTextSparce
|
||||
fromTextSuperscript
|
||||
fromTextSubscript
|
||||
If CInt(bigNum) < 6 OR (CInt(bigNum) = 6 AND CInt(smallNum < 3) ) Then
|
||||
fromTextSuperscriptOld
|
||||
fromTextSubscriptOld
|
||||
Else
|
||||
fromTextSuperscript
|
||||
fromTextSubscript
|
||||
EndIf
|
||||
fromTextUnderline
|
||||
fromTextStrikeout
|
||||
fromTextItalic
|
||||
|
@ -1024,5 +1072,11 @@ Private Sub convertWLLatin2IPHAstra
|
|||
replaceFontsInStyles( "WL LatinAllIn1Goth", newFontName)
|
||||
End Sub
|
||||
|
||||
Function getVersion
|
||||
GlobalScope.BasicLibraries.LoadLibrary("Tools")
|
||||
Dim oProduct As Object
|
||||
oProduct=GetRegistryKeyContent("org.openoffice.Setup/Product")
|
||||
getVersion=oProduct.getByName("ooSetupVersion")
|
||||
End Function
|
||||
|
||||
</script:module>
|
Loading…
Add table
Reference in a new issue