Grammalecte  Check-in [0395f1f7bf]

Overview
Comment:[core] small code simplification (about PropertyValues in LO)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | rg
Files: files | file ages | folders
SHA3-256: 0395f1f7bff938d777161c22139b4c1f63b9ef60da55ed61c7cd995c5a443781
User & Date: olr on 2018-09-02 12:07:44
Other Links: branch diff | manifest | tags
Context
2018-09-02
12:17
[build] color conversion check-in: 4af2f99cd1 user: olr tags: build, rg
12:07
[core] small code simplification (about PropertyValues in LO) check-in: 0395f1f7bf user: olr tags: core, rg
2018-09-01
19:44
[fr] ajustements check-in: bca4eef82d user: olr tags: fr, rg
Changes

Modified gc_core/py/lang_core/gc_engine.py from [c49870094d] to [8837c9f99c].

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
        xErr = SingleProofreadingError()    # uno.createUnoStruct( "com.sun.star.linguistic2.SingleProofreadingError" )
        xErr.nErrorStart = nStart
        xErr.nErrorLength = nEnd - nStart
        xErr.nErrorType = PROOFREADING
        xErr.aRuleIdentifier = sRuleId
        xErr.aShortComment = sMessage   # sMessage.split("|")[0]     # in context menu
        xErr.aFullComment = sMessage   # sMessage.split("|")[-1]    # in dialog
        if bShowRuleId:
            xErr.aShortComment += "  " + sLineId + " # " + sRuleId
        xErr.aSuggestions = tuple(lSugg)
        if sURL:
            xProperty = PropertyValue()
            xProperty.Name = "FullCommentURL"
            xProperty.Value = sURL
            xErr.aProperties = (xProperty,)
        else:
            xErr.aProperties = ()
        return xErr
    else:
        dErr = {}
        dErr["nStart"] = nStart







<
<


|
<
<







236
237
238
239
240
241
242


243
244
245


246
247
248
249
250
251
252
        xErr = SingleProofreadingError()    # uno.createUnoStruct( "com.sun.star.linguistic2.SingleProofreadingError" )
        xErr.nErrorStart = nStart
        xErr.nErrorLength = nEnd - nStart
        xErr.nErrorType = PROOFREADING
        xErr.aRuleIdentifier = sRuleId
        xErr.aShortComment = sMessage   # sMessage.split("|")[0]     # in context menu
        xErr.aFullComment = sMessage   # sMessage.split("|")[-1]    # in dialog


        xErr.aSuggestions = tuple(lSugg)
        if sURL:
            xProperty = PropertyValue(Name="FullCommentURL", Value=sURL)


            xErr.aProperties = (xProperty,)
        else:
            xErr.aProperties = ()
        return xErr
    else:
        dErr = {}
        dErr["nStart"] = nStart
864
865
866
867
868
869
870
871
872
873
874


875
876
877
878
879
880
881
882
883
884
885
886
        if _bWriterError:
            xErr = SingleProofreadingError()    # uno.createUnoStruct( "com.sun.star.linguistic2.SingleProofreadingError" )
            xErr.nErrorStart = nStart
            xErr.nErrorLength = nEnd - nStart
            xErr.nErrorType = PROOFREADING
            xErr.aRuleIdentifier = sRuleId
            xErr.aShortComment = sMessage   # sMessage.split("|")[0]     # in context menu
            xErr.aFullComment = sMessage   # sMessage.split("|")[-1]    # in dialog
            if bShowRuleId:
                xErr.aShortComment += "  " + sLineId + " # " + sRuleId
            xErr.aSuggestions = tuple(lSugg)


            if sURL:
                xProperty = PropertyValue()
                xProperty.Name = "FullCommentURL"
                xProperty.Value = sURL
                xErr.aProperties = (xProperty,)
            else:
                xErr.aProperties = ()
            return xErr
        else:
            dErr = {}
            dErr["nStart"] = nStart
            dErr["nEnd"] = nEnd







|
<
<

>
>

|
<
<
|







860
861
862
863
864
865
866
867


868
869
870
871
872


873
874
875
876
877
878
879
880
        if _bWriterError:
            xErr = SingleProofreadingError()    # uno.createUnoStruct( "com.sun.star.linguistic2.SingleProofreadingError" )
            xErr.nErrorStart = nStart
            xErr.nErrorLength = nEnd - nStart
            xErr.nErrorType = PROOFREADING
            xErr.aRuleIdentifier = sRuleId
            xErr.aShortComment = sMessage   # sMessage.split("|")[0]     # in context menu
            xErr.aFullComment = sMessage    # sMessage.split("|")[-1]    # in dialog


            xErr.aSuggestions = tuple(lSugg)
            #xPropertyLineType = PropertyValue(Name="LineType", Value=5) # DASH or WAVE
            #xPropertyLineColor = PropertyValue(Name="LineColor", Value=getRGB("FFAA00"))
            if sURL:
                xPropertyURL = PropertyValue(Name="FullCommentURL", Value=sURL)


                xErr.aProperties = (xPropertyURL,)
            else:
                xErr.aProperties = ()
            return xErr
        else:
            dErr = {}
            dErr["nStart"] = nStart
            dErr["nEnd"] = nEnd
1189
1190
1191
1192
1193
1194
1195

1196
1197
1198
1199
1200
1201
1202

def g_define_from (dToken, nLeft=None, nRight=None):
    if nLeft is not None:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"][slice(nLeft, nRight)])
    else:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"])
    return True



#### GRAMMAR CHECKER PLUGINS

${plugins}









>







1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197

def g_define_from (dToken, nLeft=None, nRight=None):
    if nLeft is not None:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"][slice(nLeft, nRight)])
    else:
        dToken["lMorph"] = _oSpellChecker.getMorph(dToken["sValue"])
    return True



#### GRAMMAR CHECKER PLUGINS

${plugins}