[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-04-09 Thread Jan Holesovsky
 sc/source/ui/view/gridwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 581e9bb1690c4d27476aa46c0391f97675963149
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Apr 9 09:14:15 2015 +0200

sc tiled editing: Make the 'long tap to select' work again in shapes.

Change-Id: I77914d1b6fe538f3f38beb449e68f50ae36b0798

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6c15dd1..2b0ca4c 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1706,7 +1706,7 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent rMEvt, MouseEventSta
 
 // special handling of empty cells with tiled rendering - with double
 // click, the entire cell is selected
-if (bIsTiledRendering  bDouble)
+if (bIsTiledRendering  bEditMode  bDouble)
 {
 Point aPos = rMEvt.GetPosPixel();
 SCsCOL nPosX;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-04-03 Thread Henry Castro
 sc/source/ui/view/gridwin.cxx |   25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

New commits:
commit d4eb2213875664b4268bac5f94fed5a05b79dd82
Author: Henry Castro hcas...@collabora.com
Date:   Fri Apr 3 16:29:24 2015 -0400

sc tiled editing: Changed behaviour double click to click.

In the tiled rendering case, it points the cell cursor, and immediately
start the editing.
When it is double click, it will only trigger the selection of the cell.

Change-Id: Iafcabba408533e8162bd45d780f5e8926c6970bb

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 518e2a5..0ec678f 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1837,6 +1837,17 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent rMEvt, MouseEventSta
 //  TestMouse schon oben passiert
 }
 
+// In the tiled rendering case, select shapes
+if (rMEvt.IsLeft()  
pViewData-GetDocument()-GetDrawLayer()-isTiledRendering())
+{
+if ( !bCrossPointer  DrawMouseButtonDown(rMEvt) )
+{
+return;
+}
+
+pViewData-GetViewShell()-SetDrawShell( false );
+}
+
 Point aPos = rMEvt.GetPosPixel();
 SCsCOL nPosX;
 SCsROW nPosY;
@@ -1916,6 +1927,10 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent rMEvt, MouseEventSta
 }
 else
 nMouseStatus = SC_GM_TABDOWN;
+
+// In the tiled rendering case, fake mouse status to double click
+if ( nMouseStatus == SC_GM_TABDOWN  
pDoc-GetDrawLayer()-isTiledRendering() )
+nMouseStatus = SC_GM_DBLDOWN;
 }
 
 //  Links in Edit-Zellen
@@ -2200,9 +2215,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent rMEvt 
)
 pView-ResetBrushDocument();// invalidates pBrushDoc 
pointer
 }
 
-//  double click (only left button)
-
-bool bDouble = ( rMEvt.GetClicks() == 2  rMEvt.IsLeft() );
+// In the tiled rendering case, change double click to single click (only 
left button)
+bool bDouble = ( pDoc-GetDrawLayer()-isTiledRendering()  
rMEvt.IsLeft() ) || ( rMEvt.GetClicks() == 2  rMEvt.IsLeft() );
 if ( bDouble  !bRefMode  nMouseStatus == SC_GM_DBLDOWN  
!pScMod-IsRefDialogOpen() )
 {
 //  data pilot table
@@ -2751,7 +2765,10 @@ void ScGridWindow::Tracking( const TrackingEvent rTEvt )
 
 MouseEvent aUpEvt( rMEvt.GetPosPixel(), rMEvt.GetClicks(),
 rMEvt.GetMode(), nButtonDown, rMEvt.GetModifier() 
);
-MouseButtonUp( aUpEvt );
+
+// In the tiled rendering case, do not spawn fake mouse up
+if (!pViewData-GetDocument()-GetDrawLayer()-isTiledRendering())
+MouseButtonUp( aUpEvt );
 }
 else
 MouseMove( rMEvt );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-04-03 Thread Jan Holesovsky
 sc/source/ui/view/gridwin3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fa9f8daf78872ad194f21a664202b3908b0e4053
Author: Jan Holesovsky ke...@collabora.com
Date:   Fri Apr 3 23:51:21 2015 +0200

sc tiled editing: Don't crash on desktop.

Change-Id: I4cb63550b3913d097db63b374f0acbea591682e4

diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index be017e3..925f473 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -243,7 +243,7 @@ MapMode ScGridWindow::GetDrawMapMode( bool bForce )
 // work in the logic coordinates (ideally 100ths of mm - so that it is
 // the same as editeng and drawinglayer), and get rid of all the
 // SetMapMode's and other unneccessary fun we have with pixels
-if (pDoc-GetDrawLayer()-isTiledRendering())
+if (pDoc  pDoc-GetDrawLayer()  
pDoc-GetDrawLayer()-isTiledRendering())
 {
 return pViewData-GetLogicMode();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source vcl/source

2015-04-02 Thread Miklos Vajna
 sc/source/ui/view/gridwin4.cxx |7 ++-
 vcl/source/window/paint.cxx|   10 ++
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit e1aa279188b72f6677b01c0fc2f89852bfa0c283
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Apr 2 09:46:22 2015 +0200

vcl tiled rendering: fix Writer/Impress invalidation rectangle

Both Writer and Impress disable map mode during tiled rendering, i.e.
IsMapModeEnabled() always returns false. Nevertheless, using
GetMapMode(), it's possible to query what was the map unit before
disabling the map mode, which is twips for Writer and mm100 for Impress.

If Calc needs anything special here, that's better to be done in
ScGridWindow::LogicInvalidate().

Change-Id: I2c10df47d32b80d2cef2b6e6587872fe4126a3f5

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 108f36f..c5fe4ea 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -984,7 +984,12 @@ void ScGridWindow::LogicInvalidate(const Rectangle* 
pRectangle)
 if (!pRectangle)
 sRectangle = EMPTY;
 else
-sRectangle = pRectangle-toString();
+{
+Rectangle aRectangle(*pRectangle);
+if (!IsMapModeEnabled())
+aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_PIXEL, 
MAP_TWIP);
+sRectangle = aRectangle.toString();
+}
 
 
pViewData-GetDocument()-GetDrawLayer()-libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES,
 sRectangle.getStr());
 }
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index e619226..f977378 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -862,14 +862,8 @@ void Window::Invalidate( sal_uInt16 nFlags )
 /// Converts rRectangle from MM100 to twips based on the map mode of rWindow.
 void lcl_toTwips(const Window rWindow, Rectangle rRectangle)
 {
-// When dragging shapes the map mode is disabled.
-if (rWindow.IsMapModeEnabled())
-{
-if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
-rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, 
MAP_TWIP);
-}
-else
-rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_PIXEL, 
MAP_TWIP);
+if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
+rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, 
MAP_TWIP);
 }
 
 void Window::Invalidate( const Rectangle rRect, sal_uInt16 nFlags )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-04-02 Thread Henry Castro
 sc/source/ui/view/gridwin4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ded91f854324c32c70653f1a9b0720184691fd09
Author: Henry Castro hcas...@collabora.com
Date:   Thu Apr 2 16:08:57 2015 -0400

sc tiled editing: Changed function to PixelToLogic.

The default DPI is 72 using static function OutputDevice::LogicToLogic.

Change-Id: I8aba7e74f745092a34e8b50c4e52f84c1de77695

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 81c4136..7202f3d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -994,7 +994,7 @@ void ScGridWindow::LogicInvalidate(const Rectangle* 
pRectangle)
 aRectangle = OutputDevice::LogicToLogic(aRectangle, 
MAP_100TH_MM, MAP_TWIP);
 }
 else
-aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_PIXEL, 
MAP_TWIP);
+aRectangle = PixelToLogic(aRectangle, MapMode(MAP_TWIP));
 sRectangle = aRectangle.toString();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-04-02 Thread Jan Holesovsky
 sc/source/ui/unoobj/docuno.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 41dad0018ffce8e04b57e4e109defba1551536f1
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Apr 2 14:12:33 2015 +0200

sc tiled editing: Set the 100% zoom in the selection-related methods too.

Change-Id: I3d32edfb62cbe7eaceed823742ecd729dbe2f627

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 431175a..16e83e0 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -575,6 +575,9 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
 ScInputHandler* pInputHandler = SC_MOD()-GetInputHdl(pViewShell);
 ScDrawView* pDrawView = pViewData-GetScDrawView();
 
+// update the aLogicMode in ScViewData to something predictable
+pViewData-SetZoom(Fraction(1, 1), Fraction(1, 1), true);
+
 if (pInputHandler  pInputHandler-IsInputMode())
 {
 // forwarding to editeng - we are editing the cell content
@@ -642,6 +645,9 @@ void ScModelObj::setGraphicSelection(int nType, int nX, int 
nY)
 ScViewData* pViewData = ScDocShell::GetViewData();
 ScGridWindow* pGridWindow = pViewData-GetActiveWin();
 
+// update the aLogicMode in ScViewData to something predictable
+pViewData-SetZoom(Fraction(1, 1), Fraction(1, 1), true);
+
 int nPixelX = nX * pViewData-GetPPTX();
 int nPixelY = nY * pViewData-GetPPTY();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source sd/source vcl/source

2015-04-02 Thread Miklos Vajna
 sc/source/ui/view/gridwin4.cxx |8 +++-
 sd/source/ui/view/sdwindow.cxx |7 ++-
 vcl/source/window/paint.cxx|9 -
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit df79e02bc2eae3dfa8129405b94393dfec1ebd20
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Apr 2 15:10:50 2015 +0200

vcl tiled rendering: don't do anything with disabled mapmode and mm100 
mapunit

Turns out Impress wants an mm100 - twips conversion in this case, while
Calc wants a pixel - twips one, so there isn't anything here that can
be abstracted in VCL.

Change-Id: Ieb961afa97affbf682e13c0a56585396ae09f552

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e414e10..81c4136 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -987,7 +987,13 @@ void ScGridWindow::LogicInvalidate(const Rectangle* 
pRectangle)
 else
 {
 Rectangle aRectangle(*pRectangle);
-if (!IsMapModeEnabled())
+// When dragging shapes the map mode is disabled.
+if (IsMapModeEnabled())
+{
+if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+aRectangle = OutputDevice::LogicToLogic(aRectangle, 
MAP_100TH_MM, MAP_TWIP);
+}
+else
 aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_PIXEL, 
MAP_TWIP);
 sRectangle = aRectangle.toString();
 }
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 1268596..8506ec0 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -1003,7 +1003,12 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
 if (!pRectangle)
 sRectangle = EMPTY;
 else
-sRectangle = pRectangle-toString();
+{
+Rectangle aRectangle(*pRectangle);
+if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, 
MAP_TWIP);
+sRectangle = aRectangle.toString();
+}
 
mpViewShell-GetDoc()-libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, 
sRectangle.getStr());
 }
 
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index f977378..1384dfe 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -859,13 +859,6 @@ void Window::Invalidate( sal_uInt16 nFlags )
 LogicInvalidate(0);
 }
 
-/// Converts rRectangle from MM100 to twips based on the map mode of rWindow.
-void lcl_toTwips(const Window rWindow, Rectangle rRectangle)
-{
-if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
-rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, 
MAP_TWIP);
-}
-
 void Window::Invalidate( const Rectangle rRect, sal_uInt16 nFlags )
 {
 
@@ -879,7 +872,6 @@ void Window::Invalidate( const Rectangle rRect, sal_uInt16 
nFlags )
 vcl::Region aRegion( aRect );
 ImplInvalidate( aRegion, nFlags );
 Rectangle aLogicRectangle(rRect);
-lcl_toTwips(*this, aLogicRectangle);
 LogicInvalidate(aLogicRectangle);
 }
 }
@@ -902,7 +894,6 @@ void Window::Invalidate( const vcl::Region rRegion, 
sal_uInt16 nFlags )
 {
 ImplInvalidate( aRegion, nFlags );
 Rectangle aLogicRectangle = rRegion.GetBoundRect();
-lcl_toTwips(*this, aLogicRectangle);
 LogicInvalidate(aLogicRectangle);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-25 Thread Jan Holesovsky
 sc/source/ui/view/gridwin.cxx |   53 ++
 1 file changed, 53 insertions(+)

New commits:
commit 8cd39f91beb2f49e5ceeb4a5c8fd9af28bd2c309
Author: Jan Holesovsky ke...@collabora.com
Date:   Wed Mar 25 13:15:17 2015 +0100

sc tiled editing: Implement cell selections.

Change-Id: Ic09572ac133c1bb473d716ec600ddb444948aa8e

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3bbe8b8..dd34e30 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -134,6 +134,9 @@
 #include vcl/svapp.hxx
 #include svx/sdr/overlay/overlayselection.hxx
 
+#define LOK_USE_UNSTABLE_API
+#include LibreOfficeKit/LibreOfficeKitEnums.h
+
 #include vector
 #include boost/shared_ptr.hpp
 
@@ -5742,6 +5745,44 @@ void ScGridWindow::UpdateCopySourceOverlay()
 SetMapMode( aOldMode );
 }
 
+/// Turn the selection ranges rRanges into the LibreOfficeKit selection, and 
call the callback.
+static void updateLibreOfficeKitSelection(ScDrawLayer* pDrawLayer, const 
std::vectorbasegfx::B2DRange rRanges)
+{
+if (!pDrawLayer-isTiledRendering())
+return;
+
+basegfx::B2DRange aBoundingBox;
+std::stringstream ss;
+
+bool bIsFirst = true;
+for (const auto rRange : rRanges)
+{
+aBoundingBox.expand(rRange);
+
+if (bIsFirst)
+bIsFirst = false;
+else
+ss  ; ;
+
+Rectangle aRect(rRange.getMinX() / HMM_PER_TWIPS, rRange.getMinY() / 
HMM_PER_TWIPS,
+rRange.getMaxX() / HMM_PER_TWIPS, rRange.getMaxY() / 
HMM_PER_TWIPS);
+ss  aRect.toString().getStr();
+}
+
+// selection start handle
+Rectangle aStart(aBoundingBox.getMinX() / HMM_PER_TWIPS, 
aBoundingBox.getMinY() / HMM_PER_TWIPS,
+aBoundingBox.getMinX() / HMM_PER_TWIPS, (aBoundingBox.getMinY() / 
HMM_PER_TWIPS) + 256);
+pDrawLayer-libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, 
aStart.toString().getStr());
+
+// selection end handle
+Rectangle aEnd(aBoundingBox.getMaxX() / HMM_PER_TWIPS, 
(aBoundingBox.getMaxY() / HMM_PER_TWIPS) - 256,
+aBoundingBox.getMaxX() / HMM_PER_TWIPS, aBoundingBox.getMaxY() / 
HMM_PER_TWIPS);
+pDrawLayer-libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, 
aEnd.toString().getStr());
+
+// the selection itself
+pDrawLayer-libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, 
ss.str().c_str());
+}
+
 void ScGridWindow::UpdateCursorOverlay()
 {
 MapMode aDrawMode = GetDrawMapMode();
@@ -5891,6 +5932,15 @@ void ScGridWindow::UpdateCursorOverlay()
 xOverlayManager-add(*pOverlay);
 mpOOCursors.reset(new sdr::overlay::OverlayObjectList);
 mpOOCursors-append(*pOverlay);
+
+// notify the LibreOfficeKit too, but only if there's no
+// selection yet, to avoid setting the LOK selection twice
+// (once for the cell only, and then for the selection)
+ScDrawLayer* pDrawLayer = pDoc-GetDrawLayer();
+if (pDrawLayer-isTiledRendering()  
!pViewData-GetMarkData().IsMarked()  
!pViewData-GetMarkData().IsMultiMarked())
+{
+updateLibreOfficeKitSelection(pDrawLayer, aRanges);
+}
 }
 }
 
@@ -5957,6 +6007,9 @@ void ScGridWindow::UpdateSelectionOverlay()
 xOverlayManager-add(*pOverlay);
 mpOOSelection.reset(new sdr::overlay::OverlayObjectList);
 mpOOSelection-append(*pOverlay);
+
+// notify the LibreOfficeKit too
+updateLibreOfficeKitSelection(pDoc-GetDrawLayer(), aRanges);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-24 Thread Henry Castro
 sc/source/ui/view/gridwin.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c2596244325bb566dd460ada29207d0c05b83293
Author: Henry Castro hcas...@collabora.com
Date:   Sun Mar 22 20:13:29 2015 -0400

sc tiled editing: Limit the mouse events only to the document size.

From some reason, when clicking outside of the area visible in the
gtktiledviewer, the events starts being misplaced.

We need to revert  fix later when we will be able to extend the
document size in a convenient way.

Change-Id: I210705c9f8909598d8d47c15c14c06f96bfc4caa

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3bbe8b8..a89d4e1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2426,7 +2426,11 @@ void ScGridWindow::LogicMouseButtonDown(const 
MouseEvent rMouseEvent)
 (void)rDoc;
 assert(rDoc.GetDrawLayer()-isTiledRendering());
 
-MouseButtonDown(rMouseEvent);
+// Don't allow events outside of our viewport size.
+// FIXME this will likely cause trouble when we allow extending the
+// document size; but for now this is necessary to workaround a problem
+if ( rMouseEvent.GetPosPixel().X()  GetOutputSizePixel().Width()  
rMouseEvent.GetPosPixel().Y()  GetOutputSizePixel().Height())
+MouseButtonDown(rMouseEvent);
 }
 
 void ScGridWindow::LogicMouseButtonUp(const MouseEvent rMouseEvent)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-24 Thread Jan Holesovsky
 sc/source/ui/view/gridwin.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit b5bd68b1742458a72f1ca3bbb1c6dae4e71cc7a4
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Mar 24 09:43:29 2015 +0100

Revert sc tiled editing: Limit the mouse events only to the document size.

Pushed too early; we are able to get this mis-behavior even other ways than
just using a mouse click, we really need to fix the root cause now.

This reverts commit c2596244325bb566dd460ada29207d0c05b83293.

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a89d4e1..3bbe8b8 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2426,11 +2426,7 @@ void ScGridWindow::LogicMouseButtonDown(const 
MouseEvent rMouseEvent)
 (void)rDoc;
 assert(rDoc.GetDrawLayer()-isTiledRendering());
 
-// Don't allow events outside of our viewport size.
-// FIXME this will likely cause trouble when we allow extending the
-// document size; but for now this is necessary to workaround a problem
-if ( rMouseEvent.GetPosPixel().X()  GetOutputSizePixel().Width()  
rMouseEvent.GetPosPixel().Y()  GetOutputSizePixel().Height())
-MouseButtonDown(rMouseEvent);
+MouseButtonDown(rMouseEvent);
 }
 
 void ScGridWindow::LogicMouseButtonUp(const MouseEvent rMouseEvent)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-23 Thread Henry Castro
 sc/source/ui/unoobj/docuno.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit ff8c13a5a0821ef19688773ad202fd7942646e1e
Author: Henry Castro hcas...@collabora.com
Date:   Sun Mar 22 20:13:29 2015 -0400

sc tiled editing: Set the viewport size to document size

When clicking out of range of viewport, the cursor position and edit in 
place view get wrong values.

Change-Id: I210705c9f8909598d8d47c15c14c06f96bfc4caa

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b9e2bf4..44e47b0 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -469,6 +469,11 @@ void ScModelObj::paintTile( VirtualDevice rDevice,
 ScViewData* pViewData = ScDocShell::GetViewData();
 ScGridWindow* pGridWindow = pViewData-GetActiveWin();
 
+// Set the viewport size to document size
+const MapMode aMapTwip( MAP_TWIP );
+Size aDocSize = getDocumentSize();
+pGridWindow-SetOutputSizePixel( pGridWindow-LogicToPixel(aDocSize, 
aMapTwip) );
+
 pGridWindow-PaintTile( rDevice, nOutputWidth, nOutputHeight,
 nTilePosX, nTilePosY, nTileWidth, nTileHeight );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-20 Thread Henry Castro
 sc/source/ui/view/gridwin4.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 44d92b0cff3815950e013351f93be0b21541cb97
Author: Henry Castro hcas...@collabora.com
Date:   Fri Mar 20 12:22:09 2015 +0100

sc tiled rendering: add missing mm100 - twips conversion

Change-Id: Id0b1d88d0852e9333538ca9cecf4605c06440494

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 6324933..630a0c8 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -984,7 +984,19 @@ void ScGridWindow::LogicInvalidate(const ::vcl::Region* 
pRegion)
 if (!pRegion)
 sRectangle = EMPTY;
 else
-sRectangle = pRegion-GetBoundRect().toString();
+{
+Rectangle aRectangle = pRegion-GetBoundRect();
+if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
+{
+// Conversion to twips is necessary.
+aRectangle.Left() = convertMm100ToTwip(aRectangle.Left());
+aRectangle.Top() = convertMm100ToTwip(aRectangle.Top());
+aRectangle.Right() = convertMm100ToTwip(aRectangle.Right());
+aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom());
+}
+sRectangle = aRectangle.toString();
+}
+
 
pViewData-GetDocument()-GetDrawLayer()-libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES,
 sRectangle.getStr());
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source sd/source vcl/source

2015-03-20 Thread Miklos Vajna
 sc/source/ui/view/gridwin4.cxx |   13 +
 sd/source/ui/view/sdwindow.cxx |   13 +
 vcl/source/window/paint.cxx|   16 
 3 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit 0ff8b2c4340356cb0699dc0f22ea6cf5f06df934
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Mar 20 12:37:26 2015 +0100

OutputDevice::LogicInvalidate: clean up sc/sd duplication

Writer is not affected, as there the map mode is disabled and everything
is in twips internally.

Change-Id: I3b5289f82e89be5943a0b14a5167b33132cf78d0

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 630a0c8..cf72fc3 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -984,18 +984,7 @@ void ScGridWindow::LogicInvalidate(const ::vcl::Region* 
pRegion)
 if (!pRegion)
 sRectangle = EMPTY;
 else
-{
-Rectangle aRectangle = pRegion-GetBoundRect();
-if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
-{
-// Conversion to twips is necessary.
-aRectangle.Left() = convertMm100ToTwip(aRectangle.Left());
-aRectangle.Top() = convertMm100ToTwip(aRectangle.Top());
-aRectangle.Right() = convertMm100ToTwip(aRectangle.Right());
-aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom());
-}
-sRectangle = aRectangle.toString();
-}
+sRectangle = pRegion-GetBoundRect().toString();
 
 
pViewData-GetDocument()-GetDrawLayer()-libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES,
 sRectangle.getStr());
 }
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 8a79750..727eca9 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -996,18 +996,7 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion)
 if (!pRegion)
 sRectangle = EMPTY;
 else
-{
-Rectangle aRectangle = pRegion-GetBoundRect();
-if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
-{
-// Conversion to twips is necessary.
-aRectangle.Left() = convertMm100ToTwip(aRectangle.Left());
-aRectangle.Top() = convertMm100ToTwip(aRectangle.Top());
-aRectangle.Right() = convertMm100ToTwip(aRectangle.Right());
-aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom());
-}
-sRectangle = aRectangle.toString();
-}
+sRectangle = pRegion-GetBoundRect().toString();
 
mpViewShell-GetDoc()-libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, 
sRectangle.getStr());
 }
 
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 4d47dec..7180d79 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -859,6 +859,20 @@ void Window::Invalidate( sal_uInt16 nFlags )
 LogicInvalidate(0);
 }
 
+/// Converts rRegion from MM100 to twips based on the map mode of rWindow.
+void lcl_toTwips(Window rWindow, vcl::Region rRegion)
+{
+if (rWindow.IsMapModeEnabled()  rWindow.GetMapMode().GetMapUnit() == 
MAP_100TH_MM)
+{
+Rectangle aRectangle = rRegion.GetBoundRect();
+aRectangle.Left() = convertMm100ToTwip(aRectangle.Left());
+aRectangle.Top() = convertMm100ToTwip(aRectangle.Top());
+aRectangle.Right() = convertMm100ToTwip(aRectangle.Right());
+aRectangle.Bottom() = convertMm100ToTwip(aRectangle.Bottom());
+rRegion = aRectangle;
+}
+}
+
 void Window::Invalidate( const Rectangle rRect, sal_uInt16 nFlags )
 {
 
@@ -872,6 +886,7 @@ void Window::Invalidate( const Rectangle rRect, sal_uInt16 
nFlags )
 vcl::Region aRegion( aRect );
 ImplInvalidate( aRegion, nFlags );
 vcl::Region aLogicRegion(rRect);
+lcl_toTwips(*this, aLogicRegion);
 LogicInvalidate(aLogicRegion);
 }
 }
@@ -894,6 +909,7 @@ void Window::Invalidate( const vcl::Region rRegion, 
sal_uInt16 nFlags )
 {
 ImplInvalidate( aRegion, nFlags );
 vcl::Region aLogicRegion(rRegion);
+lcl_toTwips(*this, aLogicRegion);
 LogicInvalidate(aLogicRegion);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-16 Thread Jan Holesovsky
 sc/source/ui/view/gridwin4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 17a20bc3d047615d9f8820490b63709855e3f238
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Mar 16 13:46:53 2015 +0100

sc tiled editing: Set the correct map mode for editeng.

When we are entering some text into the sheet, now it happens at the correct
place.  Unfortunately we are still invalidating the wrong area, so it is not
really visible unless you tweak the ScGridWindow::LogicInvalidate() to
invalidate much more tiles.

Change-Id: I74a568761c3b21522fe291649c33829aaea200e7

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 87c3cab..3e4ce0f 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -887,7 +887,7 @@ void ScGridWindow::DrawContent(OutputDevice rDevice, const 
ScTableInfo rTableI
 aEnd.Y() -= 2;
 rDevice.DrawRect(Rectangle(aStart, aEnd));
 
-rDevice.SetMapMode(pViewData-GetLogicMode());
+rDevice.SetMapMode(bIsTiledRendering? aDrawMode: 
pViewData-GetLogicMode());
 pEditView-Paint(PixelToLogic(Rectangle(Point(nScrX, nScrY), 
Size(aOutputData.GetScrW(), aOutputData.GetScrH(, rDevice);
 rDevice.SetMapMode(MAP_PIXEL);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-13 Thread Henry Castro
 sc/source/ui/view/gridwin.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 26fc9e462e3a2be070855ed3af7a3afced48bc9e
Author: Henry Castro hcas...@collabora.com
Date:   Fri Mar 13 08:31:25 2015 +0100

sc tiled editing: EndTracking() is necessary in the tiled rendering case.

Change-Id: I0fc550ed669e08787b968ec03c09c1d8ad04dd65

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ccdc037..add8d1b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2433,6 +2433,11 @@ void ScGridWindow::LogicMouseButtonUp(const MouseEvent 
rMouseEvent)
 assert(rDoc.GetDrawLayer()-isTiledRendering());
 
 MouseButtonUp(rMouseEvent);
+
+// sometimes MouseButtonDown captures mouse and starts tracking, and VCL
+// will not take care of releasing that with tiled rendering
+if (IsTracking())
+EndTracking();
 }
 
 void ScGridWindow::FakeButtonUp()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-12 Thread Henry Castro
 sc/source/ui/view/gridwin4.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit bfd16857d383434dd06faf78eedafd915ae55961
Author: Henry Castro hcas...@collabora.com
Date:   Thu Mar 12 11:34:35 2015 +0100

sc tiled rendering: Avoid warnings about a non-existing SdrPaintWindow.

Change-Id: Idb9695515d9a829fb63ea37e02f4bf2b111bf6bf

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index b3cf5c1..5949ff8 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -957,7 +957,15 @@ void ScGridWindow::PaintTile( VirtualDevice rDevice,
 -fTilePosXPixel, -fTilePosYPixel, nCol1, nRow1, nCol2, nRow2,
 fPPTX, fPPTY);
 
+// create a temporary SdrPaintWindow to avoid warnings
+SdrPaintWindow aTemporaryPaintWindow(*pViewData-GetScDrawView(), rDevice);
+SdrPageView* pSdrPageView = pViewData-GetScDrawView()-GetSdrPageView();
+pSdrPageView-AddPaintWindowToPageView(aTemporaryPaintWindow);
+
+// draw the content
 DrawContent(rDevice, aTabInfo, aOutputData, true, SC_UPDATE_ALL);
+
+pSdrPageView-RemovePaintWindowFromPageView(aTemporaryPaintWindow);
 }
 
 void ScGridWindow::LogicInvalidate(const ::vcl::Region* pRegion)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

2015-03-09 Thread Jan Holesovsky
 sc/source/ui/unoobj/docuno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8f7d01c290cdfbeeebdd4d78bf8fdb64ac227faf
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Mar 9 14:51:59 2015 +0100

sc tiled mouse events: Fix the click coordinates in non-100% zooms.

Change-Id: Ic535aaf9c1cac303dbade4dab7500d176b2b

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index eae8cc0..dcd16fa 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -534,7 +534,7 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, 
int nCount)
 return;
 
 // Calc operates in pixels...
-MouseEvent aEvent(Point(nX / TWIPS_PER_PIXEL, nY / TWIPS_PER_PIXEL), 
nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
+MouseEvent aEvent(Point(nX * pViewData-GetPPTX(), nY * 
pViewData-GetPPTY()), nCount, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT);
 
 switch (nType)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits