2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-04-16 12:06:38 +03:00
|
|
|
#include <config_features.h>
|
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
#include <com/sun/star/accessibility/XAccessible.hpp>
|
2004-10-04 18:15:02 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <sfx2/progress.hxx>
|
|
|
|
#include <svx/srchdlg.hxx>
|
|
|
|
#include <svx/svdobj.hxx>
|
2000-10-17 08:25:31 +00:00
|
|
|
#include <sfx2/viewsh.hxx>
|
2014-06-19 09:15:04 +01:00
|
|
|
#include <drawdoc.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <swwait.hxx>
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
#include <fesh.hxx>
|
|
|
|
#include <doc.hxx>
|
2014-05-26 15:15:18 +02:00
|
|
|
#include <IDocumentDeviceAccess.hxx>
|
2014-06-01 22:21:38 +02:00
|
|
|
#include <IDocumentDrawModelAccess.hxx>
|
2014-06-30 20:58:00 +02:00
|
|
|
#include <IDocumentOutlineNodes.hxx>
|
2014-07-24 16:46:12 +02:00
|
|
|
#include <IDocumentFieldsAccess.hxx>
|
2014-08-06 16:21:14 +02:00
|
|
|
#include <IDocumentLayoutAccess.hxx>
|
2014-08-01 17:09:54 +02:00
|
|
|
#include <IDocumentState.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <rootfrm.hxx>
|
|
|
|
#include <pagefrm.hxx>
|
|
|
|
#include <cntfrm.hxx>
|
|
|
|
#include <viewimp.hxx>
|
|
|
|
#include <frmtool.hxx>
|
|
|
|
#include <viewopt.hxx>
|
|
|
|
#include <dview.hxx>
|
|
|
|
#include <swregion.hxx>
|
|
|
|
#include <hints.hxx>
|
|
|
|
#include <fmtfsize.hxx>
|
|
|
|
#include <docufld.hxx>
|
|
|
|
#include <txtfrm.hxx>
|
|
|
|
#include <layact.hxx>
|
|
|
|
#include <mdiexp.hxx>
|
|
|
|
#include <fntcache.hxx>
|
|
|
|
#include <ptqueue.hxx>
|
|
|
|
#include <tabfrm.hxx>
|
|
|
|
#include <docsh.hxx>
|
|
|
|
#include <pagedesc.hxx>
|
|
|
|
#include <ndole.hxx>
|
|
|
|
#include <ndindex.hxx>
|
2002-02-20 17:14:14 +00:00
|
|
|
#include <accmap.hxx>
|
2013-10-24 11:28:42 +02:00
|
|
|
#include <vcl/bitmapex.hxx>
|
2003-03-27 14:45:43 +00:00
|
|
|
#include <svtools/colorcfg.hxx>
|
2013-10-24 11:28:42 +02:00
|
|
|
#include <vcl/bmpacc.hxx>
|
2013-10-24 16:48:28 +02:00
|
|
|
#include <vcl/alpha.hxx>
|
2002-05-06 11:11:40 +00:00
|
|
|
#include <svtools/accessibilityoptions.hxx>
|
2002-11-01 12:23:37 +00:00
|
|
|
#include <accessibilityoptions.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <statstr.hrc>
|
2007-08-03 12:40:32 +00:00
|
|
|
#include <comcore.hrc>
|
2003-03-27 14:45:43 +00:00
|
|
|
#include <pagepreviewlayout.hxx>
|
2004-08-02 13:19:04 +00:00
|
|
|
#include <sortedobjs.hxx>
|
|
|
|
#include <anchoredobject.hxx>
|
2013-10-23 11:44:22 +02:00
|
|
|
#include <wrtsh.hxx>
|
2014-05-25 14:10:13 +02:00
|
|
|
#include <DocumentSettingManager.hxx>
|
2006-11-14 14:13:03 +00:00
|
|
|
|
2015-06-15 09:12:13 +02:00
|
|
|
#include <view.hxx>
|
2008-03-07 14:00:41 +00:00
|
|
|
#include <PostItMgr.hxx>
|
2013-01-10 16:28:40 +00:00
|
|
|
#include <vcl/dibtools.hxx>
|
2006-11-14 14:13:03 +00:00
|
|
|
#include <vcl/virdev.hxx>
|
2007-08-03 12:40:32 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
2007-06-26 10:58:09 +00:00
|
|
|
#include <svx/sdrpaintwindow.hxx>
|
2015-05-27 17:12:00 +02:00
|
|
|
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2014-04-16 12:06:38 +03:00
|
|
|
#if !HAVE_FEATURE_DESKTOP
|
|
|
|
#include <vcl/sysdata.hxx>
|
|
|
|
#endif
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::mbLstAct = false;
|
2013-10-26 19:50:13 +02:00
|
|
|
ShellResource *SwViewShell::mpShellRes = 0;
|
2015-05-13 12:16:55 +02:00
|
|
|
VclPtr<vcl::Window> SwViewShell::mpCareWindow = nullptr;
|
2013-10-26 19:50:13 +02:00
|
|
|
BitmapEx* SwViewShell::mpErrorBmp = NULL;
|
|
|
|
BitmapEx* SwViewShell::mpReplaceBmp = NULL;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-12-17 18:12:09 +09:00
|
|
|
bool bInSizeNotify = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
TYPEINIT0(SwViewShell);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ToggleHeaderFooterEdit()
|
2011-12-28 20:01:57 +01:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mbHeaderFooterEdit = !mbHeaderFooterEdit;
|
|
|
|
if ( !mbHeaderFooterEdit )
|
2011-12-29 13:42:43 +01:00
|
|
|
{
|
|
|
|
SetShowHeaderFooterSeparator( Header, false );
|
|
|
|
SetShowHeaderFooterSeparator( Footer, false );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Avoid corner case
|
|
|
|
if ( !IsShowHeaderFooterSeparator( Header ) &&
|
|
|
|
!IsShowHeaderFooterSeparator( Footer ) )
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mbHeaderFooterEdit = false;
|
2011-12-29 13:42:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Repaint everything
|
2011-12-28 20:01:57 +01:00
|
|
|
GetWin()->Invalidate();
|
2011-06-29 10:47:12 +02:00
|
|
|
}
|
|
|
|
|
2015-01-06 16:05:45 +01:00
|
|
|
void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
|
|
|
|
{
|
2015-03-04 14:41:56 +01:00
|
|
|
getIDocumentDrawModelAccess()->GetDrawModel()->registerLibreOfficeKitCallback(pCallback, pData);
|
2015-01-06 16:05:45 +01:00
|
|
|
}
|
|
|
|
|
2015-01-23 17:13:03 +01:00
|
|
|
void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
|
2015-01-06 16:05:45 +01:00
|
|
|
{
|
2015-01-27 10:59:54 +01:00
|
|
|
if (mbInLibreOfficeKitCallback)
|
2015-01-23 18:38:55 +01:00
|
|
|
return;
|
|
|
|
|
2015-03-04 14:41:56 +01:00
|
|
|
getIDocumentDrawModelAccess()->GetDrawModel()->libreOfficeKitCallback(nType, pPayload);
|
2015-01-06 16:05:45 +01:00
|
|
|
}
|
|
|
|
|
SwRootFrm::CheckViewLayout: never center pages when doing tiled rendering
The size of the root frame is usually the max of the page frame widths,
except when the visual area is larger, in which case the root frame is
the visual area width, and page frames are centered (when there is a
single column).
When doing tiled rendering, we are not interested in the gray area
around the pages (not more than just having a gap between pages), so
never do this centering. This has two benefits:
1) When painting the tiles, we change the visual area already to always
have the given tile visible, that would undo this centering anyway, but
changing the size of the root frame causes a pointless
mass-invalidation.
2) When getting the size of the document, this way the width of the
document (root frame) will independent from the visual area, i.e. it'll
be always the same.
Change-Id: Ib0d86bbe6c7b5a83646264a2f308624179ad6982
2015-01-14 10:28:40 +01:00
|
|
|
void SwViewShell::setTiledRendering(bool bTiledRendering)
|
|
|
|
{
|
2015-03-04 14:41:56 +01:00
|
|
|
getIDocumentDrawModelAccess()->GetDrawModel()->setTiledRendering(bTiledRendering);
|
SwRootFrm::CheckViewLayout: never center pages when doing tiled rendering
The size of the root frame is usually the max of the page frame widths,
except when the visual area is larger, in which case the root frame is
the visual area width, and page frames are centered (when there is a
single column).
When doing tiled rendering, we are not interested in the gray area
around the pages (not more than just having a gap between pages), so
never do this centering. This has two benefits:
1) When painting the tiles, we change the visual area already to always
have the given tile visible, that would undo this centering anyway, but
changing the size of the root frame causes a pointless
mass-invalidation.
2) When getting the size of the document, this way the width of the
document (root frame) will independent from the visual area, i.e. it'll
be always the same.
Change-Id: Ib0d86bbe6c7b5a83646264a2f308624179ad6982
2015-01-14 10:28:40 +01:00
|
|
|
}
|
|
|
|
|
2015-01-23 17:13:03 +01:00
|
|
|
bool SwViewShell::isTiledRendering() const
|
SwRootFrm::CheckViewLayout: never center pages when doing tiled rendering
The size of the root frame is usually the max of the page frame widths,
except when the visual area is larger, in which case the root frame is
the visual area width, and page frames are centered (when there is a
single column).
When doing tiled rendering, we are not interested in the gray area
around the pages (not more than just having a gap between pages), so
never do this centering. This has two benefits:
1) When painting the tiles, we change the visual area already to always
have the given tile visible, that would undo this centering anyway, but
changing the size of the root frame causes a pointless
mass-invalidation.
2) When getting the size of the document, this way the width of the
document (root frame) will independent from the visual area, i.e. it'll
be always the same.
Change-Id: Ib0d86bbe6c7b5a83646264a2f308624179ad6982
2015-01-14 10:28:40 +01:00
|
|
|
{
|
2015-03-04 14:41:56 +01:00
|
|
|
return getIDocumentDrawModelAccess()->GetDrawModel()->isTiledRendering();
|
SwRootFrm::CheckViewLayout: never center pages when doing tiled rendering
The size of the root frame is usually the max of the page frame widths,
except when the visual area is larger, in which case the root frame is
the visual area width, and page frames are centered (when there is a
single column).
When doing tiled rendering, we are not interested in the gray area
around the pages (not more than just having a gap between pages), so
never do this centering. This has two benefits:
1) When painting the tiles, we change the visual area already to always
have the given tile visible, that would undo this centering anyway, but
changing the size of the root frame causes a pointless
mass-invalidation.
2) When getting the size of the document, this way the width of the
document (root frame) will independent from the visual area, i.e. it'll
be always the same.
Change-Id: Ib0d86bbe6c7b5a83646264a2f308624179ad6982
2015-01-14 10:28:40 +01:00
|
|
|
}
|
|
|
|
|
2013-06-24 18:09:35 +02:00
|
|
|
static void
|
2013-10-26 19:50:13 +02:00
|
|
|
lcl_PaintTransparentFormControls(SwViewShell & rShell, SwRect const& rRect)
|
2013-06-24 18:09:35 +02:00
|
|
|
{
|
|
|
|
// Direct paint has been performed: the background of transparent child
|
|
|
|
// windows has been painted, so need to paint the child windows now.
|
|
|
|
if (rShell.GetWin())
|
|
|
|
{
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window& rWindow = *(rShell.GetWin());
|
2015-05-11 08:37:50 +02:00
|
|
|
const Rectangle aRectanglePixel(rShell.GetOut()->LogicToPixel(rRect.SVRect()));
|
2013-06-24 19:50:30 +02:00
|
|
|
PaintTransparentChildren(rWindow, aRectanglePixel);
|
2013-06-24 18:09:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-22 14:11:13 +00:00
|
|
|
// #i72754# 2nd set of Pre/PostPaints
|
2011-05-10 16:33:13 +02:00
|
|
|
// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
|
2007-01-22 14:11:13 +00:00
|
|
|
// and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers
|
|
|
|
// call. That way, all places where paint take place can be handled the same way, even
|
|
|
|
// when calling other paint methods. This is the case at the places where SW paints
|
|
|
|
// buffered into VDevs to avoid flicker. Tis is in general problematic and should be
|
|
|
|
// solved once using the BufferedOutput functionality of the DrawView.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::PrePaint()
|
2008-08-19 23:28:32 +00:00
|
|
|
{
|
|
|
|
// forward PrePaint event from VCL Window to DrawingLayer
|
|
|
|
if(HasDrawView())
|
|
|
|
{
|
|
|
|
Imp()->GetDrawView()->PrePaint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-27 14:52:40 +02:00
|
|
|
void SwViewShell::DLPrePaint2(const vcl::Region& rRegion)
|
2006-11-14 14:13:03 +00:00
|
|
|
{
|
2011-05-10 16:33:13 +02:00
|
|
|
if(mPrePostPaintRegions.empty())
|
2006-11-14 14:13:03 +00:00
|
|
|
{
|
2011-05-10 16:33:13 +02:00
|
|
|
mPrePostPaintRegions.push( rRegion );
|
2007-06-26 10:58:09 +00:00
|
|
|
// #i75172# ensure DrawView to use DrawingLayer bufferings
|
|
|
|
if ( !HasDrawView() )
|
|
|
|
MakeDrawView();
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
// Prefer window; if tot available, get mpOut (e.g. printer)
|
2015-03-04 14:41:56 +01:00
|
|
|
mpPrePostOutDev = (GetWin() && !isTiledRendering())? GetWin(): GetOut();
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// #i74769# use SdrPaintWindow now direct
|
|
|
|
mpTargetPaintWindow = Imp()->GetDrawView()->BeginDrawLayers(mpPrePostOutDev, rRegion);
|
|
|
|
OSL_ENSURE(mpTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)");
|
|
|
|
|
|
|
|
// #i74769# if prerender, save OutDev and redirect to PreRenderDevice
|
|
|
|
if(mpTargetPaintWindow->GetPreRenderDevice())
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpBufferedOut = mpOut;
|
|
|
|
mpOut = &(mpTargetPaintWindow->GetTargetOutputDevice());
|
2007-06-26 10:58:09 +00:00
|
|
|
}
|
2008-08-19 23:28:32 +00:00
|
|
|
|
|
|
|
// remember original paint MapMode for wrapped FlyFrame paints
|
2013-02-23 12:33:14 +01:00
|
|
|
maPrePostMapMode = mpOut->GetMapMode();
|
2006-11-14 14:13:03 +00:00
|
|
|
}
|
2011-05-10 16:33:13 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// region needs to be updated to the given one
|
|
|
|
if( mPrePostPaintRegions.top() != rRegion )
|
|
|
|
Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, rRegion);
|
|
|
|
mPrePostPaintRegions.push( rRegion );
|
|
|
|
}
|
2006-11-14 14:13:03 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::DLPostPaint2(bool bPaintFormLayer)
|
2006-11-14 14:13:03 +00:00
|
|
|
{
|
2013-10-26 19:50:13 +02:00
|
|
|
OSL_ENSURE(!mPrePostPaintRegions.empty(), "SwViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
|
2006-11-14 14:13:03 +00:00
|
|
|
|
2011-05-10 16:33:13 +02:00
|
|
|
if( mPrePostPaintRegions.size() > 1 )
|
|
|
|
{
|
2014-09-27 14:52:40 +02:00
|
|
|
vcl::Region current = mPrePostPaintRegions.top();
|
2011-05-10 16:33:13 +02:00
|
|
|
mPrePostPaintRegions.pop();
|
|
|
|
if( current != mPrePostPaintRegions.top())
|
|
|
|
Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, mPrePostPaintRegions.top());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mPrePostPaintRegions.pop(); // clear
|
|
|
|
if(0 != mpTargetPaintWindow)
|
2006-11-14 14:13:03 +00:00
|
|
|
{
|
2007-06-26 10:58:09 +00:00
|
|
|
// #i74769# restore buffered OutDev
|
|
|
|
if(mpTargetPaintWindow->GetPreRenderDevice())
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOut = mpBufferedOut;
|
2007-06-26 10:58:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// #i74769# use SdrPaintWindow now direct
|
2009-01-20 09:49:16 +00:00
|
|
|
Imp()->GetDrawView()->EndDrawLayers(*mpTargetPaintWindow, bPaintFormLayer);
|
2007-06-26 10:58:09 +00:00
|
|
|
mpTargetPaintWindow = 0;
|
2006-11-14 14:13:03 +00:00
|
|
|
}
|
|
|
|
}
|
2013-05-05 20:19:50 +02:00
|
|
|
// end of Pre/PostPaints
|
2012-05-31 17:59:17 +01:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::ImplEndAction( const bool bIdleEnd )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-06-21 13:20:06 +02:00
|
|
|
// Nothing to do for the printer?
|
2013-10-16 16:36:45 +02:00
|
|
|
if ( !GetWin() || IsPreview() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintWorks = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
UISizeNotify();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
mbInEndAction = true;
|
2013-02-08 19:32:39 +01:00
|
|
|
//will this put the EndAction of the last shell in the sequence?
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = true;
|
2015-01-23 23:06:26 +01:00
|
|
|
for(SwViewShell& rShell : GetRingContainer())
|
2010-10-01 21:57:36 +02:00
|
|
|
{
|
2015-01-23 23:06:26 +01:00
|
|
|
if(&rShell != this && rShell.ActionPend())
|
2010-10-01 21:57:36 +02:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = false;
|
2015-01-23 23:06:26 +01:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-07 14:00:41 +00:00
|
|
|
const bool bIsShellForCheckViewLayout = ( this == GetLayout()->GetCurrShell() );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SET_CURR_SHELL( this );
|
2006-12-12 15:29:44 +00:00
|
|
|
if ( Imp()->HasDrawView() && !Imp()->GetDrawView()->areMarkHandlesHidden() )
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->StartAction();
|
|
|
|
|
|
|
|
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-11-26 18:52:32 +09:00
|
|
|
const bool bExtraData = ::IsExtraData( GetDoc() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( !bIdleEnd )
|
|
|
|
{
|
|
|
|
SwLayAction aAction( GetLayout(), Imp() );
|
2014-04-25 14:00:35 +02:00
|
|
|
aAction.SetComplete( false );
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mnLockPaint )
|
2014-04-25 14:00:35 +02:00
|
|
|
aAction.SetPaint( false );
|
2015-01-01 16:49:23 +02:00
|
|
|
aAction.SetInputType( VclInputFlags::KEYBOARD );
|
2000-09-18 23:08:29 +00:00
|
|
|
aAction.Action();
|
|
|
|
}
|
|
|
|
|
2008-03-07 14:00:41 +00:00
|
|
|
if ( bIsShellForCheckViewLayout )
|
2013-02-23 12:33:14 +01:00
|
|
|
GetLayout()->CheckViewLayout( GetViewOptions(), &maVisArea );
|
2008-03-07 14:00:41 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//If we don't call Paints, we wait for the Paint of the system.
|
|
|
|
//Then the clipping is set correctly; e.g. shifting of a Draw object
|
2009-12-29 09:19:13 +01:00
|
|
|
if ( Imp()->GetRegion() ||
|
2013-02-23 12:33:14 +01:00
|
|
|
maInvalidRect.HasArea() ||
|
2009-12-29 09:19:13 +01:00
|
|
|
bExtraData )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( !mnLockPaint )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-03-06 09:45:08 +00:00
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bPaintsFromSystem = maInvalidRect.HasArea();
|
2000-09-18 23:08:29 +00:00
|
|
|
GetWin()->Update();
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( maInvalidRect.HasArea() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( bPaintsFromSystem )
|
2013-02-23 12:33:14 +01:00
|
|
|
Imp()->AddPaintRect( maInvalidRect );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
ResetInvalidRect();
|
2014-04-25 14:00:35 +02:00
|
|
|
bPaintsFromSystem = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintWorks = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwRegionRects *pRegion = Imp()->GetRegion();
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//JP 27.11.97: what hid the selection, must also Show it,
|
|
|
|
// else we get Paint errors!
|
|
|
|
// e.g. additional mode, page half visible vertically, in the
|
|
|
|
// middle a selection and with an other cursor jump to left
|
|
|
|
// right border. Without ShowCrsr the selection disappears.
|
2012-12-17 18:12:09 +09:00
|
|
|
bool bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bShowCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell*>(this)->HideCrsrs();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( pRegion )
|
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
SwRootFrm* pCurrentLayout = GetLayout();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2001-11-05 12:43:40 +00:00
|
|
|
Imp()->pRegion = NULL;
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//First Invert then Compress, never the other way round!
|
2000-09-18 23:08:29 +00:00
|
|
|
pRegion->Invert();
|
|
|
|
|
|
|
|
pRegion->Compress();
|
|
|
|
|
2015-03-20 14:59:22 +02:00
|
|
|
VclPtr<VirtualDevice> pVout;
|
2012-07-20 12:08:29 +02:00
|
|
|
while ( !pRegion->empty() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-07-20 12:08:29 +02:00
|
|
|
SwRect aRect( pRegion->back() );
|
|
|
|
pRegion->pop_back();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-12-17 18:12:09 +09:00
|
|
|
bool bPaint = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( IsEndActionByVirDev() )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//create virtual device and set.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !pVout )
|
2015-04-17 15:54:21 +02:00
|
|
|
pVout = VclPtr<VirtualDevice>::Create( *GetOut() );
|
2000-09-18 23:08:29 +00:00
|
|
|
MapMode aMapMode( GetOut()->GetMapMode() );
|
|
|
|
pVout->SetMapMode( aMapMode );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bSizeOK = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
Rectangle aTmp1( aRect.SVRect() );
|
|
|
|
aTmp1 = GetOut()->LogicToPixel( aTmp1 );
|
|
|
|
Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 ) );
|
|
|
|
if ( aTmp2.Left() > aRect.Left() )
|
2013-04-11 00:21:40 -03:00
|
|
|
aTmp1.Left() = std::max( 0L, aTmp1.Left() - 1L );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aTmp2.Top() > aRect.Top() )
|
2013-04-11 00:21:40 -03:00
|
|
|
aTmp1.Top() = std::max( 0L, aTmp1.Top() - 1L );
|
2000-09-18 23:08:29 +00:00
|
|
|
aTmp1.Right() += 1;
|
|
|
|
aTmp1.Bottom() += 1;
|
|
|
|
aTmp1 = GetOut()->PixelToLogic( aTmp1 );
|
|
|
|
aRect = SwRect( aTmp1 );
|
|
|
|
|
|
|
|
const Size aTmp( pVout->GetOutputSize() );
|
|
|
|
if ( aTmp.Height() < aRect.Height() ||
|
|
|
|
aTmp.Width() < aRect.Width() )
|
|
|
|
{
|
|
|
|
bSizeOK = pVout->SetOutputSize( aRect.SSize() );
|
|
|
|
}
|
|
|
|
if ( bSizeOK )
|
|
|
|
{
|
2012-12-17 18:12:09 +09:00
|
|
|
bPaint = false;
|
2007-07-31 16:43:00 +00:00
|
|
|
|
2012-05-31 17:59:17 +01:00
|
|
|
// --> OD 2007-07-26 #i79947#
|
2013-02-23 12:33:14 +01:00
|
|
|
// #i72754# start Pre/PostPaint encapsulation before mpOut is changed to the buffering VDev
|
2014-09-27 14:52:40 +02:00
|
|
|
const vcl::Region aRepaintRegion(aRect.SVRect());
|
2007-07-31 16:43:00 +00:00
|
|
|
DLPrePaint2(aRepaintRegion);
|
2012-05-31 17:59:17 +01:00
|
|
|
// <--
|
2007-07-31 16:43:00 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
OutputDevice *pOld = GetOut();
|
|
|
|
pVout->SetLineColor( pOld->GetLineColor() );
|
|
|
|
pVout->SetFillColor( pOld->GetFillColor() );
|
|
|
|
Point aOrigin( aRect.Pos() );
|
|
|
|
aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y();
|
|
|
|
aMapMode.SetOrigin( aOrigin );
|
|
|
|
pVout->SetMapMode( aMapMode );
|
2007-01-22 14:11:13 +00:00
|
|
|
|
2015-03-20 14:59:22 +02:00
|
|
|
mpOut = pVout.get();
|
2002-01-21 08:46:44 +00:00
|
|
|
if ( bPaintsFromSystem )
|
2015-05-23 18:49:16 +09:00
|
|
|
PaintDesktop(*mpOut, aRect);
|
2010-06-13 15:22:56 +02:00
|
|
|
pCurrentLayout->Paint( aRect );
|
2000-09-18 23:08:29 +00:00
|
|
|
pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
|
|
|
|
aRect.Pos(), aRect.SSize(), *pVout );
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOut = pOld;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
// #i72754# end Pre/PostPaint encapsulation when mpOut is back and content is painted
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( bPaint )
|
2002-01-21 08:46:44 +00:00
|
|
|
{
|
2007-06-26 10:58:09 +00:00
|
|
|
// #i75172# begin DrawingLayer paint
|
|
|
|
// need to do begin/end DrawingLayer preparation for each single rectangle of the
|
|
|
|
// repaint region. I already tried to prepare only once for the whole Region. This
|
|
|
|
// seems to work (and does technically) but fails with transparent objects. Since the
|
|
|
|
// region given to BeginDarwLayers() defines the clip region for DrawingLayer paint,
|
|
|
|
// transparent objects in the single rectangles will indeed be painted multiple times.
|
2014-09-27 14:52:40 +02:00
|
|
|
DLPrePaint2(vcl::Region(aRect.SVRect()));
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2002-01-21 08:46:44 +00:00
|
|
|
if ( bPaintsFromSystem )
|
2015-05-23 18:49:16 +09:00
|
|
|
PaintDesktop(*GetOut(), aRect);
|
2015-03-04 14:41:56 +01:00
|
|
|
if (!isTiledRendering())
|
2015-01-13 12:34:22 +01:00
|
|
|
pCurrentLayout->Paint( aRect );
|
|
|
|
else
|
|
|
|
pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// #i75172# end DrawingLayer paint
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2002-01-21 08:46:44 +00:00
|
|
|
}
|
2009-12-07 13:59:17 +00:00
|
|
|
|
2013-06-24 18:09:35 +02:00
|
|
|
lcl_PaintTransparentFormControls(*this, aRect); // i#107365
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2015-03-20 14:59:22 +02:00
|
|
|
pVout.disposeAndClear();
|
2001-11-05 12:43:40 +00:00
|
|
|
delete pRegion;
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( bShowCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell*>(this)->ShowCrsrs( true );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintWorks = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintWorks = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
mbInEndAction = false;
|
|
|
|
SwViewShell::mbLstAct = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->EndAction();
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//We artificially end the action here to enable the automatic scrollbars
|
|
|
|
//to adjust themselves correctly
|
|
|
|
//EndAction sends a Notify, and that must call Start-/EndAction to
|
|
|
|
//adjust the scrollbars correctly
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
UISizeNotify();
|
2013-02-23 12:33:14 +01:00
|
|
|
++mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-03-08 12:25:36 +00:00
|
|
|
if( Imp()->IsAccessible() )
|
|
|
|
Imp()->FireAccessibleEvents();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ImplStartAction()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintWorks = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->StartAction();
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ImplLockPaint()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( GetWin() && GetWin()->IsVisible() )
|
2014-02-21 12:53:51 +01:00
|
|
|
GetWin()->EnablePaint( false ); //Also cut off the controls.
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->LockPaint();
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::ImplUnlockPaint( bool bVirDev )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
if ( GetWin() && GetWin()->IsVisible() )
|
|
|
|
{
|
|
|
|
if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//Refresh with virtual device to avoid flickering.
|
2015-03-31 21:06:51 +01:00
|
|
|
VclPtrInstance<VirtualDevice> pVout( *mpOut );
|
2013-02-23 12:33:14 +01:00
|
|
|
pVout->SetMapMode( mpOut->GetMapMode() );
|
2000-09-18 23:08:29 +00:00
|
|
|
Size aSize( VisArea().SSize() );
|
|
|
|
aSize.Width() += 20;
|
|
|
|
aSize.Height()+= 20;
|
|
|
|
if( pVout->SetOutputSize( aSize ) )
|
|
|
|
{
|
2014-02-21 12:53:51 +01:00
|
|
|
GetWin()->EnablePaint( true );
|
2000-09-18 23:08:29 +00:00
|
|
|
GetWin()->Validate();
|
|
|
|
|
|
|
|
Imp()->UnlockPaint();
|
2013-02-23 12:33:14 +01:00
|
|
|
pVout->SetLineColor( mpOut->GetLineColor() );
|
|
|
|
pVout->SetFillColor( mpOut->GetFillColor() );
|
2007-01-22 14:11:13 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
// #i72754# start Pre/PostPaint encapsulation before mpOut is changed to the buffering VDev
|
2014-09-27 14:52:40 +02:00
|
|
|
const vcl::Region aRepaintRegion(VisArea().SVRect());
|
2007-01-22 14:11:13 +00:00
|
|
|
DLPrePaint2(aRepaintRegion);
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
OutputDevice *pOld = mpOut;
|
2015-03-20 14:59:22 +02:00
|
|
|
mpOut = pVout.get();
|
2015-05-23 18:49:16 +09:00
|
|
|
Paint(*mpOut, VisArea().SVRect());
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOut = pOld;
|
|
|
|
mpOut->DrawOutDev( VisArea().Pos(), aSize,
|
2000-09-18 23:08:29 +00:00
|
|
|
VisArea().Pos(), aSize, *pVout );
|
2007-01-22 14:11:13 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
// #i72754# end Pre/PostPaint encapsulation when mpOut is back and content is painted
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2013-06-24 18:09:35 +02:00
|
|
|
|
|
|
|
lcl_PaintTransparentFormControls(*this, VisArea()); // fdo#63949
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Imp()->UnlockPaint();
|
2014-02-21 12:53:51 +01:00
|
|
|
GetWin()->EnablePaint( true );
|
2015-05-25 11:20:10 +02:00
|
|
|
GetWin()->Invalidate( InvalidateFlags::Children );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2015-03-20 14:59:22 +02:00
|
|
|
pVout.disposeAndClear();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Imp()->UnlockPaint();
|
2014-02-21 12:53:51 +01:00
|
|
|
GetWin()->EnablePaint( true );
|
2015-05-25 11:20:10 +02:00
|
|
|
GetWin()->Invalidate( InvalidateFlags::Children );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
Imp()->UnlockPaint();
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::AddPaintRect( const SwRect & rRect )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-03-03 09:28:10 +01:00
|
|
|
bool bRet = false;
|
2014-12-03 22:55:09 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-12-03 22:55:09 +01:00
|
|
|
if( rSh.Imp() )
|
2010-06-13 15:22:56 +02:00
|
|
|
{
|
2014-12-03 22:55:09 +01:00
|
|
|
if ( rSh.IsPreview() && rSh.GetWin() )
|
|
|
|
::RepaintPagePreview( &rSh, rRect );
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2014-12-03 22:55:09 +01:00
|
|
|
bRet |= rSh.Imp()->AddPaintRect( rRect );
|
2010-06-13 15:22:56 +02:00
|
|
|
}
|
2014-12-03 22:55:09 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::InvalidateWindows( const SwRect &rRect )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !Imp()->IsCalcLayoutProgress() )
|
|
|
|
{
|
2014-12-03 19:02:25 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-12-03 19:02:25 +01:00
|
|
|
if ( rSh.GetWin() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-12-03 19:02:25 +01:00
|
|
|
if ( rSh.IsPreview() )
|
|
|
|
::RepaintPagePreview( &rSh, rRect );
|
2015-01-15 10:33:42 +01:00
|
|
|
// In case of tiled rendering, invalidation is wanted even if
|
|
|
|
// the rectangle is outside the visual area.
|
|
|
|
else if ( rSh.VisArea().IsOver( rRect ) || rSh.isTiledRendering() )
|
2014-12-03 19:02:25 +01:00
|
|
|
rSh.GetWin()->Invalidate( rRect.SVRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2014-12-03 19:02:25 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::MakeVisible( const SwRect &rRect )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-17 08:25:31 +00:00
|
|
|
if ( !VisArea().IsInside( rRect ) || IsScrollMDI( this, rRect ) || GetCareWin(*this) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !IsViewLocked() )
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( mpWin )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-12-16 17:09:02 +01:00
|
|
|
const SwFrm* pRoot = GetLayout();
|
2001-09-19 16:09:29 +00:00
|
|
|
int nLoopCnt = 3;
|
|
|
|
long nOldH;
|
|
|
|
do{
|
|
|
|
nOldH = pRoot->Frm().Height();
|
|
|
|
StartAction();
|
|
|
|
ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX );
|
|
|
|
EndAction();
|
2013-10-22 15:14:13 +03:00
|
|
|
} while( nOldH != pRoot->Frm().Height() && nLoopCnt-- );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-11-24 00:52:07 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//MA: 04. Nov. 94, no one needs this, does one?
|
2014-08-12 11:40:08 +02:00
|
|
|
OSL_ENSURE( false, "Is MakeVisible still needed for printers?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* SwViewShell::CareChildWin(SwViewShell& rVSh)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if(rVSh.mpSfxViewShell)
|
2000-10-17 08:25:31 +00:00
|
|
|
{
|
2014-04-28 16:45:06 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
|
2013-02-23 12:33:14 +01:00
|
|
|
SfxViewFrame* pVFrame = rVSh.mpSfxViewShell->GetViewFrame();
|
2000-10-17 08:25:31 +00:00
|
|
|
const SfxChildWindow* pChWin = pVFrame->GetChildWindow( nId );
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window *pWin = pChWin ? pChWin->GetWindow() : NULL;
|
2000-10-17 08:25:31 +00:00
|
|
|
if ( pWin && pWin->IsVisible() )
|
|
|
|
return pWin;
|
2014-04-28 16:45:06 +03:00
|
|
|
#endif
|
2000-10-17 08:25:31 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
Point SwViewShell::GetPagePos( sal_uInt16 nPageNum ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return GetLayout()->GetPagePos( nPageNum );
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
sal_uInt16 SwViewShell::GetNumPages()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//It is possible that no layout exists when the method from
|
|
|
|
//root-Ctor is called.
|
2000-09-18 23:08:29 +00:00
|
|
|
return GetLayout() ? GetLayout()->GetPageNum() : 0;
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::IsDummyPage( sal_uInt16 nPageNum ) const
|
2002-03-15 10:47:59 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
return GetLayout() && GetLayout()->IsDummyPage( nPageNum );
|
2002-03-15 10:47:59 +00:00
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/**
|
|
|
|
* Forces update of each field.
|
|
|
|
* It notifies all fields with pNewHt. If that is 0 (default), the field
|
|
|
|
* type is sent (???).
|
2015-05-20 13:05:49 +02:00
|
|
|
* @param[in] bCloseDB Passed in to GetDoc()->UpdateFields. [TODO] Purpose???
|
2012-06-21 13:20:06 +02:00
|
|
|
*/
|
2015-05-20 13:05:49 +02:00
|
|
|
void SwViewShell::UpdateFields(bool bCloseDB)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bCrsr = ISA(SwCrsrShell);
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell*>(this)->StartAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
StartAction();
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
GetDoc()->getIDocumentFieldsAccess().UpdateFields(0, bCloseDB);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( bCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell*>(this)->EndAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
EndAction();
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/** update all charts for which any table exists */
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::UpdateAllCharts()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
// Start-/EndAction handled in the SwDoc-Method!
|
|
|
|
GetDoc()->UpdateAllCharts();
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::HasCharts() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwNodeIndex aIdx( *GetDoc()->GetNodes().GetEndOfAutotext().
|
|
|
|
StartOfSectionNode(), 1 );
|
2014-01-24 13:37:56 +00:00
|
|
|
while (aIdx.GetNode().GetStartNode())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-10-15 23:31:02 +02:00
|
|
|
++aIdx;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwOLENode *pNd = aIdx.GetNode().GetOLENode();
|
2015-05-20 13:05:49 +02:00
|
|
|
if( pNd && !pNd->GetChartTableName().isEmpty() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::LayoutIdle()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( !mpOpt->IsIdle() || !GetWin() ||
|
2000-09-18 23:08:29 +00:00
|
|
|
( Imp()->HasDrawView() && Imp()->GetDrawView()->IsDragObj() ) )
|
|
|
|
return;
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//No idle when printing is going on.
|
2014-12-03 19:04:05 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
|
|
|
{
|
|
|
|
if ( !rSh.GetWin() )
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
2014-12-03 19:04:05 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
2013-08-06 14:55:26 +02:00
|
|
|
// If Test5 has been set, the IdleFormatter is disabled.
|
2013-02-23 12:33:14 +01:00
|
|
|
if( mpOpt->IsTest5() )
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//Prepare and recover cache, so that it will not get fouled.
|
2015-05-20 13:05:49 +02:00
|
|
|
SwSaveSetLRUOfst aSave( *SwTextFrm::GetTextCache(),
|
|
|
|
SwTextFrm::GetTextCache()->GetCurMax() - 50 );
|
2012-05-31 17:59:17 +01:00
|
|
|
// #125243# there are lots of stacktraces indicating that Imp() returns NULL
|
2013-10-26 19:50:13 +02:00
|
|
|
// this SwViewShell seems to be invalid - but it's not clear why
|
2012-05-31 17:59:17 +01:00
|
|
|
// this return is only a workaround!
|
2013-10-26 19:50:13 +02:00
|
|
|
OSL_ENSURE(Imp(), "SwViewShell already deleted?");
|
2005-11-10 14:57:06 +00:00
|
|
|
if(!Imp())
|
|
|
|
return;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwLayIdle aIdle( GetLayout(), Imp() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
static void lcl_InvalidateAllContent( SwViewShell& rSh, sal_uInt8 nInv )
|
2003-10-15 08:58:59 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bCrsr = rSh.ISA(SwCrsrShell);
|
2003-10-15 08:58:59 +00:00
|
|
|
if ( bCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell&>(rSh).StartAction();
|
2003-10-15 08:58:59 +00:00
|
|
|
else
|
|
|
|
rSh.StartAction();
|
2015-05-20 13:05:49 +02:00
|
|
|
rSh.GetLayout()->InvalidateAllContent( nInv );
|
2003-10-15 08:58:59 +00:00
|
|
|
if ( bCrsr )
|
2014-11-24 10:39:39 +02:00
|
|
|
static_cast<SwCrsrShell&>(rSh).EndAction();
|
2003-10-15 08:58:59 +00:00
|
|
|
else
|
|
|
|
rSh.EndAction();
|
|
|
|
|
2014-08-01 17:09:54 +02:00
|
|
|
rSh.GetDoc()->getIDocumentState().SetModified();
|
2003-10-15 08:58:59 +00:00
|
|
|
}
|
|
|
|
|
2004-03-31 14:10:49 +00:00
|
|
|
/** local method to invalidate/re-calculate positions of floating screen
|
2012-06-21 13:20:06 +02:00
|
|
|
* objects (Writer fly frame and drawing objects), which are anchored
|
|
|
|
* to paragraph or to character. #i11860#
|
|
|
|
*/
|
2013-10-26 19:50:13 +02:00
|
|
|
static void lcl_InvalidateAllObjPos( SwViewShell &_rSh )
|
2004-03-31 14:10:49 +00:00
|
|
|
{
|
|
|
|
const bool bIsCrsrShell = _rSh.ISA(SwCrsrShell);
|
|
|
|
if ( bIsCrsrShell )
|
|
|
|
static_cast<SwCrsrShell&>(_rSh).StartAction();
|
|
|
|
else
|
|
|
|
_rSh.StartAction();
|
|
|
|
|
|
|
|
_rSh.GetLayout()->InvalidateAllObjPos();
|
|
|
|
|
|
|
|
if ( bIsCrsrShell )
|
|
|
|
static_cast<SwCrsrShell&>(_rSh).EndAction();
|
|
|
|
else
|
|
|
|
_rSh.EndAction();
|
|
|
|
|
2014-08-01 17:09:54 +02:00
|
|
|
_rSh.GetDoc()->getIDocumentState().SetModified();
|
2004-03-31 14:10:49 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetParaSpaceMax( bool bNew )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if( pIDSA->get(DocumentSettingId::PARA_SPACE_MAX) != bNew )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::PARA_SPACE_MAX, bNew );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetParaSpaceMaxAtPages( bool bNew )
|
2001-05-03 09:14:42 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if( pIDSA->get(DocumentSettingId::PARA_SPACE_MAX_AT_PAGES) != bNew )
|
2006-08-14 15:59:17 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::PARA_SPACE_MAX_AT_PAGES, bNew );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2006-08-14 15:59:17 +00:00
|
|
|
}
|
2001-05-03 09:14:42 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetTabCompat( bool bNew )
|
2001-05-03 09:14:42 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if( pIDSA->get(DocumentSettingId::TAB_COMPAT) != bNew )
|
2001-05-03 09:14:42 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::TAB_COMPAT, bNew );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2008-01-10 11:31:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetAddExtLeading( bool bNew )
|
2003-10-15 08:58:59 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::ADD_EXT_LEADING) != bNew )
|
2003-10-15 08:58:59 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::ADD_EXT_LEADING, bNew );
|
2014-06-05 08:44:38 +00:00
|
|
|
SwDrawModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
|
2006-08-14 15:59:17 +00:00
|
|
|
if ( pTmpDrawModel )
|
|
|
|
pTmpDrawModel->SetAddExtLeading( bNew );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2003-10-15 08:58:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetUseVirDev( bool bNewVirtual )
|
2003-10-15 08:58:59 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::USE_VIRTUAL_DEVICE) != bNewVirtual )
|
2006-08-14 15:59:17 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2006-08-14 15:59:17 +00:00
|
|
|
// this sets the flag at the document and calls PrtDataChanged
|
|
|
|
IDocumentDeviceAccess* pIDDA = getIDocumentDeviceAccess();
|
|
|
|
pIDDA->setReferenceDeviceType( bNewVirtual, true );
|
|
|
|
}
|
2004-03-23 10:26:32 +00:00
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/** Sets if paragraph and table spacing is added at bottom of table cells.
|
|
|
|
* #106629#
|
|
|
|
* @param[in] (bool) setting of the new value
|
|
|
|
*/
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells )
|
2004-03-23 10:26:32 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells )
|
2004-03-23 10:26:32 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2004-03-23 10:26:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/**
|
|
|
|
* Sets if former formatting of text lines with proportional line spacing should used.
|
|
|
|
* #i11859#
|
|
|
|
* @param[in] (bool) setting of the new value
|
|
|
|
*/
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
|
2004-02-26 16:01:29 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::OLD_LINE_SPACING) != _bUseFormerLineSpacing )
|
2004-02-26 16:01:29 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::OLD_LINE_SPACING, _bUseFormerLineSpacing );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2004-02-26 16:01:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/**
|
|
|
|
* Sets IDocumentSettingAccess if former object positioning should be used.
|
|
|
|
* #i11860#
|
|
|
|
* @param[in] (bool) setting the new value
|
|
|
|
*/
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
|
2004-03-31 14:10:49 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::USE_FORMER_OBJECT_POS) != _bUseFormerObjPos )
|
2004-03-31 14:10:49 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::USE_FORMER_OBJECT_POS, _bUseFormerObjPos );
|
2004-03-31 14:10:49 +00:00
|
|
|
lcl_InvalidateAllObjPos( *this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
// #i28701#
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
|
2004-08-02 13:19:04 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) != _bConsiderWrapOnObjPos )
|
2004-08-02 13:19:04 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION, _bConsiderWrapOnObjPos );
|
2004-08-02 13:19:04 +00:00
|
|
|
lcl_InvalidateAllObjPos( *this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
|
2004-05-11 10:28:41 +00:00
|
|
|
{
|
2006-08-14 15:59:17 +00:00
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) != _bUseFormerTextWrapping )
|
2004-05-11 10:28:41 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::USE_FORMER_TEXT_WRAPPING, _bUseFormerTextWrapping );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2004-05-11 10:28:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
// #i45491#
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak )
|
2007-07-10 13:59:22 +00:00
|
|
|
{
|
|
|
|
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
|
2015-03-11 15:04:54 +02:00
|
|
|
if ( pIDSA->get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK) != _bDoNotJustifyLinesWithManualBreak )
|
2007-07-10 13:59:22 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2015-03-11 15:04:54 +02:00
|
|
|
pIDSA->set(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, _bDoNotJustifyLinesWithManualBreak );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
|
2015-05-20 13:05:49 +02:00
|
|
|
lcl_InvalidateAllContent( *this, nInv );
|
2007-07-10 13:59:22 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::Reformat()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
// we go for safe: get rid of the old font information,
|
|
|
|
// when the printer resolution or zoom factor changes.
|
|
|
|
// Init() and Reformat() are the safest locations.
|
2000-09-18 23:08:29 +00:00
|
|
|
pFntCache->Flush( );
|
|
|
|
|
2002-06-17 13:37:29 +00:00
|
|
|
if( GetLayout()->IsCallbackActionEnabled() )
|
|
|
|
{
|
|
|
|
|
|
|
|
StartAction();
|
2015-05-20 13:05:49 +02:00
|
|
|
GetLayout()->InvalidateAllContent( INV_SIZE | INV_POS | INV_PRTAREA );
|
2002-06-17 13:37:29 +00:00
|
|
|
EndAction();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ChgNumberDigits()
|
2013-05-05 20:00:24 +02:00
|
|
|
{
|
|
|
|
SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
|
|
|
|
if ( pTmpDrawModel )
|
|
|
|
pTmpDrawModel->ReformatAllTextObjects();
|
|
|
|
Reformat();
|
|
|
|
}
|
2012-05-31 17:59:17 +01:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::CalcLayout()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-05-06 22:12:21 +02:00
|
|
|
// extremely likely to be a Bad Idea to call this without StartAction
|
|
|
|
// (except the Page Preview apparently only has a non-subclassed ViewShell)
|
|
|
|
assert((typeid(*this) == typeid(SwViewShell)) || mnStartAction);
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SET_CURR_SHELL( this );
|
2014-01-16 07:33:02 +09:00
|
|
|
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//prepare and recover cache, so that it will not get fouled.
|
2015-05-20 13:05:49 +02:00
|
|
|
SwSaveSetLRUOfst aSaveLRU( *SwTextFrm::GetTextCache(),
|
|
|
|
SwTextFrm::GetTextCache()->GetCurMax() - 50 );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//switch on Progress when none is running yet.
|
2012-12-17 18:12:09 +09:00
|
|
|
const bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bEndProgress )
|
|
|
|
{
|
2015-05-04 08:02:47 +02:00
|
|
|
long nEndPage = GetLayout()->GetPageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
nEndPage += nEndPage * 10 / 100;
|
|
|
|
::StartProgress( STR_STATSTR_REFORMAT, 0, nEndPage, GetDoc()->GetDocShell() );
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLayAction aAction( GetLayout(), Imp() );
|
2014-04-25 14:00:35 +02:00
|
|
|
aAction.SetPaint( false );
|
|
|
|
aAction.SetStatBar( true );
|
|
|
|
aAction.SetCalcLayout( true );
|
|
|
|
aAction.SetReschedule( true );
|
2015-05-20 13:05:49 +02:00
|
|
|
GetDoc()->getIDocumentFieldsAccess().LockExpFields();
|
2000-09-18 23:08:29 +00:00
|
|
|
aAction.Action();
|
2015-05-20 13:05:49 +02:00
|
|
|
GetDoc()->getIDocumentFieldsAccess().UnlockExpFields();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
//the SetNewFieldLst() on the Doc was cut off and must be fetched again
|
2013-02-08 19:32:39 +01:00
|
|
|
//(see flowfrm.cxx, txtfld.cxx)
|
2015-05-20 13:05:49 +02:00
|
|
|
if ( aAction.IsExpFields() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
aAction.Reset();
|
2014-04-25 14:00:35 +02:00
|
|
|
aAction.SetPaint( false );
|
|
|
|
aAction.SetStatBar( true );
|
|
|
|
aAction.SetReschedule( true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
SwDocPosUpdate aMsgHint( 0 );
|
|
|
|
GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint );
|
|
|
|
GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(NULL, true);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
aAction.Action();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( VisArea().HasArea() )
|
|
|
|
InvalidateWindows( VisArea() );
|
|
|
|
if ( bEndProgress )
|
|
|
|
::EndProgress( GetDoc()->GetDocShell() );
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetFirstVisPageInvalid()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-12-03 19:04:55 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
2011-05-11 13:51:16 +02:00
|
|
|
{
|
2014-12-03 19:04:55 +01:00
|
|
|
if ( rSh.Imp() )
|
|
|
|
rSh.Imp()->SetFirstVisPageInvalid();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SizeChgNotify()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( !mpWin )
|
2014-04-25 14:00:35 +02:00
|
|
|
mbDocSizeChgd = true;
|
2013-02-23 12:33:14 +01:00
|
|
|
else if( ActionPend() || Imp()->IsCalcLayoutProgress() || mbPaintInProgress )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mbDocSizeChgd = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( !Imp()->IsCalcLayoutProgress() && ISA( SwCrsrShell ) )
|
|
|
|
{
|
2014-11-24 10:39:39 +02:00
|
|
|
const SwFrm *pCnt = static_cast<SwCrsrShell*>(this)->GetCurrFrm( false );
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwPageFrm *pPage;
|
|
|
|
if ( pCnt && 0 != (pPage = pCnt->FindPageFrm()) )
|
|
|
|
{
|
2014-05-01 21:49:52 +02:00
|
|
|
const sal_uInt16 nVirtNum = pPage->GetVirtPageNum();
|
|
|
|
const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType();
|
2013-10-15 16:57:57 +02:00
|
|
|
OUString sDisplay = rNum.GetNumStr( nVirtNum );
|
2000-09-18 23:08:29 +00:00
|
|
|
PageNumNotify( this, pCnt->GetPhyPageNum(), nVirtNum, sDisplay );
|
2015-05-27 17:12:00 +02:00
|
|
|
|
|
|
|
if (isTiledRendering())
|
|
|
|
{
|
|
|
|
Size aDocSize = GetDocSize();
|
|
|
|
std::stringstream ss;
|
|
|
|
ss << aDocSize.Width() + 2L * DOCUMENTBORDER << ", " << aDocSize.Height() + 2L * DOCUMENTBORDER;
|
|
|
|
OString sRect = ss.str().c_str();
|
|
|
|
libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mbDocSizeChgd = false;
|
2008-02-19 12:50:15 +00:00
|
|
|
::SizeNotify( this, GetDocSize() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::VisPortChgd( const SwRect &rRect)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetWin(), "VisPortChgd ohne Window." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( rRect == VisArea() )
|
|
|
|
return;
|
|
|
|
|
2014-10-28 11:55:05 +01:00
|
|
|
// Is someone spuriously rescheduling again?
|
|
|
|
SAL_WARN_IF(mbInEndAction, "sw.core", "Scrolling during EndAction");
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//First get the old visible page, so we don't have to look
|
|
|
|
//for it afterwards.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrm *pOldPage = Imp()->GetFirstVisPage();
|
|
|
|
|
|
|
|
const SwRect aPrevArea( VisArea() );
|
2014-04-25 14:00:35 +02:00
|
|
|
const bool bFull = aPrevArea.IsEmpty();
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea = rRect;
|
2000-09-18 23:08:29 +00:00
|
|
|
SetFirstVisPageInvalid();
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//When there a PaintRegion still exists and the VisArea has changed,
|
|
|
|
//the PaintRegion is at least by now obsolete. The PaintRegion can
|
|
|
|
//have been created by RootFrm::Paint.
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( !mbInEndAction &&
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
2008-02-19 12:50:15 +00:00
|
|
|
bool bScrolled = false;
|
2008-03-07 14:00:41 +00:00
|
|
|
|
|
|
|
SwPostItMgr* pPostItMgr = GetPostItMgr();
|
2008-02-19 12:50:15 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bFull )
|
|
|
|
GetWin()->Invalidate();
|
|
|
|
else
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//Calculate amount to be scrolled.
|
2000-09-18 23:08:29 +00:00
|
|
|
const long nXDiff = aPrevArea.Left() - VisArea().Left();
|
|
|
|
const long nYDiff = aPrevArea.Top() - VisArea().Top();
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
|
2000-09-18 23:08:29 +00:00
|
|
|
(!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
|
|
|
|
{
|
2013-08-06 14:55:26 +02:00
|
|
|
// If possible, don't scroll the application background
|
|
|
|
// (PaintDesktop). Also limit the left and right side of
|
|
|
|
// the scroll range to the pages.
|
2014-12-01 10:16:01 +02:00
|
|
|
const SwPageFrm *pPage = static_cast<SwPageFrm*>(GetLayout()->Lower());
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pPage->Frm().Top() > pOldPage->Frm().Top() )
|
2014-12-01 10:16:01 +02:00
|
|
|
pPage = static_cast<const SwPageFrm*>(pOldPage);
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aBoth( VisArea() );
|
|
|
|
aBoth.Union( aPrevArea );
|
|
|
|
const SwTwips nBottom = aBoth.Bottom();
|
2015-02-09 15:43:41 +01:00
|
|
|
SwTwips nMinLeft = SAL_MAX_INT32;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTwips nMaxRight= 0;
|
2008-03-07 14:00:41 +00:00
|
|
|
|
|
|
|
const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
|
|
|
|
|
|
|
|
while ( pPage && pPage->Frm().Top() <= nBottom )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-04-29 18:37:41 +02:00
|
|
|
SwRect aPageRect( pPage->GetBoundRect() );
|
2008-03-07 14:00:41 +00:00
|
|
|
if ( bBookMode )
|
|
|
|
{
|
|
|
|
const SwPageFrm& rFormatPage = static_cast<const SwPageFrm*>(pPage)->GetFormatPage();
|
2011-04-29 18:37:41 +02:00
|
|
|
aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
|
2008-03-07 14:00:41 +00:00
|
|
|
}
|
|
|
|
|
2013-05-05 20:00:24 +02:00
|
|
|
// OD 12.02.2003 #i9719#, #105645# - consider new border and shadow width
|
2008-03-07 14:00:41 +00:00
|
|
|
if ( aPageRect.IsOver( aBoth ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-02-19 12:50:15 +00:00
|
|
|
SwTwips nPageLeft = 0;
|
|
|
|
SwTwips nPageRight = 0;
|
2011-04-23 12:46:08 +02:00
|
|
|
const sw::sidebarwindows::SidebarPosition aSidebarPos = pPage->SidebarPosition();
|
|
|
|
|
2015-03-12 08:33:40 +02:00
|
|
|
if( aSidebarPos != sw::sidebarwindows::SidebarPosition::NONE )
|
2008-02-19 12:50:15 +00:00
|
|
|
{
|
2011-04-29 18:37:41 +02:00
|
|
|
nPageLeft = aPageRect.Left();
|
|
|
|
nPageRight = aPageRect.Right();
|
2008-02-19 12:50:15 +00:00
|
|
|
}
|
2011-04-23 12:46:08 +02:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
if( nPageLeft < nMinLeft )
|
|
|
|
nMinLeft = nPageLeft;
|
2002-04-08 13:33:17 +00:00
|
|
|
if( nPageRight > nMaxRight )
|
|
|
|
nMaxRight = nPageRight;
|
2013-02-08 19:32:39 +01:00
|
|
|
//match with the draw objects
|
|
|
|
//take nOfst into account as the objects have been
|
|
|
|
//selected and have handles attached.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pPage->GetSortedObjs() )
|
|
|
|
{
|
|
|
|
const long nOfst = GetOut()->PixelToLogic(
|
|
|
|
Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width();
|
2014-08-28 21:51:04 +02:00
|
|
|
for ( size_t i = 0; i < pPage->GetSortedObjs()->size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-08-02 13:19:04 +00:00
|
|
|
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
|
2011-05-05 14:38:19 +02:00
|
|
|
// ignore objects that are not actually placed on the page
|
|
|
|
if (pObj->IsFormatPossible())
|
|
|
|
{
|
|
|
|
const Rectangle &rBound = pObj->GetObjRect().SVRect();
|
2015-01-13 10:02:57 +01:00
|
|
|
if (rBound.Left() != FAR_AWAY) {
|
|
|
|
// OD 03.03.2003 #107927# - use correct datatype
|
|
|
|
const SwTwips nL = std::max( 0L, rBound.Left() - nOfst );
|
|
|
|
if ( nL < nMinLeft )
|
|
|
|
nMinLeft = nL;
|
|
|
|
if( rBound.Right() + nOfst > nMaxRight )
|
|
|
|
nMaxRight = rBound.Right() + nOfst;
|
|
|
|
}
|
2011-05-05 14:38:19 +02:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-12-01 10:16:01 +02:00
|
|
|
pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
Rectangle aRect( aPrevArea.SVRect() );
|
|
|
|
aRect.Left() = nMinLeft;
|
|
|
|
aRect.Right() = nMaxRight;
|
2013-02-23 12:33:14 +01:00
|
|
|
if( VisArea().IsOver( aPrevArea ) && !mnLockPaint )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-02-19 12:50:15 +00:00
|
|
|
bScrolled = true;
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos() = aPrevArea.Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( SmoothScroll( nXDiff, nYDiff, &aRect ) )
|
|
|
|
return;
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos() = rRect.Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
GetWin()->Invalidate( aRect );
|
|
|
|
}
|
2013-02-23 12:33:14 +01:00
|
|
|
else if ( !mnLockPaint ) //will be released in Unlock
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( VisArea().IsOver( aPrevArea ) )
|
|
|
|
{
|
2008-02-19 12:50:15 +00:00
|
|
|
bScrolled = true;
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos() = aPrevArea.Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( SmoothScroll( nXDiff, nYDiff, 0 ) )
|
|
|
|
return;
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos() = rRect.Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
GetWin()->Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-05 09:54:27 +01:00
|
|
|
// When tiled rendering, the map mode of the window is disabled, avoid
|
|
|
|
// enabling it here.
|
|
|
|
if (!isTiledRendering())
|
|
|
|
{
|
|
|
|
Point aPt( VisArea().Pos() );
|
|
|
|
aPt.X() = -aPt.X(); aPt.Y() = -aPt.Y();
|
|
|
|
MapMode aMapMode( GetWin()->GetMapMode() );
|
|
|
|
aMapMode.SetOrigin( aPt );
|
|
|
|
GetWin()->SetMapMode( aMapMode );
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( HasDrawView() )
|
|
|
|
{
|
|
|
|
Imp()->GetDrawView()->VisAreaChanged( GetWin() );
|
|
|
|
Imp()->GetDrawView()->SetActualWin( GetWin() );
|
|
|
|
}
|
|
|
|
GetWin()->Update();
|
2002-02-20 17:14:14 +00:00
|
|
|
|
2013-05-05 20:15:21 +02:00
|
|
|
if ( pPostItMgr ) // #i88070#
|
2010-02-16 14:30:17 +01:00
|
|
|
{
|
|
|
|
pPostItMgr->Rescale();
|
|
|
|
pPostItMgr->CalcRects();
|
|
|
|
pPostItMgr->LayoutPostIts();
|
|
|
|
}
|
|
|
|
|
2008-05-20 17:54:49 +00:00
|
|
|
if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
|
2008-02-19 12:50:15 +00:00
|
|
|
pPostItMgr->CorrectPositions();
|
|
|
|
|
2002-02-20 17:14:14 +00:00
|
|
|
if( Imp()->IsAccessible() )
|
|
|
|
Imp()->UpdateAccessible();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-04-20 00:00:51 +03:00
|
|
|
#if !defined(MACOSX) && !defined(ANDROID) && !defined(IOS)
|
|
|
|
// #i98766# - disable smooth scrolling for Mac
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
const sal_uLong nColCnt = mpOut->GetColorCount();
|
2000-09-18 23:08:29 +00:00
|
|
|
long lMult = 1, lMax = LONG_MAX;
|
|
|
|
if ( nColCnt == 65536 )
|
|
|
|
{
|
|
|
|
lMax = 7000;
|
|
|
|
lMult = 2;
|
|
|
|
}
|
|
|
|
if ( nColCnt == 16777216 )
|
|
|
|
{
|
|
|
|
lMax = 5000;
|
|
|
|
lMult = 6;
|
|
|
|
}
|
|
|
|
else if ( nColCnt == 1 )
|
|
|
|
{
|
|
|
|
lMax = 3000;
|
|
|
|
lMult = 12;
|
|
|
|
}
|
|
|
|
|
2007-06-26 10:58:09 +00:00
|
|
|
// #i75172# isolated static conditions
|
2013-04-11 00:21:40 -03:00
|
|
|
const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax);
|
2015-05-26 10:16:39 +02:00
|
|
|
const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel().IsNull());
|
2013-02-23 12:33:14 +01:00
|
|
|
const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2013-04-19 23:10:49 +03:00
|
|
|
if(bSmoothScrollAllowed)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-02-26 23:33:08 +01:00
|
|
|
Imp()->bStopSmooth = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwRect aOldVis( VisArea() );
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//create virtual device and set.
|
2000-09-18 23:08:29 +00:00
|
|
|
const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
|
2015-03-31 21:06:51 +01:00
|
|
|
VclPtrInstance<VirtualDevice> pVout( *GetWin() );
|
2000-09-18 23:08:29 +00:00
|
|
|
pVout->SetLineColor( GetWin()->GetLineColor() );
|
|
|
|
pVout->SetFillColor( GetWin()->GetFillColor() );
|
|
|
|
MapMode aMapMode( GetWin()->GetMapMode() );
|
|
|
|
pVout->SetMapMode( aMapMode );
|
2013-04-11 00:21:40 -03:00
|
|
|
Size aSize( maVisArea.Width()+2*aPixSz.Width(), std::abs(lYDiff)+(2*aPixSz.Height()) );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pRect )
|
2013-04-11 00:21:40 -03:00
|
|
|
aSize.Width() = std::min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width());
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pVout->SetOutputSize( aSize ) )
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mnLockPaint++;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//First Paint everything in the virtual device.
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aRect( VisArea() );
|
|
|
|
aRect.Height( aSize.Height() );
|
|
|
|
if ( pRect )
|
|
|
|
{
|
2013-04-11 00:21:40 -03:00
|
|
|
aRect.Pos().X() = std::max(aRect.Left(),pRect->Left()-aPixSz.Width());
|
|
|
|
aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width()));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
aRect.SSize().Width() += 2*aPixSz.Width();
|
|
|
|
aRect.Pos().Y() = lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height()
|
|
|
|
: aRect.Top() - aSize.Height() + aPixSz.Height();
|
2013-04-11 00:21:40 -03:00
|
|
|
aRect.Pos().X() = std::max( 0L, aRect.Left()-aPixSz.Width() );
|
2000-09-18 23:08:29 +00:00
|
|
|
aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos()));
|
|
|
|
aRect.SSize()= GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize()));
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea = aRect;
|
2000-09-18 23:08:29 +00:00
|
|
|
const Point aPt( -aRect.Left(), -aRect.Top() );
|
|
|
|
aMapMode.SetOrigin( aPt );
|
|
|
|
pVout->SetMapMode( aMapMode );
|
2013-02-23 12:33:14 +01:00
|
|
|
OutputDevice *pOld = mpOut;
|
2015-03-20 14:59:22 +02:00
|
|
|
mpOut = pVout.get();
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
// #i75172# To get a clean repaint, a new ObjectContact is needed here. Without, the
|
|
|
|
// repaint would not be correct since it would use the wrong DrawPage visible region.
|
|
|
|
// This repaint IS about painting something currently outside the visible part (!).
|
|
|
|
// For that purpose, AddWindowToPaintView is used which creates a new SdrPageViewWindow
|
|
|
|
// and all the necessary stuff. It's not cheap, but necessary here. Alone because repaint
|
|
|
|
// target really is NOT the current window.
|
|
|
|
// Also will automatically NOT use PreRendering and overlay (since target is VirtualDevice)
|
|
|
|
if(!HasDrawView())
|
|
|
|
MakeDrawView();
|
|
|
|
SdrView* pDrawView = GetDrawView();
|
|
|
|
pDrawView->AddWindowToPaintView(pVout);
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
// clear mpWin during DLPrePaint2 to get paint preparation for mpOut, but set it again
|
2007-06-26 10:58:09 +00:00
|
|
|
// immediately afterwards. There are many decisions in SW which imply that Printing
|
2013-02-23 12:33:14 +01:00
|
|
|
// is used when mpWin == 0 (wrong but widely used).
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window* pOldWin = mpWin;
|
2013-02-23 12:33:14 +01:00
|
|
|
mpWin = 0;
|
2014-09-27 14:52:40 +02:00
|
|
|
DLPrePaint2(vcl::Region(aRect.SVRect()));
|
2013-02-23 12:33:14 +01:00
|
|
|
mpWin = pOldWin;
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// SW paint stuff
|
2015-05-23 18:49:16 +09:00
|
|
|
PaintDesktop(*GetOut(), aRect);
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = true;
|
2007-06-26 10:58:09 +00:00
|
|
|
GetLayout()->Paint( aRect );
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = false;
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// end paint and destroy ObjectContact again
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2007-06-26 10:58:09 +00:00
|
|
|
pDrawView->DeleteWindowFromPaintView(pVout);
|
|
|
|
}
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOut = pOld;
|
|
|
|
maVisArea = aOldVis;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//Now shift in parts and copy the new Pixel from the virtual device.
|
2012-05-31 17:59:17 +01:00
|
|
|
|
|
|
|
// ??????????????????????
|
|
|
|
// or is it better to get the scrollfactor from the User
|
|
|
|
// as option?
|
|
|
|
// ??????????????????????
|
2000-09-18 23:08:29 +00:00
|
|
|
long lMaDelta = aPixSz.Height();
|
2013-04-11 00:21:40 -03:00
|
|
|
if ( std::abs(lYDiff) > ( maVisArea.Height() / 3 ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
lMaDelta *= 6;
|
|
|
|
else
|
|
|
|
lMaDelta *= 2;
|
|
|
|
|
|
|
|
lMaDelta *= lMult;
|
|
|
|
|
|
|
|
if ( lYDiff < 0 )
|
|
|
|
lMaDelta = -lMaDelta;
|
|
|
|
|
|
|
|
long lDiff = lYDiff;
|
|
|
|
while ( lDiff )
|
|
|
|
{
|
|
|
|
long lScroll;
|
2013-04-11 00:21:40 -03:00
|
|
|
if ( Imp()->bStopSmooth || std::abs(lDiff) <= std::abs(lMaDelta) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
lScroll = lDiff;
|
|
|
|
lDiff = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
lScroll = lMaDelta;
|
|
|
|
lDiff -= lMaDelta;
|
|
|
|
}
|
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
const SwRect aTmpOldVis = VisArea();
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos().Y() -= lScroll;
|
|
|
|
maVisArea.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( VisArea().Pos()));
|
2007-09-27 08:43:09 +00:00
|
|
|
lScroll = aTmpOldVis.Top() - VisArea().Top();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pRect )
|
|
|
|
{
|
2007-09-27 08:43:09 +00:00
|
|
|
Rectangle aTmp( aTmpOldVis.SVRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
aTmp.Left() = pRect->Left();
|
|
|
|
aTmp.Right()= pRect->Right();
|
2015-05-26 08:29:52 +02:00
|
|
|
GetWin()->Scroll( 0, lScroll, aTmp, ScrollFlags::Children);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2015-05-26 08:29:52 +02:00
|
|
|
GetWin()->Scroll( 0, lScroll, ScrollFlags::Children );
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
const Point aTmpPt( -VisArea().Left(), -VisArea().Top() );
|
|
|
|
MapMode aTmpMapMode( GetWin()->GetMapMode() );
|
|
|
|
aTmpMapMode.SetOrigin( aTmpPt );
|
|
|
|
GetWin()->SetMapMode( aTmpMapMode );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
Imp()->GetDrawView()->VisAreaChanged( GetWin() );
|
|
|
|
|
|
|
|
SetFirstVisPageInvalid();
|
|
|
|
if ( !Imp()->bStopSmooth )
|
|
|
|
{
|
2007-06-26 10:58:09 +00:00
|
|
|
const bool bScrollDirectionIsUp(lScroll > 0);
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->aSmoothRect = VisArea();
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
if(bScrollDirectionIsUp)
|
|
|
|
{
|
|
|
|
Imp()->aSmoothRect.Bottom( VisArea().Top() + lScroll + aPixSz.Height());
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2007-06-26 10:58:09 +00:00
|
|
|
{
|
|
|
|
Imp()->aSmoothRect.Top( VisArea().Bottom() + lScroll - aPixSz.Height());
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-02-26 23:33:08 +01:00
|
|
|
Imp()->bSmoothUpdate = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
GetWin()->Update();
|
2014-02-26 23:33:08 +01:00
|
|
|
Imp()->bSmoothUpdate = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2007-06-26 10:58:09 +00:00
|
|
|
if(!Imp()->bStopSmooth)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-06-26 10:58:09 +00:00
|
|
|
// start paint on logic base
|
|
|
|
const Rectangle aTargetLogic(Imp()->aSmoothRect.SVRect());
|
2014-09-27 14:52:40 +02:00
|
|
|
DLPrePaint2(vcl::Region(aTargetLogic));
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// get target rectangle in discrete pixels
|
|
|
|
OutputDevice& rTargetDevice = mpTargetPaintWindow->GetTargetOutputDevice();
|
|
|
|
const Rectangle aTargetPixel(rTargetDevice.LogicToPixel(aTargetLogic));
|
|
|
|
|
|
|
|
// get source top-left in discrete pixels
|
|
|
|
const Point aSourceTopLeft(pVout->LogicToPixel(aTargetLogic.TopLeft()));
|
|
|
|
|
|
|
|
// switch off MapModes
|
|
|
|
const bool bMapModeWasEnabledDest(rTargetDevice.IsMapModeEnabled());
|
|
|
|
const bool bMapModeWasEnabledSource(pVout->IsMapModeEnabled());
|
|
|
|
rTargetDevice.EnableMapMode(false);
|
|
|
|
pVout->EnableMapMode(false);
|
|
|
|
|
|
|
|
rTargetDevice.DrawOutDev(
|
|
|
|
aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
|
|
|
|
aSourceTopLeft, aTargetPixel.GetSize(), // source
|
|
|
|
*pVout);
|
|
|
|
|
|
|
|
// restore MapModes
|
|
|
|
rTargetDevice.EnableMapMode(bMapModeWasEnabledDest);
|
|
|
|
pVout->EnableMapMode(bMapModeWasEnabledSource);
|
|
|
|
|
|
|
|
// end paint on logoc base
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnLockPaint;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2015-03-20 14:59:22 +02:00
|
|
|
pVout.disposeAndClear();
|
2000-09-18 23:08:29 +00:00
|
|
|
GetWin()->Update();
|
|
|
|
if ( !Imp()->bStopSmooth )
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnLockPaint;
|
2000-09-18 23:08:29 +00:00
|
|
|
SetFirstVisPageInvalid();
|
2014-04-25 14:00:35 +02:00
|
|
|
return true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2015-03-20 14:59:22 +02:00
|
|
|
pVout.disposeAndClear();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2013-04-19 23:10:49 +03:00
|
|
|
#endif
|
2006-08-14 15:59:17 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
maVisArea.Pos().X() -= lXDiff;
|
|
|
|
maVisArea.Pos().Y() -= lYDiff;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pRect )
|
2015-05-26 08:29:52 +02:00
|
|
|
GetWin()->Scroll( lXDiff, lYDiff, *pRect, ScrollFlags::Children);
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2015-05-26 08:29:52 +02:00
|
|
|
GetWin()->Scroll( lXDiff, lYDiff, ScrollFlags::Children);
|
2014-04-25 14:00:35 +02:00
|
|
|
return false;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2015-05-23 18:49:16 +09:00
|
|
|
void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect &rRect)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
|
2013-02-08 19:32:39 +01:00
|
|
|
return; //for the printer we don't do anything here.
|
2012-05-31 17:59:17 +01:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//Catch exceptions, so that it doesn't look so surprising.
|
|
|
|
//Can e.g. happen during Idle.
|
|
|
|
//Unfortunately we must at any rate Paint the rectangles next to the pages,
|
2013-08-06 14:55:26 +02:00
|
|
|
//as these are not painted at VisPortChgd.
|
2012-12-17 18:12:09 +09:00
|
|
|
bool bBorderOnly = false;
|
2013-10-22 15:14:13 +03:00
|
|
|
const SwRootFrm *pRoot = GetLayout();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( rRect.Top() > pRoot->Frm().Bottom() )
|
|
|
|
{
|
|
|
|
const SwFrm *pPg = pRoot->Lower();
|
|
|
|
while ( pPg && pPg->GetNext() )
|
|
|
|
pPg = pPg->GetNext();
|
|
|
|
if ( !pPg || !pPg->Frm().IsOver( VisArea() ) )
|
2012-12-17 18:12:09 +09:00
|
|
|
bBorderOnly = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2008-03-07 14:00:41 +00:00
|
|
|
const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRegionRects aRegion( rRect );
|
|
|
|
|
2012-05-31 17:59:17 +01:00
|
|
|
//mod #i6193: remove sidebar area to avoid flickering
|
2008-03-07 14:00:41 +00:00
|
|
|
const SwPostItMgr* pPostItMgr = GetPostItMgr();
|
|
|
|
const SwTwips nSidebarWidth = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ?
|
|
|
|
pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() :
|
|
|
|
0;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bBorderOnly )
|
|
|
|
{
|
2013-10-22 15:14:13 +03:00
|
|
|
const SwFrm *pPage =pRoot->Lower();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aLeft( rRect ), aRight( rRect );
|
|
|
|
while ( pPage )
|
|
|
|
{
|
|
|
|
long nTmp = pPage->Frm().Left();
|
|
|
|
if ( nTmp < aLeft.Right() )
|
|
|
|
aLeft.Right( nTmp );
|
|
|
|
nTmp = pPage->Frm().Right();
|
|
|
|
if ( nTmp > aRight.Left() )
|
2008-02-19 12:50:15 +00:00
|
|
|
{
|
2008-03-07 14:00:41 +00:00
|
|
|
aRight.Left( nTmp + nSidebarWidth );
|
2008-02-19 12:50:15 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
pPage = pPage->GetNext();
|
|
|
|
}
|
2012-07-20 12:08:29 +02:00
|
|
|
aRegion.clear();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aLeft.HasArea() )
|
2012-07-20 12:08:29 +02:00
|
|
|
aRegion.push_back( aLeft );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aRight.HasArea() )
|
2012-07-20 12:08:29 +02:00
|
|
|
aRegion.push_back( aRight );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwFrm *pPage = Imp()->GetFirstVisPage();
|
2015-05-07 01:53:33 +02:00
|
|
|
//Here we have to get the previous page since
|
|
|
|
//GetFirstVisPage return the current one but
|
|
|
|
//there is a portion of the previous page
|
|
|
|
//which is still visible
|
|
|
|
if ( pPage->GetPrev() )
|
|
|
|
pPage = pPage->GetPrev();
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwTwips nBottom = rRect.Bottom();
|
2012-07-20 12:08:29 +02:00
|
|
|
while ( pPage && !aRegion.empty() &&
|
2013-02-08 19:32:39 +01:00
|
|
|
(pPage->Frm().Top() <= nBottom) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-03-07 14:00:41 +00:00
|
|
|
SwRect aPageRect( pPage->Frm() );
|
|
|
|
if ( bBookMode )
|
|
|
|
{
|
|
|
|
const SwPageFrm& rFormatPage = static_cast<const SwPageFrm*>(pPage)->GetFormatPage();
|
|
|
|
aPageRect.SSize() = rFormatPage.Frm().SSize();
|
|
|
|
}
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
const bool bSidebarRight =
|
2015-03-12 08:33:40 +02:00
|
|
|
static_cast<const SwPageFrm*>(pPage)->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT;
|
2008-03-07 14:00:41 +00:00
|
|
|
aPageRect.Pos().X() -= bSidebarRight ? 0 : nSidebarWidth;
|
|
|
|
aPageRect.SSize().Width() += nSidebarWidth;
|
|
|
|
|
|
|
|
if ( aPageRect.IsOver( rRect ) )
|
|
|
|
aRegion -= aPageRect;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
pPage = pPage->GetNext();
|
|
|
|
}
|
|
|
|
}
|
2012-07-20 12:08:29 +02:00
|
|
|
if ( !aRegion.empty() )
|
2015-05-23 18:49:16 +09:00
|
|
|
_PaintDesktop(rRenderContext, aRegion);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-16 16:36:45 +02:00
|
|
|
// PaintDesktop is split in two, this part is also used by PreviewPage
|
2015-05-23 18:49:16 +09:00
|
|
|
void SwViewShell::_PaintDesktop(vcl::RenderContext& /*rRenderContext*/, const SwRegionRects &rRegion)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-05-31 17:59:17 +01:00
|
|
|
// OD 2004-04-23 #116347#
|
2014-10-06 14:48:16 +02:00
|
|
|
GetOut()->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
|
2004-05-03 13:24:37 +00:00
|
|
|
GetOut()->SetLineColor();
|
2006-11-14 14:13:03 +00:00
|
|
|
|
2015-05-04 08:02:47 +02:00
|
|
|
for ( auto &rRgn : rRegion )
|
2006-11-14 14:13:03 +00:00
|
|
|
{
|
2015-05-04 08:02:47 +02:00
|
|
|
const Rectangle aRectangle(rRgn.SVRect());
|
2006-11-14 14:13:03 +00:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// #i93170#
|
|
|
|
// Here we have a real Problem. On the one hand we have the buffering for paint
|
|
|
|
// and overlay which needs an embracing pair of DLPrePaint2/DLPostPaint2 calls,
|
|
|
|
// on the other hand the MapMode is not set correctly when this code is executed.
|
|
|
|
// This is done in the users of this method, for each SWpage before painting it.
|
|
|
|
// Since the MapMode is not correct here, the call to DLPostPaint2 will paint
|
|
|
|
// existing FormControls due to the current MapMode.
|
2014-02-25 21:01:20 +01:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// There are basically three solutions for this:
|
2014-02-25 21:01:20 +01:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// (1) Set the MapMode correct, move the background painting to the users of
|
|
|
|
// this code
|
2014-02-25 21:01:20 +01:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// (2) Do no DLPrePaint2/DLPostPaint2 here; no SdrObjects are allowed to lie in
|
|
|
|
// the desktop region. Disadvantage: the desktop will not be part of the
|
|
|
|
// buffers, e.g. overlay. Thus, as soon as overlay will be used over the
|
|
|
|
// desktop, it will not work.
|
2014-02-25 21:01:20 +01:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// (3) expand DLPostPaint2 with a flag to signal if FormControl paints shall
|
|
|
|
// be done or not
|
2014-02-25 21:01:20 +01:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
// Currently, (3) will be the best possible solution. It will keep overlay and
|
|
|
|
// buffering intact and work without MapMode for single pages. In the medium
|
|
|
|
// to long run, (1) will need to be used and the bool bPaintFormLayer needs
|
|
|
|
// to be removed again
|
|
|
|
|
2006-11-14 14:13:03 +00:00
|
|
|
// #i68597# inform Drawinglayer about display change
|
2014-09-27 14:52:40 +02:00
|
|
|
DLPrePaint2(vcl::Region(aRectangle));
|
2007-06-26 10:58:09 +00:00
|
|
|
|
|
|
|
// #i75172# needed to move line/Fill color setters into loop since DLPrePaint2
|
|
|
|
// may exchange GetOut(), that's it's purpose. This happens e.g. at print preview.
|
|
|
|
GetOut()->SetFillColor( SwViewOption::GetAppBackgroundColor());
|
|
|
|
GetOut()->SetLineColor();
|
2006-11-14 14:13:03 +00:00
|
|
|
GetOut()->DrawRect(aRectangle);
|
2007-06-26 10:58:09 +00:00
|
|
|
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(false);
|
2006-11-14 14:13:03 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
GetOut()->Pop();
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !GetWin() )
|
2014-04-25 14:00:35 +02:00
|
|
|
return false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwPageFrm *pPage = Imp()->GetFirstVisPage();
|
|
|
|
const SwTwips nBottom = VisArea().Bottom();
|
|
|
|
const SwTwips nRight = VisArea().Right();
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( !bRet && pPage && !((pPage->Frm().Top() > nBottom) ||
|
|
|
|
(pPage->Frm().Left() > nRight)))
|
|
|
|
{
|
|
|
|
if ( pPage->IsInvalid() || pPage->IsInvalidFly() )
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = true;
|
2014-12-01 10:16:01 +02:00
|
|
|
pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( bRet )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//Unfortunately Start/EndAction won't help here, as the Paint originated
|
|
|
|
//from GUI and so Clipping has been set against getting through.
|
|
|
|
//Ergo: do it all yourself (see ImplEndAction())
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea())
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwLayAction aAction( GetLayout(), Imp() );
|
2014-04-25 14:00:35 +02:00
|
|
|
aAction.SetComplete( false );
|
2001-12-12 09:54:00 +00:00
|
|
|
// We increment the action counter to avoid a recursive call of actions
|
|
|
|
// e.g. from a SwFEShell::RequestObjectResize(..) in bug 95829.
|
|
|
|
// A recursive call of actions is no good idea because the inner action
|
|
|
|
// can't format frames which are locked by the outer action. This may
|
|
|
|
// cause and endless loop.
|
2013-02-23 12:33:14 +01:00
|
|
|
++mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
aAction.Action();
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwRegionRects *pRegion = Imp()->GetRegion();
|
|
|
|
if ( pRegion && aAction.IsBrowseActionStop() )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//only of interest when something has changed in the visible range
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bStop = true;
|
2014-05-01 21:49:52 +02:00
|
|
|
for ( size_t i = 0; i < pRegion->size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwRect &rTmp = (*pRegion)[i];
|
2015-04-27 15:29:20 +02:00
|
|
|
if ( !(bStop = rTmp.IsOver( VisArea() )) )
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( bStop )
|
|
|
|
{
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
pRegion = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pRegion )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//First Invert then Compress, never the other way round!
|
2000-09-18 23:08:29 +00:00
|
|
|
pRegion->Invert();
|
|
|
|
pRegion->Compress();
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = false;
|
2012-07-20 12:08:29 +02:00
|
|
|
if ( !pRegion->empty() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwRegionRects aRegion( rRect );
|
2014-05-01 21:49:52 +02:00
|
|
|
for ( size_t i = 0; i < pRegion->size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ const SwRect &rTmp = (*pRegion)[i];
|
|
|
|
if ( !rRect.IsInside( rTmp ) )
|
|
|
|
{
|
|
|
|
InvalidateWindows( rTmp );
|
|
|
|
if ( rTmp.IsOver( VisArea() ) )
|
|
|
|
{ aRegion -= rTmp;
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( bRet )
|
|
|
|
{
|
2014-05-01 21:49:52 +02:00
|
|
|
for ( size_t i = 0; i < aRegion.size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
GetWin()->Invalidate( aRegion[i].SVRect() );
|
|
|
|
|
|
|
|
if ( rRect != VisArea() )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//rRect == VisArea is the special case for new or
|
|
|
|
//Shift-Ctrl-R, when it shouldn't be necessary to
|
|
|
|
//hold the rRect again in Document coordinates.
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( maInvalidRect.IsEmpty() )
|
|
|
|
maInvalidRect = rRect;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2013-02-23 12:33:14 +01:00
|
|
|
maInvalidRect.Union( rRect );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = false;
|
2009-12-29 09:19:13 +01:00
|
|
|
Imp()->DelRegion();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2014-04-25 14:00:35 +02:00
|
|
|
bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2015-05-23 18:49:16 +09:00
|
|
|
void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2015-05-23 18:49:16 +09:00
|
|
|
mpOut = &rRenderContext;
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mnLockPaint )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( Imp()->bSmoothUpdate )
|
|
|
|
{
|
|
|
|
SwRect aTmp( rRect );
|
|
|
|
if ( !Imp()->aSmoothRect.IsInside( aTmp ) )
|
2014-02-26 23:33:08 +01:00
|
|
|
Imp()->bStopSmooth = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
Imp()->aSmoothRect = aTmp;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( SwRootFrm::IsInPaint() )
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//During the publication of a page at printing the Paint is buffered.
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPaintQueue::Add( this, SwRect( rRect ) );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//With !nStartAction I try to protect me against erroneous code at other places.
|
|
|
|
//Hopefully it will not lead to problems!?
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mbPaintWorks && !mnStartAction )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( GetWin() && GetWin()->IsVisible() )
|
|
|
|
{
|
|
|
|
SwRect aRect( rRect );
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mbPaintInProgress ) //Guard against double Paints!
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
GetWin()->Invalidate( rRect );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
mbPaintInProgress = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
SET_CURR_SHELL( this );
|
2014-04-25 14:00:35 +02:00
|
|
|
SwRootFrm::SetNoVirDev( true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
//We don't want to Clip to and fro, we trust that all are limited
|
|
|
|
//to the rectangle and only need to calculate the clipping once.
|
|
|
|
//The ClipRect is removed here once and not recovered, as externally
|
|
|
|
//no one needs it anymore anyway.
|
|
|
|
//Not when we paint a Metafile.
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !GetOut()->GetConnectMetaFile() && GetOut()->IsClipRegion())
|
|
|
|
GetOut()->SetClipRegion();
|
|
|
|
|
2013-10-16 16:36:45 +02:00
|
|
|
if ( IsPreview() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-22 11:12:12 +01:00
|
|
|
//When useful, process or destroy the old InvalidRect.
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( aRect.IsInside( maInvalidRect ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
ResetInvalidRect();
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
GetLayout()->Paint( aRect );
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//When one of the visible pages still has anything entered for
|
|
|
|
//Repaint, Repaint must be triggered.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !CheckInvalidForPaint( aRect ) )
|
|
|
|
{
|
2012-05-31 17:59:17 +01:00
|
|
|
// --> OD 2009-08-12 #i101192#
|
|
|
|
// start Pre/PostPaint encapsulation to avoid screen blinking
|
2014-09-27 14:52:40 +02:00
|
|
|
const vcl::Region aRepaintRegion(aRect.SVRect());
|
2009-08-27 14:36:29 +00:00
|
|
|
DLPrePaint2(aRepaintRegion);
|
2010-10-01 21:57:36 +02:00
|
|
|
|
2012-05-31 17:59:17 +01:00
|
|
|
// <--
|
2015-05-23 18:49:16 +09:00
|
|
|
PaintDesktop(rRenderContext, aRect);
|
2010-10-01 21:57:36 +02:00
|
|
|
|
2013-02-22 11:12:12 +01:00
|
|
|
//When useful, process or destroy the old InvalidRect.
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( aRect.IsInside( maInvalidRect ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
ResetInvalidRect();
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
GetLayout()->Paint( aRect );
|
2014-04-25 14:00:35 +02:00
|
|
|
SwViewShell::mbLstAct = false;
|
2012-05-31 17:59:17 +01:00
|
|
|
// --> OD 2009-08-12 #i101192#
|
|
|
|
// end Pre/PostPaint encapsulation
|
2009-08-27 14:36:29 +00:00
|
|
|
DLPostPaint2(true);
|
2012-05-31 17:59:17 +01:00
|
|
|
// <--
|
2010-10-01 21:57:36 +02:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
SwRootFrm::SetNoVirDev( false );
|
|
|
|
mbPaintInProgress = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
UISizeNotify();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( maInvalidRect.IsEmpty() )
|
|
|
|
maInvalidRect = SwRect( rRect );
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2013-02-23 12:33:14 +01:00
|
|
|
maInvalidRect.Union( SwRect( rRect ) );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mbInEndAction && GetWin() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-09-27 14:52:40 +02:00
|
|
|
const vcl::Region aRegion(GetWin()->GetPaintRegion());
|
2012-10-23 12:46:28 +00:00
|
|
|
RectangleVector aRectangles;
|
|
|
|
aRegion.GetRegionRectangles(aRectangles);
|
|
|
|
|
2013-06-13 22:11:14 +02:00
|
|
|
for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
|
2012-10-23 12:46:28 +00:00
|
|
|
{
|
|
|
|
Imp()->AddPaintRect(*aRectIter);
|
|
|
|
}
|
|
|
|
|
|
|
|
//RegionHandle hHdl( aRegion.BeginEnumRects() );
|
|
|
|
//Rectangle aRect;
|
|
|
|
//while ( aRegion.GetEnumRects( hHdl, aRect ) )
|
|
|
|
// Imp()->AddPaintRect( aRect );
|
|
|
|
//aRegion.EndEnumRects( hHdl );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if ( SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) &&
|
|
|
|
GetOut() == GetWin() )
|
|
|
|
{
|
2007-01-22 14:11:13 +00:00
|
|
|
// #i68597#
|
2014-09-27 14:52:40 +02:00
|
|
|
const vcl::Region aDLRegion(rRect);
|
2007-01-22 14:11:13 +00:00
|
|
|
DLPrePaint2(aDLRegion);
|
|
|
|
|
2015-06-24 09:34:00 +02:00
|
|
|
rRenderContext.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
|
|
|
|
rRenderContext.SetFillColor( Imp()->GetRetoucheColor() );
|
|
|
|
rRenderContext.SetLineColor();
|
|
|
|
rRenderContext.DrawRect( rRect );
|
|
|
|
rRenderContext.Pop();
|
2007-01-22 14:11:13 +00:00
|
|
|
// #i68597#
|
2009-01-20 09:49:16 +00:00
|
|
|
DLPostPaint2(true);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-15 16:47:20 +01:00
|
|
|
void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight)
|
2013-10-23 11:44:22 +02:00
|
|
|
{
|
2013-11-15 16:47:20 +01:00
|
|
|
// SwViewShell's output device setup
|
2013-11-15 16:18:42 +01:00
|
|
|
// TODO clean up SwViewShell's approach to output devices (the many of
|
2015-03-04 14:41:56 +01:00
|
|
|
// them - mpBufferedOut, mpOut, mpWin, ...)
|
2013-11-15 16:18:42 +01:00
|
|
|
OutputDevice *pSaveOut = mpOut;
|
2015-03-04 14:41:56 +01:00
|
|
|
bool bTiledRendering = isTiledRendering();
|
|
|
|
setTiledRendering(true);
|
2015-01-23 18:38:55 +01:00
|
|
|
mbInLibreOfficeKitCallback = true;
|
2013-11-15 16:47:20 +01:00
|
|
|
mpOut = &rDevice;
|
|
|
|
|
iOS tiled rendering work
Possibly quite broken intermediate commit. But anyway, now it is
possible to render the tile diretly to a CGContext. Can be seen in
the MobileLibreOffice app when build in the Debug_tile_tester
configuration. See touch_lo_draw_tile() in viewsh.cxx. Unfortunately
the old plain LibreOffice test app is now broken, though, and
displays nothing at all.
This refactoring and hacking in vcl was done in a quite ugly fashion,
with ifdefs etc. But trust me, I did try, several times, for many
days, to get where I wanted in an elegant and clean fashion. But doing
it cleanly meant not being able to actually build it for days while
trying to figure ut which bits go where and which class should be
split into what base and derived class(es), and it was too much for my
limited brain capacity. I just couldn't juggle all the vcl class
structure in my head, especially as I don't have any good
understanding of the general design of it all.
Change-Id: Ia59d6a9cce15a63e63f94e8d8574bef21993fb1f
2013-12-09 21:53:23 +02:00
|
|
|
// resizes the virtual device so to contain the entrie context
|
|
|
|
rDevice.SetOutputSizePixel(Size(contextWidth, contextHeight));
|
|
|
|
|
2013-11-15 16:47:20 +01:00
|
|
|
// setup the output device to draw the tile
|
|
|
|
MapMode aMapMode(rDevice.GetMapMode());
|
|
|
|
aMapMode.SetMapUnit(MAP_TWIP);
|
|
|
|
aMapMode.SetOrigin(Point(-tilePosX, -tilePosY));
|
|
|
|
|
|
|
|
// Scaling. Must convert from pixels to twips. We know
|
2015-03-08 11:23:03 +01:00
|
|
|
// that VirtualDevices use a DPI of 96.
|
2014-10-23 17:41:47 +02:00
|
|
|
Fraction scaleX = Fraction(contextWidth, 96) * Fraction(1440L) / Fraction(tileWidth);
|
|
|
|
Fraction scaleY = Fraction(contextHeight, 96) * Fraction(1440L) / Fraction(tileHeight);
|
2013-11-15 16:47:20 +01:00
|
|
|
aMapMode.SetScaleX(scaleX);
|
|
|
|
aMapMode.SetScaleY(scaleY);
|
|
|
|
rDevice.SetMapMode(aMapMode);
|
2013-10-23 11:44:22 +02:00
|
|
|
|
2014-03-10 17:24:34 -07:00
|
|
|
// Update this device in DrawLayer
|
|
|
|
if (Imp()->GetDrawView())
|
|
|
|
{
|
|
|
|
Imp()->GetDrawView()->AddWindowToPaintView(&rDevice);
|
|
|
|
}
|
|
|
|
|
2014-07-24 21:38:12 +02:00
|
|
|
Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
|
|
|
|
rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
|
|
|
|
|
2014-07-24 21:15:49 +02:00
|
|
|
// Make the requested area visible -- we can't use MakeVisible as that will
|
|
|
|
// only scroll the contents, but won't zoom/resize if needed.
|
|
|
|
// Without this, items/text that are outside the visible area (in the SwView)
|
|
|
|
// won't be painted when rendering tiles (at least when using either the
|
|
|
|
// tiledrendering app, or the gtktiledviewer) -- although ultimately we
|
|
|
|
// probably want to fix things so that the SwView's area doesn't affect
|
|
|
|
// tiled rendering?
|
2014-07-24 21:38:12 +02:00
|
|
|
VisPortChgd(SwRect(aOutRect));
|
2013-11-15 16:47:20 +01:00
|
|
|
|
2015-04-08 10:05:18 +02:00
|
|
|
// Invoke SwLayAction if layout is not yet ready.
|
|
|
|
CheckInvalidForPaint(aOutRect);
|
|
|
|
|
2013-11-15 16:47:20 +01:00
|
|
|
// draw - works in logic coordinates
|
2015-05-23 18:49:16 +09:00
|
|
|
Paint(rDevice, aOutRect);
|
2013-11-15 16:47:20 +01:00
|
|
|
|
2014-03-10 17:24:34 -07:00
|
|
|
// Remove this device in DrawLayer
|
|
|
|
if (Imp()->GetDrawView())
|
|
|
|
{
|
|
|
|
Imp()->GetDrawView()->DeleteWindowFromPaintView(&rDevice);
|
|
|
|
}
|
|
|
|
|
2013-11-15 16:47:20 +01:00
|
|
|
// SwViewShell's output device tear down
|
2013-11-15 16:18:42 +01:00
|
|
|
mpOut = pSaveOut;
|
2015-01-23 18:38:55 +01:00
|
|
|
mbInLibreOfficeKitCallback = false;
|
2015-03-04 14:41:56 +01:00
|
|
|
setTiledRendering(bTiledRendering);
|
2013-10-23 11:44:22 +02:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetBrowseBorder( const Size& rNew )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( rNew != maBrowseBorder )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
maBrowseBorder = rNew;
|
|
|
|
if ( maVisArea.HasArea() )
|
2014-04-25 14:00:35 +02:00
|
|
|
CheckBrowseView( false );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
const Size& SwViewShell::GetBrowseBorder() const
|
2008-02-19 12:50:15 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
return maBrowseBorder;
|
2008-02-19 12:50:15 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
sal_Int32 SwViewShell::GetBrowseWidth() const
|
2008-02-19 12:50:15 +00:00
|
|
|
{
|
2008-03-07 14:00:41 +00:00
|
|
|
const SwPostItMgr* pPostItMgr = GetPostItMgr();
|
2008-02-19 12:50:15 +00:00
|
|
|
if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
Size aBorder( maBrowseBorder );
|
|
|
|
aBorder.Width() += maBrowseBorder.Width();
|
2008-02-19 12:50:15 +00:00
|
|
|
aBorder.Width() += pPostItMgr->GetSidebarWidth(true) + pPostItMgr->GetSidebarBorderWidth(true);
|
2013-02-23 12:33:14 +01:00
|
|
|
return maVisArea.Width() - GetOut()->PixelToLogic(aBorder).Width();
|
2008-02-19 12:50:15 +00:00
|
|
|
}
|
|
|
|
else
|
2013-02-23 12:33:14 +01:00
|
|
|
return maVisArea.Width() - 2 * GetOut()->PixelToLogic(maBrowseBorder).Width();
|
2008-02-19 12:50:15 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::CheckBrowseView( bool bBrowseChgd )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetLayout(), "Layout not ready" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
// When the Layout doesn't have a height yet, nothing is formatted.
|
|
|
|
// That leads to problems with Invalidate, e.g. when setting up an new View
|
|
|
|
// the content is inserted and formatted (regardless of empty VisArea).
|
|
|
|
// Therefore the pages must be roused for formatting.
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !GetLayout()->Frm().Height() )
|
|
|
|
{
|
|
|
|
SwFrm* pPage = GetLayout()->Lower();
|
|
|
|
while( pPage )
|
|
|
|
{
|
|
|
|
pPage->_InvalidateSize();
|
|
|
|
pPage = pPage->GetNext();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
LockPaint();
|
|
|
|
StartAction();
|
|
|
|
|
2014-12-01 10:16:01 +02:00
|
|
|
SwPageFrm *pPg = static_cast<SwPageFrm*>(GetLayout()->Lower());
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
{ pPg->InvalidateSize();
|
|
|
|
pPg->_InvalidatePrt();
|
|
|
|
pPg->InvaPercentLowers();
|
|
|
|
if ( bBrowseChgd )
|
|
|
|
{
|
|
|
|
pPg->PrepareHeader();
|
|
|
|
pPg->PrepareFooter();
|
|
|
|
}
|
2014-12-01 10:16:01 +02:00
|
|
|
pPg = static_cast<SwPageFrm*>(pPg->GetNext());
|
2000-09-18 23:08:29 +00:00
|
|
|
} while ( pPg );
|
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
// When the size ratios in browse mode change,
|
2015-05-20 13:05:49 +02:00
|
|
|
// the Position and PrtArea of the Content and Tab frames must be Invalidated.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_POS;
|
2015-05-20 13:05:49 +02:00
|
|
|
// In case of browse mode change the ContentFrms need a size-Invalidate
|
2013-02-08 19:32:39 +01:00
|
|
|
// because of printer/screen formatting
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bBrowseChgd )
|
2001-09-19 07:45:10 +00:00
|
|
|
nInv |= INV_SIZE | INV_DIRECTION;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
GetLayout()->InvalidateAllContent( nInv );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-12-01 10:16:01 +02:00
|
|
|
SwFrm::CheckPageDescs( static_cast<SwPageFrm*>(GetLayout()->Lower()) );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
EndAction();
|
|
|
|
UnlockPaint();
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
SwRootFrm *SwViewShell::GetLayout() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
return mpLayout.get();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
OutputDevice& SwViewShell::GetRefDev() const
|
2003-04-01 08:59:34 +00:00
|
|
|
{
|
2003-06-12 06:40:01 +00:00
|
|
|
OutputDevice* pTmpOut = 0;
|
2006-08-14 15:59:17 +00:00
|
|
|
if ( GetWin() &&
|
2010-06-13 15:22:56 +02:00
|
|
|
GetViewOptions()->getBrowseMode() &&
|
2006-08-14 15:59:17 +00:00
|
|
|
!GetViewOptions()->IsPrtFormat() )
|
2003-06-12 06:40:01 +00:00
|
|
|
pTmpOut = GetWin();
|
2015-04-29 13:19:36 +02:00
|
|
|
else if ( mpTmpRef )
|
2003-06-12 06:40:01 +00:00
|
|
|
pTmpOut = mpTmpRef;
|
|
|
|
else
|
2014-05-21 17:39:52 +02:00
|
|
|
pTmpOut = GetDoc()->getIDocumentDeviceAccess().getReferenceDevice( true );
|
2003-06-12 06:40:01 +00:00
|
|
|
|
|
|
|
return *pTmpOut;
|
2003-04-01 08:59:34 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
const SwNodes& SwViewShell::GetNodes() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
return mpDoc->GetNodes();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::DrawSelChanged()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
Size SwViewShell::GetDocSize() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
Size aSz;
|
|
|
|
const SwRootFrm* pRoot = GetLayout();
|
|
|
|
if( pRoot )
|
|
|
|
aSz = pRoot->Frm().SSize();
|
2008-02-19 12:50:15 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
return aSz;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
SfxItemPool& SwViewShell::GetAttrPool()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return GetDoc()->GetAttrPool();
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ApplyViewOptions( const SwViewOption &rOpt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
|
2014-12-03 19:08:17 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
|
|
|
rSh.StartAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
ImplApplyViewOptions( rOpt );
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
// With one layout per view it is not longer necessary
|
|
|
|
// to sync these "layout related" view options
|
|
|
|
// But as long as we have to disable "multiple layout"
|
2014-12-03 19:08:17 +01:00
|
|
|
|
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-12-03 19:08:17 +01:00
|
|
|
if(&rSh == this)
|
|
|
|
continue;
|
|
|
|
SwViewOption aOpt( *rSh.GetViewOptions() );
|
2015-05-20 13:05:49 +02:00
|
|
|
aOpt.SetFieldName( rOpt.IsFieldName() );
|
2009-09-11 10:21:51 +00:00
|
|
|
aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() );
|
2000-09-18 23:08:29 +00:00
|
|
|
aOpt.SetShowHiddenPara( rOpt.IsShowHiddenPara() );
|
2009-09-11 10:21:51 +00:00
|
|
|
aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() );
|
|
|
|
aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() );
|
|
|
|
aOpt.SetViewLayoutColumns( rOpt.GetViewLayoutColumns() );
|
|
|
|
aOpt.SetPostIts(rOpt.IsPostIts());
|
2014-12-03 19:08:17 +01:00
|
|
|
if ( !(aOpt == *rSh.GetViewOptions()) )
|
|
|
|
rSh.ImplApplyViewOptions( aOpt );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-06-13 15:22:56 +02:00
|
|
|
// End of disabled multiple window
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-12-03 19:08:17 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
|
|
|
rSh.EndAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if (*mpOpt == rOpt)
|
2010-02-16 16:03:23 +01:00
|
|
|
return;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window *pMyWin = GetWin();
|
2007-09-27 08:43:09 +00:00
|
|
|
if( !pMyWin )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-10-26 19:50:13 +02:00
|
|
|
OSL_ENSURE( pMyWin, "SwViewShell::ApplyViewOptions: no window" );
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bReformat = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
if( mpOpt->IsShowHiddenField() != rOpt.IsShowHiddenField() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
static_cast<SwHiddenTextFieldType*>(mpDoc->getIDocumentFieldsAccess().GetSysFieldType( RES_HIDDENTXTFLD ))->
|
2004-02-26 14:37:03 +00:00
|
|
|
SetHiddenFlag( !rOpt.IsShowHiddenField() );
|
2014-04-25 14:00:35 +02:00
|
|
|
bReformat = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mpOpt->IsShowHiddenPara() != rOpt.IsShowHiddenPara() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
SwHiddenParaFieldType* pFieldType = static_cast<SwHiddenParaFieldType*>(GetDoc()->
|
|
|
|
getIDocumentFieldsAccess().GetSysFieldType(RES_HIDDENPARAFLD));
|
|
|
|
if( pFieldType && pFieldType->HasWriterListeners() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
SwMsgPoolItem aHint( RES_HIDDENPARA_PRINT );
|
|
|
|
pFieldType->ModifyNotification( &aHint, 0);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
bReformat = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( !bReformat && mpOpt->IsShowHiddenChar() != rOpt.IsShowHiddenChar() )
|
2004-02-26 14:37:03 +00:00
|
|
|
{
|
|
|
|
bReformat = GetDoc()->ContainsHiddenChars();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-11-09 18:39:00 +01:00
|
|
|
// bReformat becomes true, if ...
|
2013-02-08 19:32:39 +01:00
|
|
|
// - fieldnames apply or not ...
|
|
|
|
// ( - SwEndPortion must _no_ longer be generated. )
|
|
|
|
// - Of course, the screen is something completely different than the printer ...
|
2015-05-20 13:05:49 +02:00
|
|
|
bReformat = bReformat || mpOpt->IsFieldName() != rOpt.IsFieldName();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
// The map mode is changed, minima/maxima will be attended by UI
|
2013-10-16 16:36:45 +02:00
|
|
|
if( mpOpt->GetZoom() != rOpt.GetZoom() && !IsPreview() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:43:09 +00:00
|
|
|
MapMode aMode( pMyWin->GetMapMode() );
|
2014-10-23 17:41:47 +02:00
|
|
|
Fraction aNewFactor( rOpt.GetZoom(), 100 );
|
2000-09-18 23:08:29 +00:00
|
|
|
aMode.SetScaleX( aNewFactor );
|
|
|
|
aMode.SetScaleY( aNewFactor );
|
2007-09-27 08:43:09 +00:00
|
|
|
pMyWin->SetMapMode( aMode );
|
2013-02-08 19:32:39 +01:00
|
|
|
// if not a reference device (printer) is used for formatting,
|
|
|
|
// but the screen, new formatting is needed for zoomfactor changes.
|
2013-02-23 12:33:14 +01:00
|
|
|
if( mpOpt->getBrowseMode() )
|
2014-04-25 14:00:35 +02:00
|
|
|
bReformat = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
bool bBrowseModeChanged = false;
|
2013-02-23 12:33:14 +01:00
|
|
|
if( mpOpt->getBrowseMode() != rOpt.getBrowseMode() )
|
2010-06-13 15:22:56 +02:00
|
|
|
{
|
|
|
|
bBrowseModeChanged = true;
|
2014-04-25 14:00:35 +02:00
|
|
|
bReformat = true;
|
2010-06-13 15:22:56 +02:00
|
|
|
}
|
2013-02-23 12:33:14 +01:00
|
|
|
else if( mpOpt->getBrowseMode() && mpOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
|
2014-04-25 14:00:35 +02:00
|
|
|
bReformat = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( HasDrawView() || rOpt.IsGridVisible() )
|
|
|
|
{
|
|
|
|
if ( !HasDrawView() )
|
|
|
|
MakeDrawView();
|
|
|
|
|
|
|
|
SwDrawView *pDView = Imp()->GetDrawView();
|
2014-04-25 14:00:35 +02:00
|
|
|
if ( pDView->IsDragStripes() != rOpt.IsCrossHair() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pDView->SetDragStripes( rOpt.IsCrossHair() );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
if ( pDView->IsGridSnap() != rOpt.IsSnap() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pDView->SetGridSnap( rOpt.IsSnap() );
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
if ( pDView->IsGridVisible() != rOpt.IsGridVisible() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pDView->SetGridVisible( rOpt.IsGridVisible() );
|
|
|
|
|
|
|
|
const Size &rSz = rOpt.GetSnapSize();
|
|
|
|
pDView->SetGridCoarse( rSz );
|
|
|
|
|
|
|
|
const Size aFSize
|
|
|
|
( rSz.Width() ? rSz.Width() / (rOpt.GetDivisionX()+1) : 0,
|
|
|
|
rSz.Height()? rSz.Height()/ (rOpt.GetDivisionY()+1) : 0);
|
|
|
|
pDView->SetGridFine( aFSize );
|
2014-10-23 17:41:47 +02:00
|
|
|
Fraction aSnGrWdtX(rSz.Width(), rOpt.GetDivisionX() + 1);
|
|
|
|
Fraction aSnGrWdtY(rSz.Height(), rOpt.GetDivisionY() + 1);
|
2000-09-18 23:08:29 +00:00
|
|
|
pDView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY );
|
|
|
|
|
2011-12-05 09:53:41 +01:00
|
|
|
// set handle size to 9 pixels, always
|
|
|
|
pDView->SetMarkHdlSizePixel(9);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
bool bOnlineSpellChgd = mpOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
*mpOpt = rOpt; // First the options are taken.
|
|
|
|
mpOpt->SetUIOptions(rOpt);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2015-03-11 15:04:54 +02:00
|
|
|
mpDoc->GetDocumentSettingManager().set(DocumentSettingId::HTML_MODE, 0 != ::GetHtmlMode(mpDoc->GetDocShell()));
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
if( bBrowseModeChanged )
|
|
|
|
{
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i44963# Good occasion to check if page sizes in
|
2010-06-13 15:22:56 +02:00
|
|
|
// page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
|
2015-05-20 13:05:49 +02:00
|
|
|
mpDoc->CheckDefaultPageFormat();
|
2014-04-25 14:00:35 +02:00
|
|
|
CheckBrowseView( true );
|
2010-06-13 15:22:56 +02:00
|
|
|
}
|
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
pMyWin->Invalidate();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bReformat )
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
// Nothing helps, we need to send all ContentFrms a
|
2013-02-08 19:32:39 +01:00
|
|
|
// Prepare, we format anew:
|
2000-09-18 23:08:29 +00:00
|
|
|
StartAction();
|
|
|
|
Reformat();
|
|
|
|
EndAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bOnlineSpellChgd )
|
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
bool bOnlineSpl = rOpt.IsOnlineSpell();
|
2014-12-03 19:10:12 +01:00
|
|
|
for(SwViewShell& rSh : GetRingContainer())
|
|
|
|
{
|
|
|
|
if(&rSh == this)
|
|
|
|
continue;
|
|
|
|
rSh.mpOpt->SetOnlineSpell( bOnlineSpl );
|
|
|
|
vcl::Window *pTmpWin = rSh.GetWin();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pTmpWin )
|
|
|
|
pTmpWin->Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetUIOptions( const SwViewOption &rOpt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetUIOptions(rOpt);
|
2000-09-18 23:08:29 +00:00
|
|
|
//the API-Flag of the view options is set but never reset
|
|
|
|
//it is required to set scroll bars in readonly documents
|
|
|
|
if(rOpt.IsStarOneSetting())
|
2014-04-25 14:00:35 +02:00
|
|
|
mpOpt->SetStarOneSetting(true);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetSymbolFont(rOpt.GetSymbolFont());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::SetReadonlyOption(bool bSet)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
//JP 01.02.99: at readonly flag query properly
|
|
|
|
// and if need be format; Bug 61335
|
2012-05-31 17:59:17 +01:00
|
|
|
|
2013-02-08 19:32:39 +01:00
|
|
|
// Are we switching from readonly to edit?
|
2013-02-23 12:33:14 +01:00
|
|
|
if( bSet != mpOpt->IsReadonly() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-08 19:32:39 +01:00
|
|
|
// so that the flags can be queried properly.
|
2014-04-25 14:00:35 +02:00
|
|
|
mpOpt->SetReadonly( false );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
bool bReformat = mpOpt->IsFieldName();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetReadonly( bSet );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( bReformat )
|
|
|
|
{
|
|
|
|
StartAction();
|
|
|
|
Reformat();
|
|
|
|
if ( GetWin() )
|
|
|
|
GetWin()->Invalidate();
|
|
|
|
EndAction();
|
|
|
|
}
|
|
|
|
else if ( GetWin() )
|
|
|
|
GetWin()->Invalidate();
|
2002-03-21 11:54:23 +00:00
|
|
|
if( Imp()->IsAccessible() )
|
2014-02-26 23:33:08 +01:00
|
|
|
Imp()->InvalidateAccessibleEditableState( false );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2003-09-11 08:40:50 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::SetPDFExportOption(bool bSet)
|
2003-09-11 08:40:50 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( bSet != mpOpt->IsPDFExport() )
|
2003-09-11 08:40:50 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( bSet && mpOpt->getBrowseMode() )
|
2014-04-25 14:00:35 +02:00
|
|
|
mpOpt->SetPrtFormat( true );
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetPDFExport(bSet);
|
2003-09-11 08:40:50 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::SetReadonlySelectionOption(bool bSet)
|
2002-08-01 13:13:38 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if( bSet != mpOpt->IsSelectionInReadonly() )
|
2002-08-01 13:13:38 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetSelectionInReadonly(bSet);
|
2002-08-01 13:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SwViewShell::SetPrtFormatOption( bool bSet )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetPrtFormat( bSet );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::UISizeNotify()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if ( mbDocSizeChgd )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mbDocSizeChgd = false;
|
2012-12-17 18:12:09 +09:00
|
|
|
bool bOld = bInSizeNotify;
|
|
|
|
bInSizeNotify = true;
|
2008-02-19 12:50:15 +00:00
|
|
|
::SizeNotify( this, GetDocSize() );
|
2000-09-18 23:08:29 +00:00
|
|
|
bInSizeNotify = bOld;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::SetRestoreActions(sal_uInt16 nSet)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-06-21 13:20:06 +02:00
|
|
|
OSL_ENSURE(!GetRestoreActions()||!nSet, "multiple restore of the Actions ?");
|
2000-09-18 23:08:29 +00:00
|
|
|
Imp()->SetRestoreActions(nSet);
|
|
|
|
}
|
2013-10-26 19:50:13 +02:00
|
|
|
sal_uInt16 SwViewShell::GetRestoreActions() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return Imp()->GetRestoreActions();
|
|
|
|
}
|
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool SwViewShell::IsNewLayout() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return GetLayout()->IsNewLayout();
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
uno::Reference< ::com::sun::star::accessibility::XAccessible > SwViewShell::CreateAccessible()
|
2002-02-20 17:14:14 +00:00
|
|
|
{
|
2007-09-27 08:43:09 +00:00
|
|
|
uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-02-20 17:14:14 +00:00
|
|
|
// We require a layout and an XModel to be accessible.
|
2013-02-23 12:33:14 +01:00
|
|
|
OSL_ENSURE( mpLayout, "no layout, no access" );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetWin(), "no window, no access" );
|
2002-02-20 17:14:14 +00:00
|
|
|
|
2014-08-06 16:21:14 +02:00
|
|
|
if( mpDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && GetWin() )
|
2002-02-20 17:14:14 +00:00
|
|
|
xAcc = Imp()->GetAccessibleMap().GetDocumentView();
|
|
|
|
|
|
|
|
return xAcc;
|
|
|
|
}
|
2002-05-16 07:22:32 +00:00
|
|
|
|
2007-09-27 08:43:09 +00:00
|
|
|
uno::Reference< ::com::sun::star::accessibility::XAccessible >
|
2013-10-26 19:50:13 +02:00
|
|
|
SwViewShell::CreateAccessiblePreview()
|
2002-05-22 10:48:43 +00:00
|
|
|
{
|
2013-10-16 16:36:45 +02:00
|
|
|
OSL_ENSURE( IsPreview(),
|
2013-10-26 19:50:13 +02:00
|
|
|
"Can't create accessible preview for non-preview SwViewShell" );
|
2002-05-22 10:48:43 +00:00
|
|
|
|
|
|
|
// We require a layout and an XModel to be accessible.
|
2013-02-23 12:33:14 +01:00
|
|
|
OSL_ENSURE( mpLayout, "no layout, no access" );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetWin(), "no window, no access" );
|
2002-05-22 10:48:43 +00:00
|
|
|
|
2013-10-16 16:36:45 +02:00
|
|
|
if ( IsPreview() && GetLayout()&& GetWin() )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2002-05-22 10:48:43 +00:00
|
|
|
return Imp()->GetAccessibleMap().GetDocumentPreview(
|
2013-10-16 16:31:35 +02:00
|
|
|
PagePreviewLayout()->maPreviewPages,
|
2003-03-27 14:45:43 +00:00
|
|
|
GetWin()->GetMapMode().GetScaleX(),
|
2010-06-13 15:22:56 +02:00
|
|
|
GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
|
2013-10-22 15:14:13 +03:00
|
|
|
PagePreviewLayout()->maWinSize );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
2002-05-22 10:48:43 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::InvalidateAccessibleFocus()
|
2002-05-16 07:22:32 +00:00
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
if( Imp() && Imp()->IsAccessible() )
|
2002-05-16 07:22:32 +00:00
|
|
|
Imp()->GetAccessibleMap().InvalidateFocus();
|
|
|
|
}
|
2002-05-22 10:48:43 +00:00
|
|
|
|
2013-05-05 20:15:21 +02:00
|
|
|
/**
|
2012-06-21 13:20:06 +02:00
|
|
|
* invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs #i27138#
|
|
|
|
*/
|
2015-05-20 13:05:49 +02:00
|
|
|
void SwViewShell::InvalidateAccessibleParaFlowRelation( const SwTextFrm* _pFromTextFrm,
|
|
|
|
const SwTextFrm* _pToTextFrm )
|
2006-02-01 13:26:17 +00:00
|
|
|
{
|
|
|
|
if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
Imp()->_InvalidateAccessibleParaFlowRelation( _pFromTextFrm, _pToTextFrm );
|
2006-02-01 13:26:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-05 20:15:21 +02:00
|
|
|
/**
|
2012-06-21 13:20:06 +02:00
|
|
|
* invalidate text selection for paragraphs #i27301#
|
|
|
|
*/
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::InvalidateAccessibleParaTextSelection()
|
2006-02-01 13:26:17 +00:00
|
|
|
{
|
|
|
|
if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
|
|
|
|
{
|
|
|
|
Imp()->_InvalidateAccessibleParaTextSelection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
/**
|
|
|
|
* invalidate attributes for paragraphs #i88069#
|
|
|
|
*/
|
2015-05-20 13:05:49 +02:00
|
|
|
void SwViewShell::InvalidateAccessibleParaAttrs( const SwTextFrm& rTextFrm )
|
2009-02-27 05:38:42 +00:00
|
|
|
{
|
|
|
|
if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
Imp()->_InvalidateAccessibleParaAttrs( rTextFrm );
|
2009-02-27 05:38:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
SwAccessibleMap* SwViewShell::GetAccessibleMap()
|
2010-02-02 15:11:26 +01:00
|
|
|
{
|
|
|
|
if ( Imp()->IsAccessible() )
|
|
|
|
{
|
|
|
|
return &(Imp()->GetAccessibleMap());
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2012-05-31 17:59:17 +01:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
|
2002-05-06 11:11:40 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
if(mpOpt->IsPagePreview() && !rAccessibilityOptions.GetIsForPagePreviews())
|
2002-05-06 11:11:40 +00:00
|
|
|
{
|
2014-04-25 14:00:35 +02:00
|
|
|
mpAccOptions->SetAlwaysAutoColor(false);
|
|
|
|
mpAccOptions->SetStopAnimatedGraphics(false);
|
|
|
|
mpAccOptions->SetStopAnimatedText(false);
|
2002-05-06 11:11:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpAccOptions->SetAlwaysAutoColor(rAccessibilityOptions.GetIsAutomaticFontColor());
|
|
|
|
mpAccOptions->SetStopAnimatedGraphics(! rAccessibilityOptions.GetIsAllowAnimatedGraphics());
|
|
|
|
mpAccOptions->SetStopAnimatedText(! rAccessibilityOptions.GetIsAllowAnimatedText());
|
2002-08-28 11:24:07 +00:00
|
|
|
|
2011-02-05 17:11:34 -05:00
|
|
|
// Formular view
|
2004-11-16 09:24:16 +00:00
|
|
|
// Always set this option, not only if document is read-only:
|
2013-02-23 12:33:14 +01:00
|
|
|
mpOpt->SetSelectionInReadonly(rAccessibilityOptions.IsSelectionInReadonly());
|
2002-05-06 11:11:40 +00:00
|
|
|
}
|
|
|
|
}
|
2004-02-26 14:37:03 +00:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
ShellResource* SwViewShell::GetShellRes()
|
2004-05-10 15:16:55 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
return mpShellRes;
|
2004-05-10 15:16:55 +00:00
|
|
|
}
|
2004-09-08 15:55:24 +00:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
void SwViewShell::SetCareWin( vcl::Window* pNew )
|
2004-05-10 15:16:55 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
mpCareWindow = pNew;
|
2004-05-10 15:16:55 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
sal_uInt16 SwViewShell::GetPageCount() const
|
2010-06-13 15:22:56 +02:00
|
|
|
{
|
|
|
|
return GetLayout() ? GetLayout()->GetPageNum() : 1;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
const Size SwViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
|
2010-06-13 15:22:56 +02:00
|
|
|
{
|
|
|
|
Size aSize;
|
|
|
|
const SwRootFrm* pTmpRoot = GetLayout();
|
|
|
|
if( pTmpRoot && nPageNum )
|
|
|
|
{
|
|
|
|
const SwPageFrm* pPage = static_cast<const SwPageFrm*>
|
|
|
|
(pTmpRoot->Lower());
|
|
|
|
|
|
|
|
while( --nPageNum && pPage->GetNext() )
|
|
|
|
pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
|
|
|
|
|
|
|
|
if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
|
|
|
|
pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
|
|
|
|
|
|
|
|
aSize = pPage->Frm().SSize();
|
|
|
|
}
|
|
|
|
return aSize;
|
|
|
|
}
|
2004-09-08 15:55:24 +00:00
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
// #i12836# enhanced pdf export
|
2013-10-26 19:50:13 +02:00
|
|
|
sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
|
2004-09-08 15:55:24 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetLayout(), "GetPageNumAndSetOffsetForPDF assumes presence of layout" );
|
2005-03-08 12:47:33 +00:00
|
|
|
|
|
|
|
sal_Int32 nRet = -1;
|
|
|
|
|
2012-06-21 13:20:06 +02:00
|
|
|
// #i40059# Position out of bounds:
|
2005-01-21 09:42:30 +00:00
|
|
|
SwRect aRect( rRect );
|
2013-04-11 00:21:40 -03:00
|
|
|
aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->Frm().Left() );
|
2005-03-08 12:47:33 +00:00
|
|
|
|
2005-01-21 09:42:30 +00:00
|
|
|
const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aRect.Center() );
|
2005-03-08 12:47:33 +00:00
|
|
|
if ( pPage )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pPage, "GetPageNumAndSetOffsetForPDF: No page found" );
|
2005-03-08 12:47:33 +00:00
|
|
|
|
|
|
|
Point aOffset( pPage->Frm().Pos() );
|
|
|
|
aOffset.X() = -aOffset.X();
|
|
|
|
aOffset.Y() = -aOffset.Y();
|
2004-09-08 15:55:24 +00:00
|
|
|
|
2005-03-08 12:47:33 +00:00
|
|
|
MapMode aMapMode( rOut.GetMapMode() );
|
|
|
|
aMapMode.SetOrigin( aOffset );
|
|
|
|
rOut.SetMapMode( aMapMode );
|
2004-09-08 15:55:24 +00:00
|
|
|
|
2005-03-08 12:47:33 +00:00
|
|
|
nRet = pPage->GetPhyPageNum() - 1;
|
|
|
|
}
|
2004-09-08 15:55:24 +00:00
|
|
|
|
2005-03-08 12:47:33 +00:00
|
|
|
return nRet;
|
2004-09-08 15:55:24 +00:00
|
|
|
}
|
2012-06-21 13:20:06 +02:00
|
|
|
|
2012-05-31 17:59:17 +01:00
|
|
|
// --> PB 2007-05-30 #146850#
|
2013-10-26 19:50:13 +02:00
|
|
|
const BitmapEx& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
|
2007-08-03 12:40:32 +00:00
|
|
|
{
|
|
|
|
BitmapEx** ppRet;
|
2011-03-14 16:51:14 +00:00
|
|
|
sal_uInt16 nResId = 0;
|
2007-08-03 12:40:32 +00:00
|
|
|
if( bIsErrorState )
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
ppRet = &mpErrorBmp;
|
2007-08-03 12:40:32 +00:00
|
|
|
nResId = RID_GRAPHIC_ERRORBMP;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
ppRet = &mpReplaceBmp;
|
2007-08-03 12:40:32 +00:00
|
|
|
nResId = RID_GRAPHIC_REPLACEBMP;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !*ppRet )
|
|
|
|
{
|
2010-11-16 11:08:17 +01:00
|
|
|
*ppRet = new BitmapEx( SW_RES( nResId ) );
|
2007-08-03 12:40:32 +00:00
|
|
|
}
|
|
|
|
return **ppRet;
|
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
void SwViewShell::DeleteReplacementBitmaps()
|
2007-08-03 12:40:32 +00:00
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
DELETEZ( mpErrorBmp );
|
|
|
|
DELETEZ( mpReplaceBmp );
|
2007-08-03 12:40:32 +00:00
|
|
|
}
|
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
SwPostItMgr* SwViewShell::GetPostItMgr()
|
2008-03-07 14:00:41 +00:00
|
|
|
{
|
|
|
|
SwView* pView = GetDoc()->GetDocShell() ? GetDoc()->GetDocShell()->GetView() : 0;
|
|
|
|
if ( pView )
|
|
|
|
return pView->GetPostItMgr();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-08-14 15:59:17 +00:00
|
|
|
/*
|
|
|
|
* Document Interface Access
|
|
|
|
*/
|
2014-05-25 14:10:13 +02:00
|
|
|
const IDocumentSettingAccess* SwViewShell::getIDocumentSettingAccess() const { return &mpDoc->GetDocumentSettingManager(); }
|
|
|
|
IDocumentSettingAccess* SwViewShell::getIDocumentSettingAccess() { return &mpDoc->GetDocumentSettingManager(); }
|
2014-05-21 17:39:52 +02:00
|
|
|
const IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() const { return &mpDoc->getIDocumentDeviceAccess(); }
|
|
|
|
IDocumentDeviceAccess* SwViewShell::getIDocumentDeviceAccess() { return &mpDoc->getIDocumentDeviceAccess(); }
|
2013-10-26 19:50:13 +02:00
|
|
|
const IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() const { return mpDoc->getIDocumentMarkAccess(); }
|
|
|
|
IDocumentMarkAccess* SwViewShell::getIDocumentMarkAccess() { return mpDoc->getIDocumentMarkAccess(); }
|
2014-06-01 22:21:38 +02:00
|
|
|
const IDocumentDrawModelAccess* SwViewShell::getIDocumentDrawModelAccess() const { return & mpDoc->getIDocumentDrawModelAccess(); }
|
|
|
|
IDocumentDrawModelAccess* SwViewShell::getIDocumentDrawModelAccess() { return & mpDoc->getIDocumentDrawModelAccess(); }
|
2014-07-16 22:19:33 +02:00
|
|
|
const IDocumentRedlineAccess* SwViewShell::getIDocumentRedlineAccess() const { return &mpDoc->getIDocumentRedlineAccess(); }
|
|
|
|
IDocumentRedlineAccess* SwViewShell::getIDocumentRedlineAccess() { return &mpDoc->getIDocumentRedlineAccess(); }
|
2014-08-06 16:21:14 +02:00
|
|
|
const IDocumentLayoutAccess* SwViewShell::getIDocumentLayoutAccess() const { return &mpDoc->getIDocumentLayoutAccess(); }
|
|
|
|
IDocumentLayoutAccess* SwViewShell::getIDocumentLayoutAccess() { return &mpDoc->getIDocumentLayoutAccess(); }
|
2014-07-07 14:32:02 +02:00
|
|
|
IDocumentContentOperations* SwViewShell::getIDocumentContentOperations() { return &mpDoc->getIDocumentContentOperations(); }
|
2014-08-08 19:16:38 +02:00
|
|
|
IDocumentStylePoolAccess* SwViewShell::getIDocumentStylePoolAccess() { return &mpDoc->getIDocumentStylePoolAccess(); }
|
2014-07-31 12:14:23 +02:00
|
|
|
const IDocumentStatistics* SwViewShell::getIDocumentStatistics() const { return &mpDoc->getIDocumentStatistics(); }
|
2013-10-26 19:50:13 +02:00
|
|
|
|
|
|
|
IDocumentUndoRedo & SwViewShell::GetIDocumentUndoRedo()
|
2013-02-23 12:33:14 +01:00
|
|
|
{ return mpDoc->GetIDocumentUndoRedo(); }
|
2013-10-26 19:50:13 +02:00
|
|
|
IDocumentUndoRedo const& SwViewShell::GetIDocumentUndoRedo() const
|
2013-02-23 12:33:14 +01:00
|
|
|
{ return mpDoc->GetIDocumentUndoRedo(); }
|
2010-11-25 14:31:08 +01:00
|
|
|
|
2012-05-31 17:59:17 +01:00
|
|
|
// --> OD 2007-11-14 #i83479#
|
2013-10-26 19:50:13 +02:00
|
|
|
const IDocumentListItems* SwViewShell::getIDocumentListItemsAccess() const
|
2008-02-26 09:43:47 +00:00
|
|
|
{
|
2014-06-23 14:56:59 +02:00
|
|
|
return &mpDoc->getIDocumentListItems();
|
2008-02-26 09:43:47 +00:00
|
|
|
}
|
2013-05-05 20:19:50 +02:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
const IDocumentOutlineNodes* SwViewShell::getIDocumentOutlineNodesAccess() const
|
2008-02-26 09:43:47 +00:00
|
|
|
{
|
2014-06-30 20:58:00 +02:00
|
|
|
return &mpDoc->getIDocumentOutlineNodes();
|
2008-02-26 09:43:47 +00:00
|
|
|
}
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|