sc/source/ui/view/gridwin4.cxx | 43 +++++++++++++++++++++++------------------ vcl/skia/win/gdiimpl.cxx | 10 +++++++++ 2 files changed, 35 insertions(+), 18 deletions(-)
New commits: commit 9aa33b25764cb199c916737ca334cd35c82350c2 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Tue Jun 2 21:57:48 2020 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Tue Jul 7 11:44:28 2020 +0200 scPrintTwipsMsgs: No more view specific edit-cursor messages Change-Id: I2a07834568716ea1608a40613108d229699058b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98123 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 4c42d86f2de4..17f9b16a8ec9 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1120,28 +1120,35 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pEditView->SetOutputArea(rDevice.PixelToLogic(aEditRect)); pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); - // Now we need to get relative cursor position within the editview. - // This is for sending the absolute twips position of the cursor to the specific views with - // the same given zoom level. - tools::Rectangle aCursorRect = pEditView->GetEditCursor(); - Point aCursPos = OutputDevice::LogicToLogic(aCursorRect.TopLeft(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + // EditView will do the cursor notifications correctly if we're in + // print-twips messaging mode. + if (!comphelper::LibreOfficeKit::isCompatFlagSet( + comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) + { + // Now we need to get relative cursor position within the editview. + // This is for sending the pixel-aligned twips position of the cursor to the specific views with + // the same given zoom level. + tools::Rectangle aCursorRect = pEditView->GetEditCursor(); + Point aCursPos = OutputDevice::LogicToLogic(aCursorRect.TopLeft(), + MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + + const MapMode& rDevMM = rDevice.GetMapMode(); + MapMode aMM(MapUnit::MapTwip); + aMM.SetScaleX(rDevMM.GetScaleX()); + aMM.SetScaleY(rDevMM.GetScaleY()); + + aBGAbs.AdjustLeft(1); + aBGAbs.AdjustTop(1); + aCursorRect = OutputDevice::PixelToLogic(aBGAbs, aMM); + aCursorRect.setWidth(0); + aCursorRect.Move(aCursPos.getX(), 0); + // Sends view cursor position to views of all matching zooms if needed (avoids duplicates). + InvalidateLOKViewCursor(aCursorRect, aMM.GetScaleX(), aMM.GetScaleY()); + } // Rollback the mapmode and 'output area'. SetMapMode(aOrigMapMode); pEditView->SetOutputArea(aOrigOutputArea); - - const MapMode& rDevMM = rDevice.GetMapMode(); - MapMode aMM(MapUnit::MapTwip); - aMM.SetScaleX(rDevMM.GetScaleX()); - aMM.SetScaleY(rDevMM.GetScaleY()); - - aBGAbs.AdjustLeft(1); - aBGAbs.AdjustTop(1); - aCursorRect = OutputDevice::PixelToLogic(aBGAbs, aMM); - aCursorRect.setWidth(0); - aCursorRect.Move(aCursPos.getX(), 0); - // Sends view cursor position to views of all matching zooms if needed (avoids duplicates). - InvalidateLOKViewCursor(aCursorRect, aMM.GetScaleX(), aMM.GetScaleY()); } else { commit fada69d6ee05700fd57c8844591562608a900a9d Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Mon Jul 6 11:59:13 2020 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Tue Jul 7 11:44:13 2020 +0200 set also RGB/BGR LCD order for Skia text rendering (tdf#134275) Change-Id: I797a851f52d9ba4c18127219b9042348225d14dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98199 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index b3170b27b8ca..0e883bc1960f 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -22,6 +22,7 @@ #include <SkTypeface_win.h> #include <SkFont.h> #include <SkFontMgr.h> +#include <SkFontLCDConfig.h> #include <tools/sk_app/win/WindowContextFactory_win.h> #include <tools/sk_app/WindowContext.h> @@ -213,16 +214,25 @@ SkFont::Edging WinSkiaSalGraphicsImpl::getFontEdging() // the glyphs will be rendered based on this setting (subpixel AA requires colors, // others do not). fontEdging = SkFont::Edging::kAlias; + SkFontLCDConfig::LCDOrder lcdOrder = SkFontLCDConfig::kNONE_LCDOrder; BOOL set; if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &set, 0) && set) { UINT set2; if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &set2, 0) && set2 == FE_FONTSMOOTHINGCLEARTYPE) + { fontEdging = SkFont::Edging::kSubpixelAntiAlias; + if (SystemParametersInfo(SPI_GETFONTSMOOTHINGORIENTATION, 0, &set2, 0) + && set2 == FE_FONTSMOOTHINGORIENTATIONBGR) + lcdOrder = SkFontLCDConfig::kBGR_LCDOrder; + else + lcdOrder = SkFontLCDConfig::kRGB_LCDOrder; // default + } else fontEdging = SkFont::Edging::kAntiAlias; } + SkFontLCDConfig::SetSubpixelOrder(lcdOrder); // Cache this, it is actually visible a little bit when profiling. fontEdgingDone = true; return fontEdging; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits