summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-25 11:44:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-25 18:03:19 +0200
commitd513a845cf73e55aa88be716fcb7a1f98cd054b1 (patch)
treee2f499146cd9f37d4bdbee46a43e46607f244fe6
parent9e257e6b54bb8853f1f5213dfda67a216bcf7403 (diff)
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.grandin@collabora.co.uk>
-rw-r--r--vcl/source/window/status.cxx57
1 files changed, 30 insertions, 27 deletions
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