summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2018-03-19 18:53:04 +0100
committerJan Holesovsky <kendy@collabora.com>2018-03-20 17:39:59 +0100
commitd8a2736635f7e4d19c4c6bf68aefa9d825b407bd (patch)
tree3240f601d5d1e6c3838db5a01a5a8e375a66376d /sc
parentb35f1af6e1c111ec9d138236a37d71106550af1f (diff)
lok - sc: validity list drop down button callback
Change-Id: Iaedc7f15147ea7f09e71877b592f932e3ecb37d5 Reviewed-on: https://gerrit.libreoffice.org/51609 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/gridwin.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx35
-rw-r--r--sc/source/ui/view/gridwin4.cxx43
3 files changed, 36 insertions, 44 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 9830834a4bbd..edd5215f32ee 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -448,6 +448,8 @@ public:
ScViewData* getViewData();
virtual FactoryFunction GetUITestFactory() const override;
+ void updateLOKValListButton(bool bVisible, const ScAddress& rPos) const;
+
protected:
void ImpCreateOverlayObjects();
void ImpDestroyOverlayObjects();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e8eaad8e9403..0b5a3e310d8b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4762,6 +4762,16 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange)
}
}
+void ScGridWindow::updateLOKValListButton( bool bVisible, const ScAddress& rPos ) const
+{
+ SCCOL nX = rPos.Col();
+ SCROW nY = rPos.Row();
+ std::stringstream ss;
+ ss << nX << ", " << nY << ", " << static_cast<unsigned int>(bVisible);
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_VALIDITY_LIST_BUTTON, ss.str().c_str());
+}
+
void ScGridWindow::UpdateListValPos( bool bVisible, const ScAddress& rPos )
{
bool bOldButton = bListValButton;
@@ -4775,7 +4785,14 @@ void ScGridWindow::UpdateListValPos( bool bVisible, const ScAddress& rPos )
if ( !bOldButton || aListValPos != aOldPos )
{
// paint area of new button
- Invalidate( PixelToLogic( GetListValButtonRect( aListValPos ) ) );
+ if ( comphelper::LibreOfficeKit::isActive() )
+ {
+ updateLOKValListButton( true, aListValPos );
+ }
+ else
+ {
+ Invalidate( PixelToLogic( GetListValButtonRect( aListValPos ) ) );
+ }
}
}
if ( bOldButton )
@@ -4783,7 +4800,14 @@ void ScGridWindow::UpdateListValPos( bool bVisible, const ScAddress& rPos )
if ( !bListValButton || aListValPos != aOldPos )
{
// paint area of old button
- Invalidate( PixelToLogic( GetListValButtonRect( aOldPos ) ) );
+ if ( comphelper::LibreOfficeKit::isActive() )
+ {
+ updateLOKValListButton( false, aOldPos );
+ }
+ else
+ {
+ Invalidate( PixelToLogic( GetListValButtonRect( aOldPos ) ) );
+ }
}
}
}
@@ -5827,9 +5851,16 @@ void ScGridWindow::updateLibreOfficeKitCellCursor(SfxViewShell* pOtherShell) con
if (pOtherShell)
{
if (pOtherShell == pViewShell)
+ {
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
+
+ if (bListValButton && aListValPos == pViewData->GetCurPos())
+ updateLOKValListButton(true, aListValPos);
+ }
else
+ {
SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor);
+ }
}
else
{
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 10b5bcca8b76..3ab531e6040e 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1551,8 +1551,6 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo, OutputDevice* pContentDev)
{
- bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
-
aComboButton.SetOutputDevice( pContentDev );
ScDocument* pDoc = pViewData->GetDocument();
@@ -1687,7 +1685,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
}
}
- if ( bListValButton && pRowInfo[nArrY].nRowNo == aListValPos.Row() && pRowInfo[nArrY].bChanged )
+ if ( !comphelper::LibreOfficeKit::isActive() && bListValButton && pRowInfo[nArrY].nRowNo == aListValPos.Row() && pRowInfo[nArrY].bChanged )
{
Rectangle aRect = GetListValButtonRect( aListValPos );
aComboButton.SetPosPixel( aRect.TopLeft() );
@@ -1698,45 +1696,6 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
aComboButton.SetPosPixel( aOldPos ); // restore old state
aComboButton.SetSizePixel( aOldSize ); // for MouseUp/Down (AutoFilter)
}
-
- if (bIsTiledRendering)
- {
- ScTabViewShell* pThisViewShell = pViewData->GetViewShell();
- SfxViewShell* pViewShell = SfxViewShell::GetFirst();
-
- while (pViewShell)
- {
- if (pViewShell != pThisViewShell)
- {
- ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell)
- {
- ScViewData& rOtherViewData = pTabViewShell->GetViewData();
- ScGridWindow* pOtherWin = rOtherViewData.GetActiveWin();
- if (pOtherWin)
- {
- bool bOtherListValButton = pOtherWin->bListValButton;
- ScAddress aOtherListValPos = pOtherWin->aListValPos;
-
- if ( bOtherListValButton && pRowInfo[nArrY].nRowNo == aOtherListValPos.Row() && pRowInfo[nArrY].bChanged )
- {
- Rectangle aRect = GetListValButtonRect( aOtherListValPos );
- aComboButton.SetPosPixel( aRect.TopLeft() );
- aComboButton.SetSizePixel( aRect.GetSize() );
- pContentDev->SetClipRegion(vcl::Region(aRect));
- aComboButton.Draw();
- pContentDev->SetClipRegion(); // always called from Draw() without clip region
- aComboButton.SetPosPixel( aOldPos ); // restore old state
- aComboButton.SetSizePixel( aOldSize ); // for MouseUp/Down (AutoFilter)
- }
-
- }
- }
- }
-
- pViewShell = SfxViewShell::GetNext(*pViewShell);
- }
- }
}
pQueryParam.reset();