diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-18 15:49:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-11-19 06:10:20 +0100 |
commit | f0030353b38dfec4ceedc72d32884dbdde583d1b (patch) | |
tree | 94610459a35cbb17754504b5f53aa8bc3da12dad /sc/source | |
parent | cfe88f4ab51c9330c0418cbd8b7093db515f9bd5 (diff) |
loplugin:unusedmethods
Change-Id: I5dcba14a9b0dfcc5267760410f6d135fcd3b1bd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142944
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 65 |
2 files changed, 0 insertions, 73 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 5f108525e9ed..d88a9462918d 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -290,14 +290,6 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHel sal_uInt16 HitPageBreak( const Point& rMouse, ScRange* pSource, SCCOLROW* pBreak, SCCOLROW* pPrev ); - /** The cell may be covered by text that overflows from a previous cell. - - @return if true, the given cell is covered by (overflowing) text and - rTextStartPosX returns the column where the text that overflows - starts. - */ - bool IsCellCoveredByText(SCCOL nPosX, SCROW nPosY, SCTAB nTab, SCCOL &rTextStartPosX); - void PasteSelection( const Point& rPosPixel ); void SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, SCROW nCellY ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1ae16dd962aa..5fe0a4edd7c9 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1717,71 +1717,6 @@ void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt ) nNestedButtonState = ScNestedButtonState::NONE; } -bool ScGridWindow::IsCellCoveredByText(SCCOL nPosX, SCROW nPosY, SCTAB nTab, SCCOL &rTextStartPosX) -{ - ScDocument& rDoc = mrViewData.GetDocument(); - - // find the first non-empty cell (this, or to the left) - SCCOL nNonEmptyX = nPosX; - for (; nNonEmptyX >= 0; --nNonEmptyX) - { - ScRefCellValue aCell(rDoc, ScAddress(nNonEmptyX, nPosY, nTab)); - if (!aCell.isEmpty()) - break; - } - - // the initial cell already contains text - if (nNonEmptyX == nPosX) - { - rTextStartPosX = nNonEmptyX; - return true; - } - - // to the left, there is no cell that would contain (potentially - // overrunning) text - if (nNonEmptyX < 0 || rDoc.HasAttrib(nNonEmptyX, nPosY, nTab, nPosX, nPosY, nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped)) - return false; - - double nPPTX = mrViewData.GetPPTX(); - double nPPTY = mrViewData.GetPPTY(); - - ScTableInfo aTabInfo; - rDoc.FillInfo(aTabInfo, 0, nPosY, nPosX, nPosY, nTab, nPPTX, nPPTY, false, false); - - Fraction aZoomX = mrViewData.GetZoomX(); - Fraction aZoomY = mrViewData.GetZoomY(); - ScOutputData aOutputData(GetOutDev(), OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab, - 0, 0, 0, nPosY, nPosX, nPosY, nPPTX, nPPTY, - &aZoomX, &aZoomY); - - MapMode aCurrentMapMode(GetMapMode()); - SetMapMode(MapMode(MapUnit::MapPixel)); - - // obtain the bounding box of the text in first non-empty cell - // to the left - tools::Rectangle aRect(aOutputData.LayoutStrings(false, false, ScAddress(nNonEmptyX, nPosY, nTab))); - - SetMapMode(aCurrentMapMode); - - // the text does not overrun from the cell - if (aRect.IsEmpty()) - return false; - - SCCOL nTextEndX; - SCROW nTextEndY; - - // test the rightmost position of the text bounding box - tools::Long nMiddle = (aRect.Top() + aRect.Bottom()) / 2; - mrViewData.GetPosFromPixel(aRect.Right(), nMiddle, eWhich, nTextEndX, nTextEndY); - if (nTextEndX >= nPosX) - { - rTextStartPosX = nNonEmptyX; - return true; - } - - return false; -} - void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventState& rState ) { // We have to check if a context menu is shown and we have an UI |