[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Mar 4 05:45:08 PST 2015
sw/inc/viewsh.hxx | 3 ---
sw/source/core/view/viewsh.cxx | 23 ++++++++++-------------
sw/source/core/view/vnew.cxx | 6 ------
3 files changed, 10 insertions(+), 22 deletions(-)
New commits:
commit 0a2028d5efe5fc4e7bb82bd175aec22c9ac87fec
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Mar 4 14:41:56 2015 +0100
SwViewShell: store tiled rendering state in SdrModel
On one hand, this cleans up duplication, but what's more important is
that without this, svx can't invoke sw's LOK callback, which will be
needed for graphic selection.
Change-Id: Id414489fc3fbc52914b28fdb9bea4134edfbeafe
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 052060a..2bc8260 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -158,7 +158,6 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell>
// boolean, indicating that class in constructor.
bool mbInConstructor:1;
- bool mbTiledRendering:1; ///< Set if we are doing the tiled rendering (using PaintTile()).
SdrPaintWindow* mpTargetPaintWindow;
OutputDevice* mpBufferedOut;
@@ -195,8 +194,6 @@ protected:
sal_uInt16 mnLockPaint; ///< != 0 if Paint is locked.
bool mbSelectAll; ///< Special select all mode: whole document selected, even if doc starts with table.
- LibreOfficeKitCallback mpLibreOfficeKitCallback;
- void* mpLibreOfficeKitData;
bool mbInLibreOfficeKitCallback;
public:
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index e74f326..0af292a 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -119,8 +119,7 @@ void SwViewShell::ToggleHeaderFooterEdit()
void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
{
- mpLibreOfficeKitCallback = pCallback;
- mpLibreOfficeKitData = pData;
+ getIDocumentDrawModelAccess()->GetDrawModel()->registerLibreOfficeKitCallback(pCallback, pData);
}
void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
@@ -128,18 +127,17 @@ void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
if (mbInLibreOfficeKitCallback)
return;
- if (mpLibreOfficeKitCallback)
- mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData);
+ getIDocumentDrawModelAccess()->GetDrawModel()->libreOfficeKitCallback(nType, pPayload);
}
void SwViewShell::setTiledRendering(bool bTiledRendering)
{
- mbTiledRendering = bTiledRendering;
+ getIDocumentDrawModelAccess()->GetDrawModel()->setTiledRendering(bTiledRendering);
}
bool SwViewShell::isTiledRendering() const
{
- return mbTiledRendering;
+ return getIDocumentDrawModelAccess()->GetDrawModel()->isTiledRendering();
}
static void
@@ -182,7 +180,7 @@ void SwViewShell::DLPrePaint2(const vcl::Region& rRegion)
MakeDrawView();
// Prefer window; if tot available, get mpOut (e.g. printer)
- mpPrePostOutDev = (GetWin() && !mbTiledRendering)? GetWin(): GetOut();
+ mpPrePostOutDev = (GetWin() && !isTiledRendering())? GetWin(): GetOut();
// #i74769# use SdrPaintWindow now direct
mpTargetPaintWindow = Imp()->GetDrawView()->BeginDrawLayers(mpPrePostOutDev, rRegion);
@@ -403,7 +401,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
if ( bPaintsFromSystem )
PaintDesktop( aRect );
- if (!mpLibreOfficeKitCallback)
+ if (!isTiledRendering())
pCurrentLayout->Paint( aRect );
else
pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
@@ -1773,11 +1771,10 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
{
// SwViewShell's output device setup
// TODO clean up SwViewShell's approach to output devices (the many of
- // them - mpBufferedOut, mpOut, mpWin, ..., and get rid of
- // mbTiledRendering)
+ // them - mpBufferedOut, mpOut, mpWin, ...)
OutputDevice *pSaveOut = mpOut;
- bool bTiledRendering = mbTiledRendering;
- mbTiledRendering = true;
+ bool bTiledRendering = isTiledRendering();
+ setTiledRendering(true);
mbInLibreOfficeKitCallback = true;
mpOut = &rDevice;
@@ -1827,7 +1824,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// SwViewShell's output device tear down
mpOut = pSaveOut;
mbInLibreOfficeKitCallback = false;
- mbTiledRendering = bTiledRendering;
+ setTiledRendering(bTiledRendering);
}
#if !HAVE_FEATURE_DESKTOP
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 7891149..51d91d1 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -162,15 +162,12 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
mbShowHeaderSeparator( false ),
mbShowFooterSeparator( false ),
mbHeaderFooterEdit( false ),
- mbTiledRendering(false),
mpTargetPaintWindow(0), // #i74769#
mpBufferedOut(0), // #i74769#
mpDoc( &rDocument ),
mnStartAction( 0 ),
mnLockPaint( 0 ),
mbSelectAll(false),
- mpLibreOfficeKitCallback(0),
- mpLibreOfficeKitData(0),
mbInLibreOfficeKitCallback(false),
mpPrePostOutDev(0), // #i72754#
maPrePostMapMode()
@@ -241,15 +238,12 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
mbShowHeaderSeparator( false ),
mbShowFooterSeparator( false ),
mbHeaderFooterEdit( false ),
- mbTiledRendering(false),
mpTargetPaintWindow(0), // #i74769#
mpBufferedOut(0), // #i74769#
mpDoc( rShell.GetDoc() ),
mnStartAction( 0 ),
mnLockPaint( 0 ),
mbSelectAll(false),
- mpLibreOfficeKitCallback(0),
- mpLibreOfficeKitData(0),
mbInLibreOfficeKitCallback(false),
mpPrePostOutDev(0), // #i72754#
maPrePostMapMode()
More information about the Libreoffice-commits
mailing list