[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source svx/source vcl/jsdialog
svtools/source/control/ctrlbox.cxx |2 +- svx/source/tbxctrls/tbcontrl.cxx |3 ++- vcl/jsdialog/enabled.cxx |5 - 3 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 9a483a7cc1006274bced96edbeb51ab326e8763e Author: Szymon Kłos AuthorDate: Tue Aug 8 06:48:10 2023 +0200 Commit: Szymon Kłos CommitDate: Thu Aug 31 10:16:42 2023 +0200 jsdialog: enable font name & size combobox This enables font selector with font rendering in Online Change-Id: I2b57c0831e84a957374c2b1733f6526ca80ac7bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156242 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index e5ba7b2b0662..221b2dc66e54 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -532,7 +532,7 @@ static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; } void FontNameBox::EnableWYSIWYG(bool bEnable) { -if (comphelper::LibreOfficeKit::isActive() || IsRunningUnitTest()) +if (IsRunningUnitTest()) return; if (mbWYSIWYG == bEnable) return; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 2eda9b2be745..835598d23c0e 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -1743,7 +1744,7 @@ SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rDispatchProvider, const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl) -: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox") +: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox", true, reinterpret_cast(SfxViewShell::Current())) , SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), rDispatchProvider, rFrame, rCtrl) { set_id("fontnamecombobox"); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 4db6b0da9113..50e90455c2e6 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -372,7 +372,10 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile) { -if (rUIFile == u"modules/scalc/ui/numberbox.ui" || rUIFile == u"svx/ui/stylespreview.ui") +if (rUIFile == u"modules/scalc/ui/numberbox.ui" +|| rUIFile == u"svx/ui/fontnamebox.ui" +|| rUIFile == u"svx/ui/fontsizebox.ui" +|| rUIFile == u"svx/ui/stylespreview.ui") { return true; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source
svtools/source/control/ctrlbox.cxx | 83 +++-- 1 file changed, 62 insertions(+), 21 deletions(-) New commits: commit 30ae275ca0f06a1f42bf444622426d780880e800 Author: Szymon Kłos AuthorDate: Mon Aug 28 13:00:15 2023 +0200 Commit: Andras Timar CommitDate: Mon Aug 28 21:42:16 2023 +0200 jsdialog: cache only best quality font previews to keep single cache for all the views, we downscale result if needed when we draw on a target Change-Id: I3b57ec08b2260029ff469a13da725feff04555d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156190 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2973f326c221..e5ba7b2b0662 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -333,9 +333,32 @@ static int gFontNameBoxes; static size_t gPreviewsPerDevice; static std::vector> gFontPreviewVirDevs; static std::vector gRenderedFontNames; +static int gHighestDPI = 0; namespace { +std::vector>& getFontPreviewVirDevs() +{ +return gFontPreviewVirDevs; +} + +void clearFontPreviewVirDevs() +{ +for (auto &rDev : gFontPreviewVirDevs) +rDev.disposeAndClear(); +gFontPreviewVirDevs.clear(); +} + +std::vector& getRenderedFontNames() +{ +return gRenderedFontNames; +} + +void clearRenderedFontNames() +{ +gRenderedFontNames.clear(); +} + void calcCustomItemSize(const weld::ComboBox& rComboBox) { gUserItemSz = Size(rComboBox.get_approximate_digit_width() * 52, rComboBox.get_text_height()); @@ -355,13 +378,14 @@ IMPL_LINK(FontNameBox, SettingsChangedHdl, VclSimpleEvent&, rEvent, void) if (rEvent.GetId() != VclEventId::ApplicationDataChanged) return; +if (comphelper::LibreOfficeKit::isActive()) +return; + DataChangedEvent* pData = static_cast(static_cast(rEvent).GetData()); if (pData->GetType() == DataChangedEventType::SETTINGS) { -for (auto &rDev : gFontPreviewVirDevs) -rDev.disposeAndClear(); -gFontPreviewVirDevs.clear(); -gRenderedFontNames.clear(); +clearFontPreviewVirDevs(); +clearRenderedFontNames(); calcCustomItemSize(*m_xComboBox); if (mbWYSIWYG && mpFontList && !mpFontList->empty()) { @@ -398,10 +422,8 @@ FontNameBox::~FontNameBox() --gFontNameBoxes; if (!gFontNameBoxes) { -for (auto &rDev : gFontPreviewVirDevs) -rDev.disposeAndClear(); -gFontPreviewVirDevs.clear(); -gRenderedFontNames.clear(); +clearFontPreviewVirDevs(); +clearRenderedFontNames(); } } @@ -769,16 +791,34 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, Point* pTopLeft, const FontMetric& rFontMetric = (*mpFontList)[nIndex]; const OUString& rFontName = rFontMetric.GetFamilyName(); +if (comphelper::LibreOfficeKit::isActive()) +{ +// we want to cache only best quality previews +if (gHighestDPI < nDPIX || gHighestDPI < nDPIY) +{ +clearRenderedFontNames(); +clearFontPreviewVirDevs(); +gHighestDPI = std::max(nDPIX, nDPIY); +} +else if (gHighestDPI > nDPIX || gHighestDPI > nDPIY) +{ +nDPIX = gHighestDPI; +nDPIY = gHighestDPI; +} +} + size_t nPreviewIndex; -auto xFind = std::find(gRenderedFontNames.begin(), gRenderedFontNames.end(), rFontName); -bool bPreviewAvailable = xFind != gRenderedFontNames.end(); +auto& rFontNames = getRenderedFontNames(); +auto& rVirtualDevs = getFontPreviewVirDevs(); +auto xFind = std::find(rFontNames.begin(), rFontNames.end(), rFontName); +bool bPreviewAvailable = xFind != rFontNames.end(); if (!bPreviewAvailable) { -nPreviewIndex = gRenderedFontNames.size(); -gRenderedFontNames.push_back(rFontName); +nPreviewIndex = rFontNames.size(); +rFontNames.push_back(rFontName); } else -nPreviewIndex = std::distance(gRenderedFontNames.begin(), xFind); +nPreviewIndex = std::distance(rFontNames.begin(), xFind); size_t nPage = nPreviewIndex / gPreviewsPerDevice; size_t nIndexInPage = nPreviewIndex - (nPage * gPreviewsPerDevice); @@ -787,15 +827,15 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, Point* pTopLeft, if (!bPreviewAvailable) { -if (nPage >= gFontPreviewVirDevs.size()) +if (nPage >= rVirtualDevs.size()) { bool bIsLOK = comphelper::LibreOfficeKit::isActive(); if (bIsLOK) // allow transparent background in LOK case - gFontPreviewVirDevs.emplace_back(VclPtr::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)); + rVi
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source svx/source vcl/jsdialog
svtools/source/control/ctrlbox.cxx |2 +- svx/source/tbxctrls/tbcontrl.cxx |3 +-- vcl/jsdialog/enabled.cxx |5 + 3 files changed, 3 insertions(+), 7 deletions(-) New commits: commit d1e570a270c6e7274cd515aa6f53b9c042272efe Author: Szymon Kłos AuthorDate: Mon Aug 28 17:50:35 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Aug 28 17:52:35 2023 +0200 Revert "jsdialog: enable font name & size combobox" This reverts commit 8d3d55115da3cc2e693adf3acdd92dca5fc8fa31. Reason for revert: Feature not complete yet Change-Id: Idbf769118ec40cdf0f6c6e760cd183208059acc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156147 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index fc151b0ca37d..2973f326c221 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -510,7 +510,7 @@ static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; } void FontNameBox::EnableWYSIWYG(bool bEnable) { -if (IsRunningUnitTest()) +if (comphelper::LibreOfficeKit::isActive() || IsRunningUnitTest()) return; if (mbWYSIWYG == bEnable) return; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 835598d23c0e..2eda9b2be745 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -1744,7 +1743,7 @@ SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rDispatchProvider, const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl) -: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox", true, reinterpret_cast(SfxViewShell::Current())) +: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox") , SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), rDispatchProvider, rFrame, rCtrl) { set_id("fontnamecombobox"); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 50e90455c2e6..4db6b0da9113 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -372,10 +372,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile) { -if (rUIFile == u"modules/scalc/ui/numberbox.ui" -|| rUIFile == u"svx/ui/fontnamebox.ui" -|| rUIFile == u"svx/ui/fontsizebox.ui" -|| rUIFile == u"svx/ui/stylespreview.ui") +if (rUIFile == u"modules/scalc/ui/numberbox.ui" || rUIFile == u"svx/ui/stylespreview.ui") { return true; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source svx/source vcl/jsdialog
svtools/source/control/ctrlbox.cxx |2 +- svx/source/tbxctrls/tbcontrl.cxx |3 ++- vcl/jsdialog/enabled.cxx |5 - 3 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 8d3d55115da3cc2e693adf3acdd92dca5fc8fa31 Author: Szymon Kłos AuthorDate: Tue Aug 8 06:48:10 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Aug 28 16:34:06 2023 +0200 jsdialog: enable font name & size combobox Font selector is with font rendering Change-Id: Id0c7bab8cd4bf74a82230a8dffdc2432c2a5c9ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155938 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Szymon Kłos diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2973f326c221..fc151b0ca37d 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -510,7 +510,7 @@ static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; } void FontNameBox::EnableWYSIWYG(bool bEnable) { -if (comphelper::LibreOfficeKit::isActive() || IsRunningUnitTest()) +if (IsRunningUnitTest()) return; if (mbWYSIWYG == bEnable) return; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 2eda9b2be745..835598d23c0e 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -1743,7 +1744,7 @@ SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rDispatchProvider, const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl) -: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox") +: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox", true, reinterpret_cast(SfxViewShell::Current())) , SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), rDispatchProvider, rFrame, rCtrl) { set_id("fontnamecombobox"); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 4db6b0da9113..50e90455c2e6 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -372,7 +372,10 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile) { -if (rUIFile == u"modules/scalc/ui/numberbox.ui" || rUIFile == u"svx/ui/stylespreview.ui") +if (rUIFile == u"modules/scalc/ui/numberbox.ui" +|| rUIFile == u"svx/ui/fontnamebox.ui" +|| rUIFile == u"svx/ui/fontsizebox.ui" +|| rUIFile == u"svx/ui/stylespreview.ui") { return true; }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source
svtools/source/control/ctrlbox.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 92c77b336c700d754a3d2513e4c1a4ceaa0b1045 Author: Szymon Kłos AuthorDate: Fri Aug 25 18:01:54 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Aug 28 16:27:26 2023 +0200 lok: don't prerender font previews Change-Id: Id83a6804f658d56793913b8e8e07f7ec1f2ff82a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156116 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Szymon Kłos diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 482d53f28e0b..2973f326c221 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -571,6 +571,9 @@ namespace IMPL_LINK_NOARG(FontNameBox, UpdateHdl, Timer*, void) { +if (comphelper::LibreOfficeKit::isActive()) +return; + CachePreview(mnPreviewProgress++, nullptr); // tdf#132536 limit to ~25 pre-rendered for now. The font caches look // b0rked, the massive charmaps are ~never swapped out, and don't count
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source vcl/jsdialog
svtools/source/control/ctrlbox.cxx |5 - vcl/jsdialog/jsdialogbuilder.cxx |2 +- 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 11dbab9221c5340cf742324fe961a6956a5a68ce Author: Szymon Kłos AuthorDate: Thu Aug 24 10:54:28 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Aug 28 16:26:22 2023 +0200 jsdialog: make font previews background transparent Change-Id: I9dc75ab91f591191be7a354274a0783b0fd093b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156029 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Szymon Kłos diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 7cba59c1cc13..6fab9eb6a0f8 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -777,7 +777,10 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, Point* pTopLeft) { if (nPage >= gFontPreviewVirDevs.size()) { - gFontPreviewVirDevs.emplace_back(m_xComboBox->create_render_virtual_device()); +if (comphelper::LibreOfficeKit::isActive()) + gFontPreviewVirDevs.emplace_back(VclPtr::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)); +else + gFontPreviewVirDevs.emplace_back(m_xComboBox->create_render_virtual_device()); VirtualDevice& rDevice = *gFontPreviewVirDevs.back(); rDevice.SetOutputSizePixel(Size(gUserItemSz.Width(), gUserItemSz.Height() * gPreviewsPerDevice)); weld::SetPointFont(rDevice, m_xComboBox->get_font()); diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 8b36068d48a0..945918f78b12 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1683,7 +1683,7 @@ bool JSComboBox::changed_by_direct_pick() const { return true; } void JSComboBox::render_entry(int pos) { -ScopedVclPtrInstance pDevice; +ScopedVclPtrInstance pDevice(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); Size aRenderSize = signal_custom_get_size(*pDevice); pDevice->SetOutputSize(aRenderSize);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source
svtools/source/config/colorcfg.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 6417fbe4a71dc6bb7d5edac5ed3f01c4ab38ca9c Author: Paris Oplopoios AuthorDate: Wed Jul 5 11:41:07 2023 +0300 Commit: Paris Oplopoios CommitDate: Wed Jul 5 10:46:20 2023 +0200 svtools::BASICEDITOR shouldn't exist in colorcfg Was added from a backport from master but would need a different commit to matter Change-Id: Ibc458808bd8353cb056e8fc20ae9b90c46e9e1f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154024 Tested-by: Paris Oplopoios Reviewed-by: Paris Oplopoios diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index d382116d2a2d..e03e875f100a 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -405,7 +405,6 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) { COL_BLACK,Color(0xEE) }, // CALCTEXT { COL_LIGHTGRAY,Color(0x1C1C1C) }, // CALCPROTECTEDBACKGROUND { COL_GRAY7,COL_GRAY7 }, // DRAWGRID -{ COL_WHITE,Color(0x1C1C1C) }, // BASICEDITOR { COL_GREEN,Color(0xDDE8CB) }, // BASICIDENTIFIER { COL_GRAY, Color(0xEE) }, // BASICCOMMENT { COL_LIGHTRED, Color(0xFFA6A6) }, // BASICNUMBER
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svtools/source
svtools/source/misc/acceleratorexecute.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 6720a608a7cc8fb11ae1f0c0bc9210bbf80134f4 Author: Patrick Luby AuthorDate: Wed Feb 22 16:22:00 2023 -0500 Commit: Aron Budea CommitDate: Wed Mar 15 19:38:40 2023 + Fix build error when compiling on iOS or macOS with Xcode 14.2 Commit 67fcd647341118747a4e7cd404d907d29613778c was missing a return value Signed-off-by: Patrick Luby Change-Id: I1e6a0bf2ec65d3bb03eced6518611a7567a34a6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147492 Tested-by: Jenkins CollaboraOffice Reviewed-by: Patrick Luby (cherry picked from commit 99e6cbab7bb5954f0ee5792d07e1ba543260f434) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148870 Tested-by: Aron Budea Reviewed-by: Aron Budea diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 099616fe07e2..ebe93bf7daa4 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -421,6 +421,8 @@ css::uno::Reference AcceleratorExecute::lok_ } catch(const css::container::NoSuchElementException&) {} + +return css::uno::Reference(); } void AcceleratorExecute::lok_setModuleConfig(css::uno::Reference acceleratorConfig)