Overview
Comment: | [lo] graphic options for Writer: underling style and colors |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | lo |
Files: | files | file ages | folders |
SHA3-256: |
efad935afcbfcef56e5b5222f94e6597 |
User & Date: | olr on 2019-06-10 17:22:34 |
Other Links: | manifest | tags |
Context
2019-06-10
| ||
18:00 | [lo] graphic option: update labels -> for LO 6.3+ check-in: 1934da7c59 user: olr tags: trunk, lo | |
17:22 | [lo] graphic options for Writer: underling style and colors check-in: efad935afc user: olr tags: trunk, lo | |
07:14 | [core] change the paragraph slicer check-in: 01d15e4e8d user: olr tags: trunk, core | |
Changes
Modified gc_core/py/lang_core/gc_engine.py from [cb20ef452b] to [2821b2052e].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + | except ImportError: _bWriterError = False __all__ = [ "lang", "locales", "pkg", "name", "version", "author", \ "load", "parse", "getSpellChecker", \ "setOption", "setOptions", "getOptions", "getDefaultOptions", "getOptionsLabels", "resetOptions", "displayOptions", \ |
︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + + | _sAppContext = "" # what software is running _dOptions = None _dOptionsColors = None _oSpellChecker = None _oTokenizer = None _aIgnoredRules = set() # Writer underlining style _bMulticolor = True _nUnderliningStyle = 0 #### Initialization def load (sContext="Python", sColorType="aRGB"): "initialization of the grammar checker" global _oSpellChecker |
︙ | |||
187 188 189 190 191 192 193 194 195 196 197 198 199 200 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | + + + + + + + + + + + + + + + + + + + | def resetOptions (): "set options to default values" global _dOptions _dOptions = getDefaultOptions() def setWriterUnderliningStyle (sStyle="BOLDWAVE", bMulticolor=True): "set underlining style for Writer (WAVE, BOLDWAVE, BOLD)" global _nUnderliningStyle global _bMulticolor # https://api.libreoffice.org/docs/idl/ref/FontUnderline_8idl.html # WAVE: 10, BOLD: 12, BOLDWAVE: 18 DASH: 5 if sStyle == "WAVE": _nUnderliningStyle = 0 # 0 for default Writer setting elif sStyle == "BOLDWAVE": _nUnderliningStyle = 18 elif sStyle == "BOLD": _nUnderliningStyle = 12 elif sStyle == "DASH": _nUnderliningStyle = 5 else: _nUnderliningStyle = 0 _bMulticolor = bMulticolor #### Parsing def parse (sText, sCountry="${country_default}", bDebug=False, dOptions=None, bContext=False, bFullInfo=False): "init point to analyse <sText> and returns an iterable of errors or (with option <bFullInfo>) paragraphs errors and sentences with tokens and errors" oText = TextParser(sText) return oText.parse(sCountry, bDebug, dOptions, bContext, bFullInfo) |
︙ | |||
659 660 661 662 663 664 665 | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | - - - + + + + + - | xErr.nErrorLength = nLen 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) # Properties |
︙ |
Modified gc_core/py/oxt/Grammalecte.py from [f7ef93bdfb] to [f43a616444].
︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | + + | gce.load("Writer", "nInt") # GC options # opt_handler.load(xCurCtx) dOpt = Options.load(xCurCtx) gce.setOptions(dOpt) # dictionaries options self.loadUserDictionaries() # underlining options self.setWriterUnderliningStyle() # store for results of big paragraphs self.dResult = {} self.nMaxRes = 1500 self.lLastRes = deque(maxlen=self.nMaxRes) self.nRes = 0 |
︙ | |||
146 147 148 149 150 151 152 153 154 155 156 157 158 159 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | + + + + + + + + + + | if xChild.getPropertyValue("use_personal_dic"): sJSON = xChild.getPropertyValue("personal_dic") if sJSON: oSpellChecker = gce.getSpellChecker(); oSpellChecker.setPersonalDictionary(json.loads(sJSON)) except: traceback.print_exc() def setWriterUnderliningStyle (self): try: xSettingNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", False) xChild = xSettingNode.getByName("o_${lang}") sLineType = xChild.getPropertyValue("line_type") bMulticolor = bool(xChild.getPropertyValue("line_multicolor")) gce.setWriterUnderliningStyle(sLineType, bMulticolor) except: traceback.print_exc() g_ImplementationHelper = unohelper.ImplementationHelper() g_ImplementationHelper.addImplementation(Grammalecte, "org.openoffice.comp.pyuno.Lightproof."+gce.pkg, ("com.sun.star.linguistic2.Proofreader",),) # g_ImplementationHelper.addImplementation( opt_handler.LightproofOptionsEventHandler, \ # "org.openoffice.comp.pyuno.LightproofOptionsEventHandler." + gce.pkg, ("com.sun.star.awt.XContainerWindowEventHandler",),) |
Modified gc_core/py/oxt/OptionsDialog.xcs from [7f3cb8622b] to [72f0992f92].
︙ | |||
17 18 19 20 21 22 23 24 25 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + - - + + + | ${xcs_options} </group> <group oor:name="o_${lang}"> <info> <desc>The data for one leaf.</desc> </info> <!-- spelling options --> <prop oor:name="use_graphspell" oor:type="xs:int"><value>1</value></prop> <prop oor:name="use_graphspell_sugg" oor:type="xs:int"><value>1</value></prop> |
︙ |
Modified gc_lang/fr/config.ini from [da40a7d7e9] to [e1480316c1].
︙ | |||
102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | + + + | oxt/DictOptions/do_strings.py = pythonpath/do_strings.py oxt/DictOptions/LexiconEditor.py = pythonpath/LexiconEditor.py oxt/DictOptions/lxe_strings.py = pythonpath/lxe_strings.py oxt/DictOptions/SearchWords.py = pythonpath/SearchWords.py oxt/DictOptions/sw_strings.py = pythonpath/sw_strings.py oxt/DictOptions/TagsInfo.py = pythonpath/TagsInfo.py oxt/DictOptions/ti_strings.py = pythonpath/ti_strings.py # Graphic options oxt/GraphicOptions/GraphicOptions.py = pythonpath/GraphicOptions.py oxt/GraphicOptions/go_strings.py = pythonpath/go_strings.py # ContextMenu oxt/ContextMenu/ContextMenu.py = ContextMenu.py oxt/ContextMenu/jobs.xcu = config/jobs.xcu # TextFormatter oxt/TextFormatter/TextFormatter.py = pythonpath/TextFormatter.py oxt/TextFormatter/tf_strings.py = pythonpath/tf_strings.py oxt/TextFormatter/tf_options.py = pythonpath/tf_options.py |
︙ |
Modified gc_lang/fr/oxt/AppLauncher.py from [ed57ba0db8] to [e69ae3b8a0].
︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | + + + + | import Options xDialog = Options.GC_Options(self.ctx) xDialog.run(self.sLang) elif sCmd == "EN": import Enumerator xDialog = Enumerator.Enumerator(self.ctx) xDialog.run(self.sLang) elif sCmd == "GO": import GraphicOptions xDialog = GraphicOptions.GraphicOptions(self.ctx) xDialog.run(self.sLang) elif sCmd.startswith("FA/"): findAll(sCmd[6:], (sCmd[3:4] == "y"), (sCmd[4:5] == "y")) # elif sCmd.startswith("URL/"): # # Call from context menu to launch URL? # # http://opengrok.libreoffice.org/xref/core/sw/source/ui/lingu/olmenu.cxx#785 # xSystemShellExecute = self.ctx.getServiceManager().createInstanceWithContext('com.sun.star.system.SystemShellExecute', self.ctx) # xSystemShellExecute.execute(url, "", uno.getConstantByName("com.sun.star.system.SystemShellExecuteFlags.URIS_ONLY")) |
︙ |
Added gc_lang/fr/oxt/GraphicOptions/GraphicOptions.py version [c72f2ae2d2].