[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - libreofficekit/source vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Mar 23 04:11:16 PDT 2015
libreofficekit/source/gtk/lokdocview.cxx | 71 +++++++++++++++----------------
vcl/source/window/paint.cxx | 2
2 files changed, 37 insertions(+), 36 deletions(-)
New commits:
commit 3e4d05621b04b7f30393e155e69c78b3fc4b79aa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 23 12:09:03 2015 +0100
lokdocview: add LOKDocView_Impl ctor
It simplifies lok_docview_init() a lot and makes harder to add a
LOKDocView_Impl member without initializing it.
Change-Id: I02d91b97fecd86896c11facca98fabd6a79157e5
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index db61812..66568ca 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -92,6 +92,42 @@ struct LOKDocView_Impl
/// If we are in the middle of a drag of a graphic selection handle.
bool m_bInDragGraphicHandles[8];
///@}
+
+ LOKDocView_Impl()
+ : m_pEventBox(gtk_event_box_new()),
+ m_pTable(0),
+ m_pCanvas(0),
+ m_fZoom(1),
+ m_pOffice(0),
+ m_pDocument(0),
+ m_bEdit(false),
+ m_aVisibleCursor({0, 0, 0, 0}),
+ m_bCursorOverlayVisible(false),
+ m_bCursorVisible(true),
+ m_nLastButtonPressTime(0),
+ m_nLastButtonReleaseTime(0),
+ m_pTextSelectionRectangles(0),
+ m_aTextSelectionStart({0, 0, 0, 0}),
+ m_aTextSelectionEnd({0, 0, 0, 0}),
+ m_aGraphicSelection({0, 0, 0, 0}),
+ m_bInDragGraphicSelection(false),
+
+ // Start/middle/end handle.
+ m_pHandleStart(0),
+ m_aHandleStartRect({0, 0, 0, 0}),
+ m_bInDragStartHandle(false),
+ m_pHandleMiddle(0),
+ m_aHandleMiddleRect({0, 0, 0, 0}),
+ m_bInDragMiddleHandle(false),
+ m_pHandleEnd(0),
+ m_aHandleEndRect({0, 0, 0, 0}),
+ m_bInDragEndHandle(false),
+
+ m_pGraphicHandle(0)
+ {
+ memset(&m_aGraphicHandleRects, 0, sizeof(m_aGraphicHandleRects));
+ memset(&m_bInDragGraphicHandles, 0, sizeof(m_bInDragGraphicHandles));
+ }
};
static void lok_docview_class_init( gpointer );
@@ -412,7 +448,6 @@ static void lok_docview_init( GTypeInstance* pInstance, gpointer )
gtk_scrolled_window_set_vadjustment( GTK_SCROLLED_WINDOW( pDocView ), NULL );
pDocView->m_pImpl = new LOKDocView_Impl();
- pDocView->m_pImpl->m_pEventBox = gtk_event_box_new();
gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(pDocView),
pDocView->m_pImpl->m_pEventBox );
@@ -423,40 +458,6 @@ static void lok_docview_init( GTypeInstance* pInstance, gpointer )
gtk_widget_show( pDocView->m_pImpl->m_pEventBox );
- pDocView->m_pImpl->m_pTable = 0;
- pDocView->m_pImpl->m_pCanvas = 0;
-
- pDocView->m_pImpl->m_pOffice = 0;
- pDocView->m_pImpl->m_pDocument = 0;
-
- pDocView->m_pImpl->m_fZoom = 1;
- pDocView->m_pImpl->m_bEdit = false;
- memset(&pDocView->m_pImpl->m_aVisibleCursor, 0, sizeof(pDocView->m_pImpl->m_aVisibleCursor));
- pDocView->m_pImpl->m_bCursorOverlayVisible = false;
- pDocView->m_pImpl->m_bCursorVisible = true;
- pDocView->m_pImpl->m_nLastButtonPressTime = 0;
- pDocView->m_pImpl->m_nLastButtonReleaseTime = 0;
- pDocView->m_pImpl->m_pTextSelectionRectangles = 0;
- memset(&pDocView->m_pImpl->m_aTextSelectionStart, 0, sizeof(pDocView->m_pImpl->m_aTextSelectionStart));
- memset(&pDocView->m_pImpl->m_aTextSelectionEnd, 0, sizeof(pDocView->m_pImpl->m_aTextSelectionEnd));
- memset(&pDocView->m_pImpl->m_aGraphicSelection, 0, sizeof(pDocView->m_pImpl->m_aGraphicSelection));
- pDocView->m_pImpl->m_bInDragGraphicSelection = false;
-
- // Start/middle/end handle.
- pDocView->m_pImpl->m_pHandleStart = 0;
- memset(&pDocView->m_pImpl->m_aHandleStartRect, 0, sizeof(pDocView->m_pImpl->m_aHandleStartRect));
- pDocView->m_pImpl->m_bInDragStartHandle = false;
- pDocView->m_pImpl->m_pHandleMiddle = 0;
- memset(&pDocView->m_pImpl->m_aHandleMiddleRect, 0, sizeof(pDocView->m_pImpl->m_aHandleMiddleRect));
- pDocView->m_pImpl->m_bInDragMiddleHandle = false;
- pDocView->m_pImpl->m_pHandleEnd = 0;
- memset(&pDocView->m_pImpl->m_aHandleEndRect, 0, sizeof(pDocView->m_pImpl->m_aHandleEndRect));
- pDocView->m_pImpl->m_bInDragEndHandle = false;
-
- pDocView->m_pImpl->m_pGraphicHandle = 0;
- memset(&pDocView->m_pImpl->m_aGraphicHandleRects, 0, sizeof(pDocView->m_pImpl->m_aGraphicHandleRects));
- memset(&pDocView->m_pImpl->m_bInDragGraphicHandles, 0, sizeof(pDocView->m_pImpl->m_bInDragGraphicHandles));
-
gtk_signal_connect( GTK_OBJECT(pDocView), "destroy",
GTK_SIGNAL_FUNC(lcl_onDestroy), NULL );
g_signal_connect_after(pDocView->m_pImpl->m_pEventBox, "expose-event",
commit 81714838ee629fd61addc8e5df61b8abc9b5bf59
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 23 11:44:50 2015 +0100
vcl tiled rendering: fix invalidation callback in Impress
Even if map mode is disabled, we have to check if the map mode is 100th
mm, and if so, do the mm100 -> twips conversion. This was not visible
previously due to the full repaints fixed by commit
7b8a59807806dbf6ec759a836c873b435e09e907 (sd: when tiled rendering,
disable map mode early, 2015-03-20).
Change-Id: I57862b43cc45ef864d7ec05c47b136e534ba2d54
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 480f389..f977378 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -862,7 +862,7 @@ 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)
{
- if (rWindow.IsMapModeEnabled() && rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
+ if (rWindow.GetMapMode().GetMapUnit() == MAP_100TH_MM)
rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
}
More information about the Libreoffice-commits
mailing list