[Libreoffice-commits] core.git: 4 commits - bin/run sc/source
Jan Holesovsky
kendy at collabora.com
Tue Apr 7 15:05:13 PDT 2015
bin/run | 6 +--
sc/source/ui/unoobj/docuno.cxx | 46 ++++++++++++++++--------
sc/source/ui/view/gridwin.cxx | 78 +++++++++++++++--------------------------
sc/source/ui/view/gridwin4.cxx | 15 ++++---
4 files changed, 73 insertions(+), 72 deletions(-)
New commits:
commit 2bbce7dcd46e8aca716808602aa152ecd85b42af
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 7 23:54:49 2015 +0200
sc tiled editing: Never show the cell cursor.
With the current behavior, showing the cell cursor is counter-intuitive and
counter productive - we focus more on the editing itself.
It is still possible to select just one cell though - it is the cell selection
that starts and ends in the same cell.
Change-Id: Ie6d96783d486c6fcda5b4c4f6acf91c1926cdf6c
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d7d56e0..770166d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5782,21 +5782,12 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD
void ScGridWindow::UpdateCursorOverlay()
{
ScDocument* pDoc = pViewData->GetDocument();
- bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering();
-
- // in the tiled rendering case, exit early if we are not supposed to draw
- // the cell cursor:
- // - there is a selection (either cell selection, or graphic object)
- // - the user is typing inside a shape or so
- if (bIsTiledRendering &&
- (pViewData->GetMarkData().IsMarked() || pViewData->GetMarkData().IsMultiMarked() ||
- pViewData->GetViewShell()->GetScDrawView()->IsMarking() ||
- pViewData->GetViewShell()->GetScDrawView()->IsTextEdit() ||
- pViewData->GetViewShell()->GetScDrawView()->GetDragStat().IsShown() ||
- pViewData->HasEditView(eWhich)))
- {
+
+ // never show the cell cursor when the tiled rendering is going on; either
+ // we want to show the editeng selection, or the cell selection, but not
+ // the cell cursor by itself
+ if (pDoc->GetDrawLayer()->isTiledRendering())
return;
- }
MapMode aDrawMode = GetDrawMapMode();
MapMode aOldMode = GetMapMode();
@@ -5873,7 +5864,7 @@ void ScGridWindow::UpdateCursorOverlay()
}
// in the tiled rendering case, don't limit to the screen size
- if (bMaybeVisible || bIsTiledRendering)
+ if (bMaybeVisible)
{
long nSizeXPix;
long nSizeYPix;
@@ -5882,46 +5873,37 @@ void ScGridWindow::UpdateCursorOverlay()
if (bLayoutRTL)
aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring
- if (bIsTiledRendering)
- {
- // just forward the area to LOK
- Rectangle aRect(aScrPos, Size(nSizeXPix, nSizeYPix));
- aPixelRects.push_back(aRect);
- }
- else
- {
- // show the cursor as 4 (thin) rectangles
- Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1));
+ // show the cursor as 4 (thin) rectangles
+ Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1));
- sal_Int32 nScale = GetDPIScaleFactor();
+ sal_Int32 nScale = GetDPIScaleFactor();
- long aCursorWidth = 1 * nScale;
+ long aCursorWidth = 1 * nScale;
- Rectangle aLeft = Rectangle(aRect);
- aLeft.Top() -= aCursorWidth;
- aLeft.Bottom() += aCursorWidth;
- aLeft.Right() = aLeft.Left();
- aLeft.Left() -= aCursorWidth;
+ Rectangle aLeft = Rectangle(aRect);
+ aLeft.Top() -= aCursorWidth;
+ aLeft.Bottom() += aCursorWidth;
+ aLeft.Right() = aLeft.Left();
+ aLeft.Left() -= aCursorWidth;
- Rectangle aRight = Rectangle(aRect);
- aRight.Top() -= aCursorWidth;
- aRight.Bottom() += aCursorWidth;
- aRight.Left() = aRight.Right();
- aRight.Right() += aCursorWidth;
+ Rectangle aRight = Rectangle(aRect);
+ aRight.Top() -= aCursorWidth;
+ aRight.Bottom() += aCursorWidth;
+ aRight.Left() = aRight.Right();
+ aRight.Right() += aCursorWidth;
- Rectangle aTop = Rectangle(aRect);
- aTop.Bottom() = aTop.Top();
- aTop.Top() -= aCursorWidth;
+ Rectangle aTop = Rectangle(aRect);
+ aTop.Bottom() = aTop.Top();
+ aTop.Top() -= aCursorWidth;
- Rectangle aBottom = Rectangle(aRect);
- aBottom.Top() = aBottom.Bottom();
- aBottom.Bottom() += aCursorWidth;
+ Rectangle aBottom = Rectangle(aRect);
+ aBottom.Top() = aBottom.Bottom();
+ aBottom.Bottom() += aCursorWidth;
- aPixelRects.push_back(aLeft);
- aPixelRects.push_back(aRight);
- aPixelRects.push_back(aTop);
- aPixelRects.push_back(aBottom);
- }
+ aPixelRects.push_back(aLeft);
+ aPixelRects.push_back(aRight);
+ aPixelRects.push_back(aTop);
+ aPixelRects.push_back(aBottom);
}
}
commit 3a864cdb556a583ad4cec2bbeef9c7959d56dd91
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 7 23:09:50 2015 +0200
sc tiled editing: Allow turning the text selection into cell selection.
When moving the handle outside of the cell editeng, we want to turn the text
selection into the cell selection.
This patch includes work by Henry Castro - thanks!
Change-Id: I081480b7d8b0fde8276f63c261d91bb9f2dc3b96
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index e3ead3d..1df53bb 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -612,6 +612,8 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
// update the aLogicMode in ScViewData to something predictable
pViewData->SetZoom(Fraction(1, 1), Fraction(1, 1), true);
+ bool bHandled = false;
+
if (pInputHandler && pInputHandler->IsInputMode())
{
// forwarding to editeng - we are editing the cell content
@@ -619,20 +621,32 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
assert(pTableView);
Point aPoint(convertTwipToMm100(nX), convertTwipToMm100(nY));
- switch (nType)
+
+ if (!pTableView->GetOutputArea().IsInside(aPoint))
{
- case LOK_SETTEXTSELECTION_START:
- pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/false, /*bClearMark=*/false);
- break;
- case LOK_SETTEXTSELECTION_END:
- pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/false);
- break;
- case LOK_SETTEXTSELECTION_RESET:
- pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/true);
- break;
- default:
- assert(false);
- break;
+ // if the handle does not stay in the editeng area, we want to turn
+ // the selection into the cell selection
+ pViewShell->UpdateInputLine();
+ pViewShell->UpdateInputHandler();
+ }
+ else
+ {
+ switch (nType)
+ {
+ case LOK_SETTEXTSELECTION_START:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/false, /*bClearMark=*/false);
+ break;
+ case LOK_SETTEXTSELECTION_END:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/false);
+ break;
+ case LOK_SETTEXTSELECTION_RESET:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/true);
+ break;
+ default:
+ assert(false);
+ break;
+ }
+ bHandled = true;
}
}
else if (pDrawView && pDrawView->IsTextEdit())
@@ -657,10 +671,12 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
assert(false);
break;
}
+ bHandled = true;
}
- else
+
+ if (!bHandled)
{
- // just updating the cell selection
+ // just update the cell selection
ScGridWindow* pGridWindow = pViewData->GetActiveWin();
if (!pGridWindow)
return;
commit 25d3fd0b729423251b242b22e6a324983f0c6b39
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 7 16:45:46 2015 +0200
sc tiled editing: Better setup of drawinglayer, so that images are swapped in.
Change-Id: I6f28ab1e4af91b12005ddfb9e64e984c783081ff
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 269d12e..a14c04e 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -971,15 +971,18 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
-fTilePosXPixel, -fTilePosYPixel, nStartCol, nStartRow, nEndCol, nEndRow,
fPPTX, fPPTY);
- // create a temporary SdrPaintWindow to avoid warnings
- SdrPaintWindow aTemporaryPaintWindow(*pViewData->GetScDrawView(), rDevice);
- SdrPageView* pSdrPageView = pViewData->GetScDrawView()->GetSdrPageView();
- pSdrPageView->AddPaintWindowToPageView(aTemporaryPaintWindow);
+ // setup the SdrPage so that drawinglayer works correctly
+ ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ boost::scoped_ptr<FmFormView> pDrawView;
+ if (pModel)
+ {
+ pDrawView.reset(new FmFormView(pModel, &rDevice));
+ pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+ aOutputData.SetDrawView( pDrawView.get() );
+ }
// draw the content
DrawContent(rDevice, aTabInfo, aOutputData, true, SC_UPDATE_ALL);
-
- pSdrPageView->RemovePaintWindowFromPageView(aTemporaryPaintWindow);
}
void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
commit c5bd865ac6e6d7fe1a26b2db3269d60c3c7b4ba4
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 7 16:45:12 2015 +0200
bin/run: Survive files with spaces in filenames.
Change-Id: Ifeeb839f82891057fe8e3e8fd6d537861d99f69f
diff --git a/bin/run b/bin/run
index e9bcb5c..c1b3f93 100755
--- a/bin/run
+++ b/bin/run
@@ -29,7 +29,7 @@ if uname | grep -i CYGWIN >/dev/null; then
echo "setting search path to: ${PATH}"
echo "execing: ${exedir}/$1"
- exec ${LO_TRACE} "${exedir}"/$@
+ exec ${LO_TRACE} "${exedir}/$@"
elif [ $(uname) = Darwin ]; then
@@ -51,7 +51,7 @@ elif [ $(uname) = Darwin ]; then
echo "setting search path to: ${DYLD_LIBRARY_PATH}"
echo "execing: ${exedir}/$1"
- exec ${LO_TRACE} "${exedir}"/$@
+ exec ${LO_TRACE} "${exedir}/$@"
else
@@ -73,7 +73,7 @@ else
echo "setting search path to: ${LD_LIBRARY_PATH}"
echo "execing: ${exedir}/$1"
- exec ${LO_TRACE} "${exedir}"/$@
+ exec ${LO_TRACE} "${exedir}/$@"
fi
More information about the Libreoffice-commits
mailing list