Re: [Libreoffice-commits] core.git: include/svl sc/qa sc/sdi sc/source sc/uiconfig sfx2/source
Hi Henry, On Tuesday, 2017-11-14 16:44:18 -0400, Henry Castro wrote: > > Spell checking in Calc does not work this way with a global document > > language or paragraph language, language is a cell attribute (or in-cell > > EditEngine text portion attribute). > > Indeed, after reading code they are designed to cell attribute, but I did not > find anything to apply this, since they are not set, the cell take the global > document language *If* not set then it's equal to the document language. To obtain the font/spell-checking language attribute of the current selection (single cell, range, or multi-selection) you could use something like this ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); LanguageType nLang = static_cast(rAttrSet.Get(ATTR_FONT_LANGUAGE)).GetValue(); if (nLang == LANGUAGE_SYSTEM) nLang = Application::GetSettings().GetLanguageTag().getLanguageType(); Note that for multiple cells the returned LanguageType may not match the individual values if cells have different attribute values. You may want to check if the ATTR_FONT_LANGUAGE SfxItem is actually set in the SfxItemSet (rAttrSet.Get(ATTR_FONT_LANGUAGE).GetItemState() == SfxItemState::SET) and otherwise use LANGUAGE_MULTIPLE. YMMV. This is only the Western language attribute, if you also want CJK and CTL (which are not used for spell-checking) check how it's done in LanguageType ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) and use pTabViewShell->GetSelectionScriptType(). To apply a new (Western) font language to the current selection use pTabViewShell->ApplyAttr( SvxLanguageItem( nLang, ATTR_FONT_LANGUAGE)); Do not use multiple consecutive ApplyAttr() calls, to apply more than one attribute in one go there's ApplySelectionPattern(const ScPatternAttr& rAttr) Hope this helps. Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A Care about Free Software, support the FSFE https://fsfe.org/support/?erack signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice-commits] core.git: include/svl sc/qa sc/sdi sc/source sc/uiconfig sfx2/source
Hi Eike, > What is this supposed to do? It adds a non-functional status bar item to > Calc that only takes precious space to display the global document > language and all associated context menu entries to change language are > without functionality. The idea was to show only the language status, not the context menu, perhaps I forgot some flags to disable them, but I added to my queue task list, to fix those unwanted context menu on language status bar. > Spell checking in Calc does not work this way with a global document > language or paragraph language, language is a cell attribute (or in-cell > EditEngine text portion attribute). Indeed, after reading code they are designed to cell attribute, but I did not find anything to apply this, since they are not set, the cell take the global document language Regards Henry 2017-11-14 16:19 GMT-04:00 Eike Rathke: > Hi Henry, > > On Sunday, 2017-10-22 15:18:38 +, Henry Castro wrote: > >> include/svl/hint.hxx |1 >> sc/qa/unit/tiledrendering/tiledrendering.cxx | 51 +++ >> sc/sdi/docsh.sdi |1 >> sc/source/ui/docshell/docsh4.cxx | 89 >> +++ >> sc/source/ui/view/gridwin4.cxx |1 >> sc/source/ui/view/tabvwsh5.cxx |8 ++ >> sc/uiconfig/scalc/menubar/menubar.xml|2 >> sc/uiconfig/scalc/statusbar/statusbar.xml|1 >> sfx2/source/control/unoctitm.cxx | 13 +++ >> 9 files changed, 165 insertions(+), 2 deletions(-) >> >> New commits: >> commit 2fa424f40a185eb43d862a29abce07345695fcf3 >> Author: Henry Castro >> Date: Thu Oct 19 22:47:17 2017 -0400 >> >> sc lok: fix spell checking languages in Calc > > What is this supposed to do? It adds a non-functional status bar item to > Calc that only takes precious space to display the global document > language and all associated context menu entries to change language are > without functionality. > > Spell checking in Calc does not work this way with a global document > language or paragraph language, language is a cell attribute (or in-cell > EditEngine text portion attribute). > > Eike > > -- > LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. > GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 > 2D3A > Care about Free Software, support the FSFE https://fsfe.org/support/?erack > > ___ > LibreOffice mailing list > LibreOffice@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/libreoffice > ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice-commits] core.git: include/svl sc/qa sc/sdi sc/source sc/uiconfig sfx2/source
Hi Henry, On Sunday, 2017-10-22 15:18:38 +, Henry Castro wrote: > include/svl/hint.hxx |1 > sc/qa/unit/tiledrendering/tiledrendering.cxx | 51 +++ > sc/sdi/docsh.sdi |1 > sc/source/ui/docshell/docsh4.cxx | 89 > +++ > sc/source/ui/view/gridwin4.cxx |1 > sc/source/ui/view/tabvwsh5.cxx |8 ++ > sc/uiconfig/scalc/menubar/menubar.xml|2 > sc/uiconfig/scalc/statusbar/statusbar.xml|1 > sfx2/source/control/unoctitm.cxx | 13 +++ > 9 files changed, 165 insertions(+), 2 deletions(-) > > New commits: > commit 2fa424f40a185eb43d862a29abce07345695fcf3 > Author: Henry Castro> Date: Thu Oct 19 22:47:17 2017 -0400 > > sc lok: fix spell checking languages in Calc What is this supposed to do? It adds a non-functional status bar item to Calc that only takes precious space to display the global document language and all associated context menu entries to change language are without functionality. Spell checking in Calc does not work this way with a global document language or paragraph language, language is a cell attribute (or in-cell EditEngine text portion attribute). Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A Care about Free Software, support the FSFE https://fsfe.org/support/?erack signature.asc Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice