vcl/source/window/status.cxx | 57 ++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 27 deletions(-)
New commits: commit d513a845cf73e55aa88be716fcb7a1f98cd054b1 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Sep 25 11:44:48 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Sep 25 18:03:19 2019 +0200 tdf#127411 Broken mouse status in Impress status bar regression from commit c53f3f8f58f55d0978fb968446975856d72a52f8 tdf#126819 Can't retrieve the mouse position written in the statusbar Change-Id: I3072de28bcc512d98c43d5cc7110aa3f80d51e61 Reviewed-on: https://gerrit.libreoffice.org/79519 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index f4d0df5c2439..03b9b41e62a2 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -387,37 +387,40 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen rRenderContext.SetClipRegion(aRegion); } - SalLayout* pLayoutCache = pItem->mxLayoutCache.get(); - - if(!pLayoutCache) + // if the framework code is drawing status, let it do all the work + if (!(pItem->mnBits & StatusBarItemBits::UserDraw)) { - // update cache - pItem->mxLayoutCache = rRenderContext.ImplLayout(pItem->maText, 0, -1); - pLayoutCache = pItem->mxLayoutCache.get(); - } + SalLayout* pLayoutCache = pItem->mxLayoutCache.get(); - const SalLayoutGlyphs* pGlyphs = pLayoutCache ? pLayoutCache->GetGlyphs() : nullptr; - Size aTextSize(rRenderContext.GetTextWidth(pItem->maText,0,-1,nullptr,pGlyphs), rRenderContext.GetTextHeight()); + if(!pLayoutCache) + { + // update cache + pItem->mxLayoutCache = rRenderContext.ImplLayout(pItem->maText, 0, -1); + pLayoutCache = pItem->mxLayoutCache.get(); + } - Point aTextPos = ImplGetItemTextPos(aTextRectSize, aTextSize, pItem->mnBits); + const SalLayoutGlyphs* pGlyphs = pLayoutCache ? pLayoutCache->GetGlyphs() : nullptr; + Size aTextSize(rRenderContext.GetTextWidth(pItem->maText,0,-1,nullptr,pGlyphs), rRenderContext.GetTextHeight()); + Point aTextPos = ImplGetItemTextPos(aTextRectSize, aTextSize, pItem->mnBits); - if (bOffScreen) - { - mpImplData->mpVirDev->DrawText( - aTextPos, - pItem->maText, - 0, -1, nullptr, nullptr, - pGlyphs ); - } - else - { - aTextPos.AdjustX(aTextRect.Left() ); - aTextPos.AdjustY(aTextRect.Top() ); - rRenderContext.DrawText( - aTextPos, - pItem->maText, - 0, -1, nullptr, nullptr, - pGlyphs ); + if (bOffScreen) + { + mpImplData->mpVirDev->DrawText( + aTextPos, + pItem->maText, + 0, -1, nullptr, nullptr, + pGlyphs ); + } + else + { + aTextPos.AdjustX(aTextRect.Left() ); + aTextPos.AdjustY(aTextRect.Top() ); + rRenderContext.DrawText( + aTextPos, + pItem->maText, + 0, -1, nullptr, nullptr, + pGlyphs ); + } } // call DrawItem if necessary _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits