summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-08 13:15:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-08-08 14:29:08 +0100
commitde7a230bc2c560db2712d77e6588e446797c8998 (patch)
tree80e804b9a70eb6a5b6a079ef100ea11d773c3903
parentd07184581894740f08bdcaa4c06f39ed32b73874 (diff)
Resolves: tdf#92530 put the rest of missing validity tips into the other grids
this stems from... commit c43a4cb4ffc80c49b8e51ae0796321a6b73b5e99 Author: Kohei Yoshida <kohei.yoshida@suse.com> Date: Thu Jan 5 22:13:52 2012 -0500 fdo#36851, bnc#737190: Make the data validation popup more reliable. Previously, the data validation message popup was not sticking on reliably on Linux, and flickers very bad on Windows. That was due to the painting conflict between the top-most frame window and the grid window. By making the message popup window a child window of the grid window, it paints more reliably. where the tip was resticted to the current grid because of problems from svx/source/sdr/overlay/overlaymanagerbuffered.cxx and OverlayManagerBuffered where the original flickering window isn't handled nicely by the background save/restore stuff there. So here its all been reimplemented as an overlay which plays better with that code, and if it doesn't fit, then its in all grid windows, so visually it appears as a single note that floats underneath the split window lines. Change-Id: I18ac42c2a0686ab509252830741d36fb17cae629
-rw-r--r--sc/source/ui/view/tabview3.cxx56
1 files changed, 39 insertions, 17 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index b26530519cc6..99e6cad5736c 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -677,27 +677,49 @@ void ScTabView::TestHintWindow()
nRow >= aViewData.GetPosY(WhichV(eWhich)) &&
aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
{
- rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pWin->getOverlayManager();
- if (xOverlayManager.is())
- {
- const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
- Color aCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
- // create HintWindow, determines its size by itself
- ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
+ const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
+ Color aCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
+ // create HintWindow, determines its size by itself
+ ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
- Size aHintWndSize = pOverlay->GetSizePixel();
- long nCellSizeX = 0;
- long nCellSizeY = 0;
- aViewData.GetMergeSizePixel(nCol, nRow, nCellSizeX, nCellSizeY);
+ mxInputHintOO.reset(new sdr::overlay::OverlayObjectList);
+ mxInputHintOO->append(*pOverlay);
- Point aHintPos = calcHintWindowPosition(
- aPos, Size(nCellSizeX,nCellSizeY), aWinSize, aHintWndSize);
+ Size aHintWndSize = pOverlay->GetSizePixel();
+ long nCellSizeX = 0;
+ long nCellSizeY = 0;
+ aViewData.GetMergeSizePixel(nCol, nRow, nCellSizeX, nCellSizeY);
- pOverlay->SetPos(pWin->PixelToLogic(aHintPos, pWin->GetDrawMapMode()), pWin->GetDrawMapMode());
+ Point aHintPos = calcHintWindowPosition(
+ aPos, Size(nCellSizeX,nCellSizeY), aWinSize, aHintWndSize);
- xOverlayManager->add(*pOverlay);
- mxInputHintOO.reset(new sdr::overlay::OverlayObjectList);
- mxInputHintOO->append(*pOverlay);
+ pOverlay->SetPos(pWin->PixelToLogic(aHintPos, pWin->GetDrawMapMode()), pWin->GetDrawMapMode());
+ for (VclPtr<ScGridWindow> & pWindow : pGridWin)
+ {
+ if (!pWindow)
+ continue;
+ if (!pWindow->IsVisible())
+ continue;
+ rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pWindow->getOverlayManager();
+ if (!xOverlayManager.is())
+ continue;
+ if (pWindow == pWin)
+ {
+ xOverlayManager->add(*pOverlay);
+ }
+ else
+ {
+ //tdf#92530 if the help tip doesn't fit into its allocated area in a split window
+ //scenario, then because here we place it into the other split windows as well the
+ //missing portions will be displayed in the other split windows to form an apparent
+ //single tip, albeit "under" the split lines
+ Point aOtherPos(pWindow->ScreenToOutputPixel(pWin->OutputToScreenPixel(aHintPos)));
+ ScOverlayHint* pOtherOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
+ Point aFooPos(pWindow->PixelToLogic(aOtherPos, pWindow->GetDrawMapMode()));
+ pOtherOverlay->SetPos(aFooPos, pWindow->GetDrawMapMode());
+ mxInputHintOO->append(*pOtherOverlay);
+ xOverlayManager->add(*pOtherOverlay);
+ }
}
}
}