2000-09-18 16:15:01 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* $RCSfile: pview.cxx,v $
|
2008-06-06 12:42:43 +00:00
|
|
|
|
* $Revision: 1.70 $
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2008-04-10 20:46:17 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
2006-09-16 22:22:36 +00:00
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
|
2000-11-07 12:09:54 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2004-10-04 18:31:48 +00:00
|
|
|
|
#include <sfx2/objface.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#include <vcl/timer.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <vcl/field.hxx>
|
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
|
#include <vcl/help.hxx>
|
|
|
|
|
#include <vcl/cmdevt.hxx>
|
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
|
#include <svtools/printdlg.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#include <svtools/whiter.hxx>
|
|
|
|
|
#include <svtools/stritem.hxx>
|
|
|
|
|
#include <svtools/eitem.hxx>
|
|
|
|
|
#include <sfx2/printer.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2002-11-27 08:01:27 +00:00
|
|
|
|
#include <vcl/msgbox.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <svx/stddlg.hxx>
|
|
|
|
|
#include <svx/paperinf.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#include <svx/srchitem.hxx>
|
|
|
|
|
#include <svx/svdview.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <svx/dlgutil.hxx>
|
2008-03-07 14:06:36 +00:00
|
|
|
|
#include <svx/zoomslideritem.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#ifndef _SVX_SVXIDS_HRC //autogen
|
|
|
|
|
#include <svx/svxids.hrc>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <swwait.hxx>
|
|
|
|
|
#include <globdoc.hxx>
|
|
|
|
|
#include <wdocsh.hxx>
|
|
|
|
|
#include <pvprtdat.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <swmodule.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#include <modcfg.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <wrtsh.hxx>
|
|
|
|
|
#include <docsh.hxx>
|
|
|
|
|
#include <viewopt.hxx>
|
|
|
|
|
#include <doc.hxx>
|
|
|
|
|
#include <pview.hxx>
|
|
|
|
|
#include <view.hxx>
|
|
|
|
|
#include <textsh.hxx>
|
|
|
|
|
#include <scroll.hxx>
|
|
|
|
|
#include <swprtopt.hxx>
|
|
|
|
|
#include <docstat.hxx>
|
|
|
|
|
#include <usrpref.hxx>
|
|
|
|
|
#include <viewfunc.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-10-08 12:52:46 +00:00
|
|
|
|
|
|
|
|
|
#ifndef _HELPID_H
|
|
|
|
|
#include <helpid.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _CMDID_H
|
|
|
|
|
#include <cmdid.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _GLOBALS_HRC
|
|
|
|
|
#include <globals.hrc>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _POPUP_HRC
|
|
|
|
|
#include <popup.hrc>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _PVIEW_HRC
|
|
|
|
|
#include <pview.hrc>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define SwPagePreView
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
|
|
|
|
#include <sfx2/msg.hxx>
|
2001-10-08 12:52:46 +00:00
|
|
|
|
#include <swslots.hxx>
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 12.12.2002 #103492#
|
|
|
|
|
#include <pagepreviewlayout.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
#include <svx/svxdlg.hxx>
|
|
|
|
|
#include <svx/dialogs.hrc>
|
2006-11-14 14:20:39 +00:00
|
|
|
|
#include <vos/mutex.hxx>
|
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SFX_IMPL_VIEWFACTORY(SwPagePreView, SW_RES(STR_NONAME))
|
|
|
|
|
{
|
|
|
|
|
SFX_VIEW_REGISTRATION(SwDocShell);
|
|
|
|
|
SFX_VIEW_REGISTRATION(SwWebDocShell);
|
|
|
|
|
SFX_VIEW_REGISTRATION(SwGlobalDocShell);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX))
|
|
|
|
|
{
|
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_PPREVIEW_POPUPMENU));
|
|
|
|
|
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|
|
|
|
|
|
SFX_VISIBILITY_CLIENT|SFX_VISIBILITY_FULLSCREEN|
|
|
|
|
|
SFX_VISIBILITY_READONLYDOC,
|
|
|
|
|
SW_RES(RID_PVIEW_TOOLBOX));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TYPEINIT1(SwPagePreView,SfxViewShell)
|
|
|
|
|
|
|
|
|
|
#define SWVIEWFLAGS ( SFX_VIEW_MAXIMIZE_FIRST|SFX_VIEW_OPTIMIZE_EACH| \
|
|
|
|
|
SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS )
|
|
|
|
|
|
2002-11-27 08:01:27 +00:00
|
|
|
|
#define MIN_PREVIEW_ZOOM 25
|
|
|
|
|
#define MAX_PREVIEW_ZOOM 600
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/* */
|
2002-11-27 08:01:27 +00:00
|
|
|
|
/* -----------------26.11.2002 10:41-----------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
USHORT lcl_GetNextZoomStep(USHORT nCurrentZoom, BOOL bZoomIn)
|
|
|
|
|
{
|
|
|
|
|
static USHORT aZoomArr[] =
|
|
|
|
|
{
|
|
|
|
|
25, 50, 75, 100, 150, 200, 400, 600
|
|
|
|
|
};
|
2003-04-17 09:16:40 +00:00
|
|
|
|
const sal_uInt16 nZoomArrSize = sizeof(aZoomArr)/sizeof(USHORT);
|
2002-11-27 08:01:27 +00:00
|
|
|
|
if(bZoomIn)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
for(int i = nZoomArrSize - 1; i >= 0; --i)
|
2002-11-27 08:01:27 +00:00
|
|
|
|
{
|
|
|
|
|
if(nCurrentZoom > aZoomArr[i] || !i)
|
|
|
|
|
return aZoomArr[i];
|
|
|
|
|
}
|
|
|
|
|
else
|
2007-09-27 11:35:25 +00:00
|
|
|
|
for(int i = 0; i < nZoomArrSize; ++i)
|
2002-11-27 08:01:27 +00:00
|
|
|
|
{
|
|
|
|
|
if(nCurrentZoom < aZoomArr[i])
|
|
|
|
|
return aZoomArr[i];
|
|
|
|
|
}
|
|
|
|
|
return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM;
|
|
|
|
|
};
|
2002-12-02 07:36:05 +00:00
|
|
|
|
/* -----------------02.12.2002 09:11-----------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void lcl_InvalidateZoomSlots(SfxBindings& rBindings)
|
|
|
|
|
{
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
2008-03-07 14:06:36 +00:00
|
|
|
|
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, FN_PREVIEW_ZOOM, FN_STAT_ZOOM,
|
2002-12-02 07:36:05 +00:00
|
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
// erstmal der Zoom-Dialog
|
|
|
|
|
|
|
|
|
|
class SwPreViewZoomDlg : public SvxStandardDialog
|
|
|
|
|
{
|
|
|
|
|
FixedText aRowLbl;
|
|
|
|
|
NumericField aRowEdit;
|
|
|
|
|
FixedText aColLbl;
|
|
|
|
|
NumericField aColEdit;
|
|
|
|
|
|
|
|
|
|
OKButton aOkBtn;
|
|
|
|
|
CancelButton aCancelBtn;
|
|
|
|
|
HelpButton aHelpBtn;
|
|
|
|
|
|
|
|
|
|
virtual void Apply();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
SwPreViewZoomDlg( SwPagePreViewWin& rParent );
|
|
|
|
|
~SwPreViewZoomDlg();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) :
|
|
|
|
|
SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_ZOOM) ),
|
|
|
|
|
aRowLbl(this,SW_RES(FT_ROW)),
|
|
|
|
|
aRowEdit(this,SW_RES(ED_ROW)),
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aColLbl(this,SW_RES(FT_COL)),
|
|
|
|
|
aColEdit(this,SW_RES(ED_COL)),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aOkBtn(this,SW_RES(BT_OK)),
|
|
|
|
|
aCancelBtn(this,SW_RES(BT_CANCEL)),
|
|
|
|
|
aHelpBtn(this,SW_RES(BT_HELP))
|
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
|
|
aRowEdit.SetValue( rParent.GetRow() );
|
|
|
|
|
aColEdit.SetValue( rParent.GetCol() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwPreViewZoomDlg::~SwPreViewZoomDlg() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPreViewZoomDlg::Apply()
|
|
|
|
|
{
|
|
|
|
|
((SwPagePreViewWin*)GetParent())->CalcWish(
|
|
|
|
|
BYTE(aRowEdit.GetValue()),
|
|
|
|
|
BYTE(aColEdit.GetValue()) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
/* -----------------20.08.98 15:25-------------------
|
|
|
|
|
* Vorschau fuer den Seitendruck
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
struct PrintSettingsStruct;
|
|
|
|
|
class PrtPrvWindow : public Window
|
|
|
|
|
{
|
|
|
|
|
const PrintSettingsStruct& rSettings;
|
|
|
|
|
|
|
|
|
|
virtual void Paint(const Rectangle&);
|
|
|
|
|
public :
|
|
|
|
|
PrtPrvWindow(Window* pParent, const ResId& rResId, const PrintSettingsStruct& rSett) :
|
|
|
|
|
Window(pParent, rResId), rSettings(rSett){}
|
|
|
|
|
};
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Optionen fuer das Drucken der Preview
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
struct PrintSettingsStruct
|
|
|
|
|
{
|
|
|
|
|
Size aPageMaxSize; // groesste Seite
|
|
|
|
|
Size aPrtSize; // Papiergroesse
|
|
|
|
|
Size aPrvPrtSize; // Groesse innerhalb der LRTB-Raender
|
|
|
|
|
Size aGridSize; // Groesse fuer jede Seite, enthaelt je
|
|
|
|
|
// die Haelfte von H- und V-Distance
|
|
|
|
|
|
|
|
|
|
long nLeft;
|
|
|
|
|
long nRight;
|
|
|
|
|
long nTop;
|
|
|
|
|
long nBottom;
|
|
|
|
|
long nHori;
|
|
|
|
|
long nVert;
|
|
|
|
|
|
|
|
|
|
USHORT nRows;
|
|
|
|
|
USHORT nCols;
|
|
|
|
|
|
|
|
|
|
BOOL bPrinterLandscape; // Ausrichtung
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SwPreviewPrintOptionsDialog : public SvxStandardDialog
|
|
|
|
|
{
|
2001-06-01 10:25:06 +00:00
|
|
|
|
FixedLine aRowColFL;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FixedText aRowsFT;
|
|
|
|
|
NumericField aRowsNF;
|
|
|
|
|
FixedText aColsFT;
|
|
|
|
|
NumericField aColsNF;
|
|
|
|
|
|
2001-06-01 10:25:06 +00:00
|
|
|
|
FixedLine aMarginFL;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FixedText aLSpaceFT;
|
|
|
|
|
MetricField aLSpaceMF;
|
|
|
|
|
FixedText aRSpaceFT;
|
|
|
|
|
MetricField aRSpaceMF;
|
|
|
|
|
FixedText aTSpaceFT;
|
|
|
|
|
MetricField aTSpaceMF;
|
|
|
|
|
FixedText aBSpaceFT;
|
|
|
|
|
MetricField aBSpaceMF;
|
2001-06-01 10:25:06 +00:00
|
|
|
|
FixedLine aDistanceFL;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FixedText aHSpaceFT;
|
|
|
|
|
MetricField aHSpaceMF;
|
|
|
|
|
FixedText aVSpaceFT;
|
|
|
|
|
MetricField aVSpaceMF;
|
|
|
|
|
|
|
|
|
|
RadioButton aLandscapeRB;
|
|
|
|
|
RadioButton aPortraitRB;
|
2001-06-01 10:25:06 +00:00
|
|
|
|
FixedLine aOrientationFL;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
PrtPrvWindow aPreviewWin;
|
|
|
|
|
|
|
|
|
|
OKButton aOkBtn;
|
|
|
|
|
CancelButton aCancelBtn;
|
|
|
|
|
HelpButton aHelpBtn;
|
|
|
|
|
|
|
|
|
|
PushButton aStandardPB;
|
|
|
|
|
|
|
|
|
|
SwPagePreView& rPreView;
|
2002-12-02 13:45:09 +00:00
|
|
|
|
SwPagePreViewWin& rParentWin;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
PrintSettingsStruct aSettings;
|
|
|
|
|
/* Size aPageMaxSize;
|
|
|
|
|
Size aPrtSize;
|
|
|
|
|
|
|
|
|
|
BOOL bOrientation;
|
|
|
|
|
*/
|
|
|
|
|
BOOL bStandard;
|
|
|
|
|
|
|
|
|
|
virtual void Apply();
|
|
|
|
|
void FillControls(SwPagePreViewPrtData& rData);
|
|
|
|
|
|
|
|
|
|
DECL_LINK( ModifyHdl, Edit* );
|
|
|
|
|
DECL_LINK( StandardHdl, PushButton* );
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
SwPreviewPrintOptionsDialog(SwPagePreViewWin& rParent, SwPagePreView& rView);
|
|
|
|
|
~SwPreviewPrintOptionsDialog();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* -----------------19.08.98 13:35-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwPreviewPrintOptionsDialog::SwPreviewPrintOptionsDialog( SwPagePreViewWin& rParent, SwPagePreView& rView ) :
|
|
|
|
|
SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_PRINTOPTIONS) ),
|
2001-06-01 10:25:06 +00:00
|
|
|
|
aRowColFL(this,SW_RES( FL_ROWCOL)),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aRowsFT(this,SW_RES( FT_ROWS)),
|
|
|
|
|
aRowsNF(this,SW_RES( NF_ROWS)),
|
|
|
|
|
aColsFT(this,SW_RES( FT_COLS)),
|
|
|
|
|
aColsNF(this,SW_RES( NF_COLS)),
|
2001-06-01 10:25:06 +00:00
|
|
|
|
aMarginFL(this,SW_RES( FL_MARGINS)),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aLSpaceFT(this,SW_RES( FT_LMARGIN)),
|
|
|
|
|
aLSpaceMF(this,SW_RES( MF_LMARGIN)),
|
|
|
|
|
aRSpaceFT(this,SW_RES( FT_RMARGIN)),
|
|
|
|
|
aRSpaceMF(this,SW_RES( MF_RMARGIN)),
|
|
|
|
|
aTSpaceFT(this,SW_RES( FT_TMARGIN)),
|
|
|
|
|
aTSpaceMF(this,SW_RES( MF_TMARGIN)),
|
|
|
|
|
aBSpaceFT(this,SW_RES( FT_BMARGIN)),
|
|
|
|
|
aBSpaceMF(this,SW_RES( MF_BMARGIN)),
|
2001-06-01 10:25:06 +00:00
|
|
|
|
aDistanceFL(this,SW_RES(FL_DISTANCE)),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aHSpaceFT(this,SW_RES( FT_HMARGIN)),
|
|
|
|
|
aHSpaceMF(this,SW_RES( MF_HMARGIN)),
|
|
|
|
|
aVSpaceFT(this,SW_RES( FT_VMARGIN)),
|
|
|
|
|
aVSpaceMF(this,SW_RES( MF_VMARGIN)),
|
|
|
|
|
aLandscapeRB(this,SW_RES( RB_LANDSCAPE)),
|
|
|
|
|
aPortraitRB(this,SW_RES( RB_PORTRAIT)),
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aOrientationFL(this,SW_RES( FL_ORIENTATION)),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aPreviewWin(this,SW_RES( WIN_PREVIEW), aSettings),
|
|
|
|
|
aOkBtn(this,SW_RES(BT_OK)),
|
|
|
|
|
aCancelBtn(this,SW_RES(BT_CANCEL)),
|
|
|
|
|
aHelpBtn(this,SW_RES(BT_HELP)),
|
|
|
|
|
aStandardPB(this,SW_RES(PB_STANDARD)),
|
|
|
|
|
rPreView(rView),
|
2002-12-02 13:45:09 +00:00
|
|
|
|
rParentWin(rParent),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
bStandard(TRUE)
|
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ViewShell& rViewSh = *rPreView.GetViewShell();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 18.12.2002 #103492#
|
|
|
|
|
aSettings.aPageMaxSize = rViewSh.PagePreviewLayout()->GetMaxPageSize();
|
2006-08-14 16:56:12 +00:00
|
|
|
|
SfxPrinter* pPrinter = rViewSh.getIDocumentDeviceAccess()->getPrinter( true );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aSettings.aPrtSize = pPrinter->GetPaperSize();
|
2002-02-26 14:54:02 +00:00
|
|
|
|
//#97682# make sure that no division by zero occurs
|
|
|
|
|
if(!aSettings.aPrtSize.Width() || !aSettings.aPrtSize.Height())
|
2009-06-12 09:36:34 +00:00
|
|
|
|
aSettings.aPrtSize = SvxPaperInfo::GetPaperSize(PAPER_A4);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aSettings.bPrinterLandscape = pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwDocShell* pDocShell = rPreView.GetDocShell();
|
2000-09-28 14:25:03 +00:00
|
|
|
|
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != PTR_CAST(SwWebDocShell, pDocShell));
|
|
|
|
|
FieldUnit eFieldUnit = pUsrPref->GetMetric();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
::SetFieldUnit( aLSpaceMF, eFieldUnit );
|
|
|
|
|
::SetFieldUnit( aRSpaceMF, eFieldUnit );
|
|
|
|
|
::SetFieldUnit( aTSpaceMF, eFieldUnit );
|
|
|
|
|
::SetFieldUnit( aBSpaceMF, eFieldUnit );
|
|
|
|
|
::SetFieldUnit( aHSpaceMF, eFieldUnit );
|
|
|
|
|
::SetFieldUnit( aVSpaceMF, eFieldUnit );
|
|
|
|
|
|
|
|
|
|
SwDoc* pDoc = pDocShell->GetDoc();
|
|
|
|
|
SwPagePreViewPrtData aData;
|
|
|
|
|
if(pDoc->GetPreViewPrtData())
|
|
|
|
|
{
|
|
|
|
|
aData = *pDoc->GetPreViewPrtData();
|
|
|
|
|
bStandard = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Orientation der PreviewData an den Drucker anpassen
|
|
|
|
|
aData.SetLandscape(aSettings.bPrinterLandscape);
|
2002-12-02 13:45:09 +00:00
|
|
|
|
aData.SetRow(rParent.GetRow());
|
|
|
|
|
aData.SetCol(rParent.GetCol());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
FillControls(aData);
|
|
|
|
|
|
|
|
|
|
aLSpaceMF.SaveValue();
|
|
|
|
|
aRSpaceMF.SaveValue();
|
|
|
|
|
aTSpaceMF.SaveValue();
|
|
|
|
|
aBSpaceMF.SaveValue();
|
|
|
|
|
aHSpaceMF.SaveValue();
|
|
|
|
|
aVSpaceMF.SaveValue();
|
|
|
|
|
aRowsNF.SaveValue();
|
|
|
|
|
aColsNF.SaveValue();
|
|
|
|
|
aLandscapeRB.SaveValue();
|
|
|
|
|
aPortraitRB.SaveValue();
|
|
|
|
|
|
|
|
|
|
aStandardPB.SetClickHdl(LINK(this, SwPreviewPrintOptionsDialog, StandardHdl));
|
|
|
|
|
Link aLk = LINK(this, SwPreviewPrintOptionsDialog, ModifyHdl);
|
|
|
|
|
aLSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aRSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aTSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aBSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aHSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aVSpaceMF.SetUpHdl(aLk);
|
|
|
|
|
aRowsNF.SetUpHdl(aLk);
|
|
|
|
|
aColsNF.SetUpHdl(aLk);
|
|
|
|
|
aLSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aRSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aTSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aBSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aHSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aVSpaceMF.SetDownHdl(aLk);
|
|
|
|
|
aRowsNF.SetDownHdl(aLk);
|
|
|
|
|
aColsNF.SetDownHdl(aLk);
|
|
|
|
|
aLSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aRSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aTSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aBSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aHSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aVSpaceMF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aRowsNF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aColsNF.SetLoseFocusHdl(aLk);
|
|
|
|
|
aLandscapeRB.SetClickHdl(aLk);
|
|
|
|
|
aPortraitRB.SetClickHdl(aLk);
|
|
|
|
|
|
|
|
|
|
ModifyHdl(0);
|
|
|
|
|
if(bStandard)
|
|
|
|
|
StandardHdl(&aStandardPB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* -----------------19.08.98 13:36-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwPreviewPrintOptionsDialog::~SwPreviewPrintOptionsDialog()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/* -----------------12.11.98 11:32-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwPreviewPrintOptionsDialog::FillControls(SwPagePreViewPrtData& rData)
|
|
|
|
|
{
|
|
|
|
|
aLSpaceMF.SetValue(aLSpaceMF.Normalize(rData.GetLeftSpace() ), FUNIT_TWIP);
|
|
|
|
|
aRSpaceMF.SetValue(aRSpaceMF.Normalize(rData.GetRightSpace() ), FUNIT_TWIP);
|
|
|
|
|
aTSpaceMF.SetValue(aTSpaceMF.Normalize(rData.GetTopSpace() ), FUNIT_TWIP);
|
|
|
|
|
aBSpaceMF.SetValue(aBSpaceMF.Normalize(rData.GetBottomSpace()), FUNIT_TWIP);
|
|
|
|
|
aHSpaceMF.SetValue(aHSpaceMF.Normalize(rData.GetHorzSpace() ), FUNIT_TWIP);
|
|
|
|
|
aVSpaceMF.SetValue(aVSpaceMF.Normalize(rData.GetVertSpace() ), FUNIT_TWIP);
|
|
|
|
|
aRowsNF.SetValue(rData.GetRow());
|
|
|
|
|
aColsNF.SetValue(rData.GetCol());
|
|
|
|
|
aSettings.bPrinterLandscape ? aLandscapeRB.Check() : aPortraitRB.Check();
|
|
|
|
|
// wenn Drucker und Einstellungen nicht uebereinstimmen, dann Seiten tauschen
|
|
|
|
|
if( rData.GetLandscape() != aSettings.bPrinterLandscape )
|
|
|
|
|
{
|
|
|
|
|
Size aTmp(aSettings.aPrtSize.Height(), aSettings.aPrtSize.Width());
|
|
|
|
|
aSettings.aPrtSize = aTmp;
|
|
|
|
|
aSettings.bPrinterLandscape = !aSettings.bPrinterLandscape;
|
|
|
|
|
// nochmal setzen, denn auch wenn nur die Default-Orientierung dem Drucker
|
|
|
|
|
// angepasst wurde, sollen die Einstellungen gespeichert werden
|
|
|
|
|
aSettings.bPrinterLandscape ? aLandscapeRB.Check() : aPortraitRB.Check();
|
|
|
|
|
}
|
|
|
|
|
aLandscapeRB.SaveValue();
|
|
|
|
|
aPortraitRB.SaveValue();
|
|
|
|
|
|
|
|
|
|
aSettings.nLeft = rData.GetLeftSpace() ;
|
|
|
|
|
aSettings.nRight = rData.GetRightSpace() ;
|
|
|
|
|
aSettings.nTop = rData.GetTopSpace() ;
|
|
|
|
|
aSettings.nBottom = rData.GetBottomSpace();
|
|
|
|
|
aSettings.nHori = rData.GetHorzSpace() ;
|
|
|
|
|
aSettings.nVert = rData.GetVertSpace() ;
|
|
|
|
|
aSettings.nRows = rData.GetRow() ;
|
|
|
|
|
aSettings.nCols = rData.GetCol() ;
|
|
|
|
|
aSettings.aPrvPrtSize = aSettings.aPrtSize ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -----------------19.08.98 14:31-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwPreviewPrintOptionsDialog::Apply()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
SwDoc* pDoc = rPreView.GetDocShell()->GetDoc();
|
|
|
|
|
if(bStandard)
|
|
|
|
|
pDoc->SetPreViewPrtData(0);
|
|
|
|
|
else if( aLSpaceMF.GetSavedValue() != aLSpaceMF.GetText() ||
|
|
|
|
|
aRSpaceMF.GetSavedValue() != aRSpaceMF.GetText() ||
|
|
|
|
|
aTSpaceMF.GetSavedValue() != aTSpaceMF.GetText() ||
|
|
|
|
|
aBSpaceMF.GetSavedValue() != aBSpaceMF.GetText() ||
|
|
|
|
|
aHSpaceMF.GetSavedValue() != aHSpaceMF.GetText() ||
|
|
|
|
|
aVSpaceMF.GetSavedValue() != aVSpaceMF.GetText() ||
|
|
|
|
|
aRowsNF.GetSavedValue() != aRowsNF.GetText() ||
|
|
|
|
|
aColsNF.GetSavedValue() != aColsNF.GetText() ||
|
|
|
|
|
aLandscapeRB.GetSavedValue() != aLandscapeRB.IsChecked() ||
|
|
|
|
|
aPortraitRB.GetSavedValue() != aPortraitRB.IsChecked() )
|
|
|
|
|
{
|
|
|
|
|
SwPagePreViewPrtData aData;
|
|
|
|
|
if(pDoc->GetPreViewPrtData())
|
|
|
|
|
aData = *pDoc->GetPreViewPrtData();
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aData.SetLeftSpace( static_cast< ULONG >(aLSpaceMF.Denormalize(aLSpaceMF.GetValue(FUNIT_TWIP))) );
|
|
|
|
|
aData.SetRightSpace( static_cast< ULONG >(aRSpaceMF.Denormalize(aRSpaceMF.GetValue(FUNIT_TWIP))) );
|
|
|
|
|
aData.SetTopSpace( static_cast< ULONG >(aTSpaceMF.Denormalize(aTSpaceMF.GetValue(FUNIT_TWIP))) );
|
|
|
|
|
aData.SetBottomSpace( static_cast< ULONG >(aBSpaceMF.Denormalize(aBSpaceMF.GetValue(FUNIT_TWIP))) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aData.SetHorzSpace( static_cast< ULONG >(aHSpaceMF.Denormalize(aHSpaceMF.GetValue(FUNIT_TWIP))) );
|
|
|
|
|
aData.SetVertSpace( static_cast< ULONG >(aVSpaceMF.Denormalize(aVSpaceMF.GetValue(FUNIT_TWIP))) );
|
2001-05-17 08:32:40 +00:00
|
|
|
|
aData.SetRow((BYTE)aRowsNF.GetValue());
|
|
|
|
|
aData.SetCol((BYTE)aColsNF.GetValue());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aData.SetLandscape(aLandscapeRB.IsChecked());
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ViewShell& rViewSh = *rPreView.GetViewShell();
|
2006-08-14 16:56:12 +00:00
|
|
|
|
SfxPrinter* pPrinter = rViewSh.getIDocumentDeviceAccess()->getPrinter( true );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if((pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE)
|
|
|
|
|
!= aData.GetLandscape())
|
|
|
|
|
pPrinter->SetOrientation(aData.GetLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pDoc->SetPreViewPrtData(&aData);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* -----------------20.08.98 08:48-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
IMPL_LINK( SwPreviewPrintOptionsDialog, ModifyHdl, Edit*, pEdit )
|
|
|
|
|
{
|
|
|
|
|
if(bStandard && pEdit)
|
|
|
|
|
{
|
|
|
|
|
aLSpaceMF.SetUserValue(aLSpaceMF.GetValue());
|
|
|
|
|
aRSpaceMF.SetUserValue(aRSpaceMF.GetValue());
|
|
|
|
|
aTSpaceMF.SetUserValue(aTSpaceMF.GetValue());
|
|
|
|
|
aBSpaceMF.SetUserValue(aBSpaceMF.GetValue());
|
|
|
|
|
aHSpaceMF.SetUserValue(aHSpaceMF.GetValue());
|
|
|
|
|
aVSpaceMF.SetUserValue(aVSpaceMF.GetValue());
|
|
|
|
|
aRowsNF. SetUserValue(aRowsNF .GetValue());
|
|
|
|
|
aColsNF. SetUserValue(aColsNF .GetValue());
|
|
|
|
|
|
|
|
|
|
bStandard = FALSE;
|
|
|
|
|
}
|
|
|
|
|
BOOL bOrientChanged = aSettings.bPrinterLandscape != aLandscapeRB.IsChecked();;
|
|
|
|
|
if(pEdit == &aLSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nLeft = static_cast< long >(aLSpaceMF.Denormalize(aLSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aRSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nRight = static_cast< long >(aRSpaceMF.Denormalize(aRSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aTSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nTop = static_cast< long >(aTSpaceMF.Denormalize(aTSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aBSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nBottom = static_cast< long >(aBSpaceMF.Denormalize(aBSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aHSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nHori = static_cast< long >(aHSpaceMF.Denormalize(aHSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aVSpaceMF)
|
2007-09-27 11:35:25 +00:00
|
|
|
|
aSettings.nVert = static_cast< long >(aVSpaceMF.Denormalize(aVSpaceMF.GetValue(FUNIT_TWIP)));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aRowsNF)
|
2001-05-17 08:32:40 +00:00
|
|
|
|
aSettings.nRows = (USHORT)aRowsNF.GetValue();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == &aColsNF)
|
2001-05-17 08:32:40 +00:00
|
|
|
|
aSettings.nCols = (USHORT)aColsNF.GetValue();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if(pEdit == (Edit*)&aLandscapeRB)
|
|
|
|
|
aSettings.bPrinterLandscape = aLandscapeRB.IsChecked();
|
|
|
|
|
else if(pEdit == (Edit*)&aPortraitRB)
|
|
|
|
|
aSettings.bPrinterLandscape = aLandscapeRB.IsChecked();
|
|
|
|
|
|
|
|
|
|
if(bOrientChanged)
|
|
|
|
|
{
|
|
|
|
|
Size aTmp(aSettings.aPrtSize.Height(), aSettings.aPrtSize.Width());
|
|
|
|
|
aSettings.aPrtSize = aTmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aSettings.aPrvPrtSize = Size(aSettings.aPrtSize.Width() - aSettings.nRight - aSettings.nLeft,
|
|
|
|
|
aSettings.aPrtSize.Height() - aSettings.nTop - aSettings.nBottom);
|
|
|
|
|
aSettings.aGridSize = Size(aSettings.aPrvPrtSize.Width() / aSettings.nCols,
|
|
|
|
|
aSettings.aPrvPrtSize.Height() / aSettings.nRows );
|
|
|
|
|
// was fehlt noch: Orientation auswerten, minimalrand ausrechnen, Beispiel fuettern
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//am Ende Maximalwerte setzen
|
|
|
|
|
long n20Percent = aSettings.aPrtSize.Width() / 5;
|
|
|
|
|
aLSpaceMF.SetMax(aLSpaceMF.Normalize(aSettings.aPrtSize.Width() - aSettings.nRight - n20Percent), FUNIT_TWIP);
|
|
|
|
|
aRSpaceMF.SetMax(aRSpaceMF.Normalize(aSettings.aPrtSize.Width() - aSettings.nLeft - n20Percent), FUNIT_TWIP);
|
|
|
|
|
n20Percent = aSettings.aPrtSize.Height() / 5;
|
|
|
|
|
aTSpaceMF.SetMax(aTSpaceMF.Normalize(aSettings.aPrtSize.Height() - aSettings.nBottom - n20Percent), FUNIT_TWIP);
|
|
|
|
|
aBSpaceMF.SetMax(aBSpaceMF.Normalize(aSettings.aPrtSize.Height() - aSettings.nTop - n20Percent), FUNIT_TWIP);
|
|
|
|
|
|
|
|
|
|
long n80Percent = aSettings.aPrvPrtSize.Width() * 4 / 5;
|
|
|
|
|
aHSpaceMF.SetMax(aHSpaceMF.Normalize(n80Percent / aSettings.nRows), FUNIT_TWIP);
|
|
|
|
|
n80Percent = aSettings.aPrvPrtSize.Height()* 4 / 5;
|
|
|
|
|
aVSpaceMF.SetMax(aVSpaceMF.Normalize(n80Percent / aSettings.nCols), FUNIT_TWIP);
|
|
|
|
|
aHSpaceMF.Enable(aSettings.nCols > 1);
|
|
|
|
|
aVSpaceMF.Enable(aSettings.nRows > 1);
|
|
|
|
|
aRowsNF.SetMin(1);// nur damit auch nach Standard wieder der Inhalt angezeigt wird
|
|
|
|
|
aColsNF.SetMin(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aPreviewWin.Invalidate();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/* -----------------28.08.98 14:59-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
IMPL_LINK( SwPreviewPrintOptionsDialog, StandardHdl, PushButton*, EMPTYARG )
|
|
|
|
|
{
|
|
|
|
|
SetUpdateMode(TRUE);
|
|
|
|
|
SwPagePreViewPrtData aData;
|
2002-12-02 13:45:09 +00:00
|
|
|
|
aData.SetRow(rParentWin.GetRow());
|
|
|
|
|
aData.SetCol(rParentWin.GetCol());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FillControls(aData);
|
|
|
|
|
bStandard = TRUE;
|
|
|
|
|
aLSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aRSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aTSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aBSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aHSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aVSpaceMF.SetText(aEmptyStr);
|
|
|
|
|
aPreviewWin.Invalidate();
|
|
|
|
|
SetUpdateMode(FALSE);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/* -----------------20.08.98 15:28-------------------
|
|
|
|
|
* Preview anzeigen
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void PrtPrvWindow::Paint(const Rectangle&)
|
|
|
|
|
{
|
|
|
|
|
Size aWinSize(GetOutputSizePixel());
|
|
|
|
|
long nWidth = rSettings.aPrtSize.Width();
|
|
|
|
|
long nHeight = rSettings.aPrtSize.Height();
|
|
|
|
|
BOOL bHoriValid = (aWinSize.Width() * 100 / aWinSize.Height()) <
|
|
|
|
|
(rSettings.aPrtSize.Width() * 100/ rSettings.aPrtSize.Height());
|
2001-10-08 12:52:46 +00:00
|
|
|
|
Fraction aXScale( aWinSize.Width(), Max( nWidth , 1L ) );
|
|
|
|
|
Fraction aYScale( aWinSize.Height(), Max( nHeight, 1L ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
MapMode aMapMode( GetMapMode() );
|
|
|
|
|
aMapMode.SetScaleX( bHoriValid ? aXScale : aYScale);
|
|
|
|
|
aMapMode.SetScaleY( bHoriValid ? aXScale : aYScale);
|
|
|
|
|
SetMapMode( aMapMode );
|
|
|
|
|
|
|
|
|
|
aWinSize = GetOutputSize();
|
|
|
|
|
|
|
|
|
|
Point aOffset(0,0);
|
|
|
|
|
if(bHoriValid)
|
|
|
|
|
aOffset.Y() = (aWinSize.Height() - rSettings.aPrtSize.Height()) / 2;
|
|
|
|
|
else
|
|
|
|
|
aOffset.X() = (aWinSize.Width() - rSettings.aPrtSize.Width()) / 2;;
|
|
|
|
|
|
2002-11-22 09:32:15 +00:00
|
|
|
|
|
2002-12-06 14:57:40 +00:00
|
|
|
|
BOOL bUseSystemColors = SvtAccessibilityOptions().GetIsForPagePreviews()
|
|
|
|
|
&& GetSettings().GetStyleSettings().GetHighContrastMode();
|
2002-11-22 09:32:15 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
//der weisse Seitenhintergrund
|
|
|
|
|
Rectangle aRect(aOffset, rSettings.aPrtSize);
|
2002-12-06 14:57:40 +00:00
|
|
|
|
if(bUseSystemColors)
|
2002-11-22 09:32:15 +00:00
|
|
|
|
{
|
|
|
|
|
SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
|
2002-12-10 09:26:19 +00:00
|
|
|
|
SetLineColor( SwViewOption::GetFontColor() );
|
2002-11-22 09:32:15 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SetFillColor( Color( COL_WHITE ) );
|
|
|
|
|
SetLineColor(Color( COL_BLACK ) );
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
DrawRect(aRect);
|
|
|
|
|
|
|
|
|
|
Point aTL(aOffset);
|
|
|
|
|
aTL.X() += rSettings.nLeft;
|
|
|
|
|
aTL.Y() += rSettings.nTop;
|
|
|
|
|
|
|
|
|
|
Size aPrvPageSize((rSettings.aPrvPrtSize.Width() - (rSettings.nCols - 1) * rSettings.nHori) / rSettings.nCols,
|
|
|
|
|
(rSettings.aPrvPrtSize.Height() - (rSettings.nRows - 1) * rSettings.nVert) / rSettings.nRows);
|
|
|
|
|
// jetzt muss noch das unterschiedliche Groessenverhaeltnis berechnet werden, um es an
|
|
|
|
|
// der richtigen Seite abzuziehen.
|
|
|
|
|
//...
|
|
|
|
|
long nSourceScale = rSettings.aPageMaxSize.Width() * 100 / rSettings.aPageMaxSize.Height();
|
|
|
|
|
long nDestScale = aPrvPageSize.Width() * 100 / aPrvPageSize.Height() ;
|
|
|
|
|
if(nSourceScale > nDestScale) // die Seite ist relativ breiter als das vorhandene Rechteck
|
|
|
|
|
{
|
|
|
|
|
aPrvPageSize.Height() = aPrvPageSize.Width() * 100 / nSourceScale;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aPrvPageSize.Width() = aPrvPageSize.Height() * nSourceScale / 100;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-06 14:57:40 +00:00
|
|
|
|
if(bUseSystemColors)
|
2002-12-02 17:56:29 +00:00
|
|
|
|
SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
|
2002-11-22 09:32:15 +00:00
|
|
|
|
else
|
|
|
|
|
SetFillColor( Color( COL_GRAY ) );
|
|
|
|
|
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aRect = Rectangle(aTL, aPrvPageSize);
|
|
|
|
|
for(USHORT i = 0; i < rSettings.nRows; i++)
|
|
|
|
|
{
|
|
|
|
|
for(USHORT j = 0; j < rSettings.nCols; j++)
|
|
|
|
|
{
|
|
|
|
|
DrawRect(aRect);
|
|
|
|
|
aRect.Move(aPrvPageSize.Width() + rSettings.nHori, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aRect.Move( 0, aPrvPageSize.Height() + rSettings.nVert);
|
|
|
|
|
aRect.SetPos(Point(aTL.X(), aRect.TopLeft().Y()));
|
|
|
|
|
}
|
|
|
|
|
//rSettings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
// alles fuers SwPagePreViewWin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
|
|
|
|
|
: Window( pParent, WinBits( WB_CLIPCHILDREN) ),
|
2002-12-03 14:35:28 +00:00
|
|
|
|
mpViewShell( 0 ),
|
|
|
|
|
mrView( rPView ),
|
|
|
|
|
mbCalcScaleForPreviewLayout( true ),
|
|
|
|
|
maPaintedPreviewDocRect( Rectangle(0,0,0,0) )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW ); //#106611#
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SetHelpId(HID_PAGEPREVIEW);
|
|
|
|
|
SetFillColor( GetBackground().GetColor() );
|
|
|
|
|
SetLineColor( GetBackground().GetColor());
|
|
|
|
|
SetMapMode( MapMode(MAP_TWIP) );
|
|
|
|
|
|
|
|
|
|
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(FALSE);
|
2002-12-03 14:35:28 +00:00
|
|
|
|
mnRow = pUsrPref->GetPagePrevRow(); // 1 Zeile
|
|
|
|
|
mnCol = pUsrPref->GetPagePrevCol(); // 1 Spalte
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - member <mnVirtPage> no longer exists.
|
|
|
|
|
mnSttPage = USHRT_MAX;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwPagePreViewWin::~SwPagePreViewWin()
|
|
|
|
|
{
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( mpViewShell )
|
|
|
|
|
delete mpViewShell;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::Paint( const Rectangle& rRect )
|
|
|
|
|
{
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( !mpViewShell || !mpViewShell->GetLayout() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( USHRT_MAX == mnSttPage ) // wurde noch nie berechnet ? (Init-Phase!)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
// das ist die Size, auf die ich mich immer beziehe
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( !maPxWinSize.Height() || !maPxWinSize.Width() )
|
|
|
|
|
maPxWinSize = GetOutputSizePixel();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
Rectangle aRect( LogicToPixel( rRect ));
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Prepare( 1, Point(0,0), maPxWinSize,
|
2003-04-17 09:16:40 +00:00
|
|
|
|
mnSttPage, maPaintedPreviewDocRect );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SetSelectedPage( 1 );
|
|
|
|
|
mpPgPrevwLayout->Paint( PixelToLogic( aRect ) );
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SetPagePreview(mnRow, mnCol);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MapMode aMM( GetMapMode() );
|
2002-12-03 14:35:28 +00:00
|
|
|
|
aMM.SetScaleX( maScale );
|
|
|
|
|
aMM.SetScaleY( maScale );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SetMapMode( aMM );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Paint( rRect );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
void SwPagePreViewWin::CalcWish( BYTE nNewRow, BYTE nNewCol )
|
|
|
|
|
{
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( !mpViewShell || !mpViewShell->GetLayout() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
USHORT nOldCol = mnCol;
|
|
|
|
|
// OD 02.12.2002 #103492# - update <mnRow> and <mnCol>.
|
|
|
|
|
mnRow = nNewRow;
|
|
|
|
|
mnCol = nNewCol;
|
|
|
|
|
USHORT nPages = mnRow * mnCol,
|
|
|
|
|
nLastSttPg = mrView.GetPageCount()+1 > nPages
|
|
|
|
|
? mrView.GetPageCount()+1 - nPages : 0;
|
|
|
|
|
if( mnSttPage > nLastSttPg )
|
|
|
|
|
mnSttPage = nLastSttPg;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true );
|
|
|
|
|
mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize,
|
2003-04-17 09:16:40 +00:00
|
|
|
|
mnSttPage, maPaintedPreviewDocRect );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SetSelectedPage( mnSttPage );
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SetPagePreview(mnRow, mnCol);
|
|
|
|
|
maScale = GetMapMode().GetScaleX();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
// falls an der Spaltigkeit gedreht wurde, so muss der Sonderfall
|
|
|
|
|
// Einspaltig beachtet und ggfs. der Scrollbar korrigiert werden
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( (1 == nOldCol) ^ (1 == mnCol) )
|
2002-12-04 11:17:32 +00:00
|
|
|
|
mrView.ScrollDocSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
// Sortierung muss eingehalten werden!!
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - additional invalidate page status.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
2002-12-02 07:36:05 +00:00
|
|
|
|
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN,
|
|
|
|
|
FN_PREVIEW_ZOOM,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
|
2003-04-17 09:16:40 +00:00
|
|
|
|
FN_STAT_PAGE, FN_STAT_ZOOM,
|
2002-12-06 13:15:24 +00:00
|
|
|
|
FN_SHOW_TWO_PAGES, FN_SHOW_MULTIPLE_PAGES,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
0
|
|
|
|
|
};
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
rBindings.Update( FN_SHOW_TWO_PAGES );
|
2002-12-06 13:15:24 +00:00
|
|
|
|
rBindings.Update( FN_SHOW_MULTIPLE_PAGES );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 18.12.2002 #103492# - adjust scrollbars
|
|
|
|
|
mrView.ScrollViewSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
/*--------------------------------------------------------------------
|
2005-12-21 14:13:15 +00:00
|
|
|
|
Beschreibung:, mnSttPage is Absolute
|
2000-09-18 16:15:01 +00:00
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int SwPagePreViewWin::MovePage( int eMoveMode )
|
|
|
|
|
{
|
|
|
|
|
// soviele Seiten hoch
|
2002-12-03 14:35:28 +00:00
|
|
|
|
USHORT nPages = mnRow * mnCol;
|
|
|
|
|
USHORT nNewSttPage = mnSttPage;
|
2002-12-06 15:25:21 +00:00
|
|
|
|
// OD 04.12.2002 #103492#
|
|
|
|
|
USHORT nPageCount = mrView.GetPageCount();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
USHORT nDefSttPg = GetDefSttPage();
|
2002-12-06 15:25:21 +00:00
|
|
|
|
// OD 06.12.2002 #103492#
|
|
|
|
|
bool bPaintPageAtFirstCol = true;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
switch( eMoveMode )
|
|
|
|
|
{
|
2002-12-03 14:35:28 +00:00
|
|
|
|
case MV_PAGE_UP:
|
2005-12-21 14:13:15 +00:00
|
|
|
|
{
|
|
|
|
|
const sal_uInt16 nRelSttPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( mnSttPage );
|
|
|
|
|
const sal_uInt16 nNewAbsSttPage = nRelSttPage - nPages > 0 ?
|
|
|
|
|
mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage - nPages ) :
|
|
|
|
|
nDefSttPg;
|
|
|
|
|
nNewSttPage = nNewAbsSttPage;
|
|
|
|
|
|
|
|
|
|
const sal_uInt16 nRelSelPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() );
|
|
|
|
|
const sal_uInt16 nNewRelSelPage = nRelSelPage - nPages > 0 ?
|
|
|
|
|
nRelSelPage - nPages :
|
|
|
|
|
1;
|
|
|
|
|
SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewRelSelPage ) );
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
break;
|
2005-12-21 14:13:15 +00:00
|
|
|
|
}
|
2002-12-03 14:35:28 +00:00
|
|
|
|
case MV_PAGE_DOWN:
|
2005-12-21 14:13:15 +00:00
|
|
|
|
{
|
|
|
|
|
const sal_uInt16 nRelSttPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( mnSttPage );
|
|
|
|
|
const sal_uInt16 nNewAbsSttPage = mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage + nPages );
|
|
|
|
|
nNewSttPage = nNewAbsSttPage < nPageCount ? nNewAbsSttPage : nPageCount;
|
|
|
|
|
|
|
|
|
|
const sal_uInt16 nRelSelPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() );
|
|
|
|
|
const sal_uInt16 nNewAbsSelPage = mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSelPage + nPages );
|
|
|
|
|
SetSelectedPage( nNewAbsSelPage < nPageCount ? nNewAbsSelPage : nPageCount );
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
break;
|
2005-12-21 14:13:15 +00:00
|
|
|
|
}
|
2002-12-03 14:35:28 +00:00
|
|
|
|
case MV_DOC_STT:
|
|
|
|
|
nNewSttPage = nDefSttPg;
|
2005-12-21 14:13:15 +00:00
|
|
|
|
SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) );
|
2002-12-03 14:35:28 +00:00
|
|
|
|
break;
|
|
|
|
|
case MV_DOC_END:
|
|
|
|
|
// OD 03.12.2002 #103492# - correct calculation of new start page.
|
2002-12-06 15:25:21 +00:00
|
|
|
|
nNewSttPage = nPageCount;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SetSelectedPage( nPageCount );
|
2002-12-03 14:35:28 +00:00
|
|
|
|
break;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 12.12.2002 #103492# - add new move mode
|
|
|
|
|
case MV_SELPAGE:
|
|
|
|
|
// <nNewSttPage> and <SelectedPage()> are already set.
|
|
|
|
|
// OD 20.02.2003 #107369# - not start at first column, only if the
|
|
|
|
|
// complete preview layout columns doesn't fit into window.
|
|
|
|
|
if ( !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
|
|
|
|
|
bPaintPageAtFirstCol = false;
|
|
|
|
|
break;
|
|
|
|
|
case MV_SCROLL:
|
|
|
|
|
// OD 17.01.2003 #103492# - check, if paint page at first column
|
|
|
|
|
// has to be avoided
|
|
|
|
|
if ( !mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() ||
|
|
|
|
|
!mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
|
|
|
|
|
bPaintPageAtFirstCol = false;
|
|
|
|
|
break;
|
|
|
|
|
case MV_NEWWINSIZE:
|
|
|
|
|
// OD 18.12.2002 #103492# - nothing special to do.
|
|
|
|
|
break;
|
|
|
|
|
case MV_CALC:
|
|
|
|
|
// OD 18.12.2002 #103492# - re-init page preview layout.
|
|
|
|
|
mpPgPrevwLayout->ReInit();
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
// OD 03.12.2002 #103492# - correct calculation of new start page.
|
2002-12-06 15:25:21 +00:00
|
|
|
|
if( nNewSttPage > nPageCount )
|
|
|
|
|
nNewSttPage = nPageCount;
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 18.12.2002 #103492# - correct selected page number
|
|
|
|
|
if( SelectedPage() > nPageCount )
|
|
|
|
|
SetSelectedPage( nNewSttPage ? nNewSttPage : 1 );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Prepare( nNewSttPage, Point(0,0), maPxWinSize,
|
2003-04-17 09:16:40 +00:00
|
|
|
|
nNewSttPage,
|
2003-03-27 14:45:43 +00:00
|
|
|
|
maPaintedPreviewDocRect, bPaintPageAtFirstCol );
|
|
|
|
|
if( nNewSttPage == mnSttPage &&
|
|
|
|
|
eMoveMode != MV_SELPAGE )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SetPagePreview(mnRow, mnCol);
|
|
|
|
|
mnSttPage = nNewSttPage;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - additional invalidate page status.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
2003-04-17 09:16:40 +00:00
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
|
|
|
|
|
FN_STAT_PAGE, 0
|
2000-09-18 16:15:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::SetWinSize( const Size& rNewSize )
|
|
|
|
|
{
|
|
|
|
|
// die Size wollen wir aber immer in Pixel-Einheiten haben
|
2002-12-03 14:35:28 +00:00
|
|
|
|
maPxWinSize = LogicToPixel( rNewSize );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
if( USHRT_MAX == mnSttPage )
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
mnSttPage = GetDefSttPage();
|
|
|
|
|
SetSelectedPage( GetDefSttPage() );
|
|
|
|
|
}
|
2002-12-02 06:57:41 +00:00
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if ( mbCalcScaleForPreviewLayout )
|
2002-12-02 06:57:41 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true );
|
|
|
|
|
maScale = GetMapMode().GetScaleX();
|
2002-12-02 06:57:41 +00:00
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize,
|
2003-04-17 09:16:40 +00:00
|
|
|
|
mnSttPage, maPaintedPreviewDocRect );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if ( mbCalcScaleForPreviewLayout )
|
2002-03-20 08:18:37 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SetSelectedPage( mnSttPage );
|
|
|
|
|
mbCalcScaleForPreviewLayout = false;
|
2002-03-20 08:18:37 +00:00
|
|
|
|
}
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SetPagePreview(mnRow, mnCol);
|
|
|
|
|
maScale = GetMapMode().GetScaleX();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::GetStatusStr( String& rStr, USHORT nPageCnt ) const
|
|
|
|
|
{
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - show physical and virtual page number of
|
|
|
|
|
// selected page, if it's visible.
|
|
|
|
|
sal_uInt16 nPageNum;
|
|
|
|
|
if ( mpPgPrevwLayout->IsPageVisible( mpPgPrevwLayout->SelectedPage() ) )
|
|
|
|
|
{
|
|
|
|
|
nPageNum = mpPgPrevwLayout->SelectedPage();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nPageNum = mnSttPage > 1 ? mnSttPage : 1;
|
|
|
|
|
}
|
|
|
|
|
sal_uInt16 nVirtPageNum = mpPgPrevwLayout->GetVirtPageNumByPageNum( nPageNum );
|
|
|
|
|
if( nVirtPageNum && nVirtPageNum != nPageNum )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-04-17 09:16:40 +00:00
|
|
|
|
rStr += String::CreateFromInt32( nVirtPageNum );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rStr += ' ';
|
|
|
|
|
}
|
2003-04-17 09:16:40 +00:00
|
|
|
|
rStr += String::CreateFromInt32( nPageNum );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" / "));
|
|
|
|
|
rStr += String::CreateFromInt32( nPageCnt );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt )
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
|
|
|
|
|
USHORT nKey = rKeyCode.GetCode();
|
|
|
|
|
BOOL bHandled = FALSE;
|
|
|
|
|
if(!rKeyCode.GetModifier())
|
|
|
|
|
{
|
|
|
|
|
USHORT nSlot = 0;
|
|
|
|
|
switch(nKey)
|
|
|
|
|
{
|
|
|
|
|
case KEY_ADD : nSlot = SID_ZOOM_OUT; break;
|
2006-03-07 09:47:51 +00:00
|
|
|
|
case KEY_ESCAPE: nSlot = FN_CLOSE_PAGEPREVIEW; break;
|
2002-12-04 11:17:32 +00:00
|
|
|
|
case KEY_SUBTRACT : nSlot = SID_ZOOM_IN; break;
|
|
|
|
|
}
|
|
|
|
|
if(nSlot)
|
|
|
|
|
{
|
|
|
|
|
bHandled = TRUE;
|
|
|
|
|
mrView.GetViewFrame()->GetDispatcher()->Execute(
|
|
|
|
|
nSlot, SFX_CALLMODE_ASYNCHRON );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( !bHandled && !mrView.KeyInput( rKEvt ) )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
Window::KeyInput( rKEvt );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Beschreibung:
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
|
|
|
|
|
{
|
|
|
|
|
BOOL bCallBase = TRUE;
|
|
|
|
|
switch( rCEvt.GetCommand() )
|
|
|
|
|
{
|
2008-03-18 15:04:21 +00:00
|
|
|
|
case COMMAND_CONTEXTMENU:
|
|
|
|
|
mrView.GetViewFrame()->GetDispatcher()->ExecutePopup();
|
|
|
|
|
bCallBase = FALSE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2008-06-06 12:42:43 +00:00
|
|
|
|
case COMMAND_WHEEL:
|
|
|
|
|
case COMMAND_STARTAUTOSCROLL:
|
|
|
|
|
case COMMAND_AUTOSCROLL:
|
|
|
|
|
{
|
|
|
|
|
const CommandWheelData* pData = rCEvt.GetWheelData();
|
|
|
|
|
if( pData )
|
|
|
|
|
{
|
|
|
|
|
const CommandWheelData aDataNew(pData->GetDelta(),pData->GetNotchDelta(),COMMAND_WHEEL_PAGESCROLL,
|
|
|
|
|
pData->GetMode(),pData->GetModifier(),pData->IsHorz());
|
|
|
|
|
const CommandEvent aEvent( rCEvt.GetMousePosPixel(),rCEvt.GetCommand(),rCEvt.IsMouseEvent(),&aDataNew);
|
|
|
|
|
bCallBase = !mrView.HandleWheelCommands( aEvent );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
bCallBase = !mrView.HandleWheelCommands( rCEvt );
|
2008-03-18 15:04:21 +00:00
|
|
|
|
}
|
2008-06-06 12:42:43 +00:00
|
|
|
|
break;
|
2008-03-18 15:04:21 +00:00
|
|
|
|
default:
|
|
|
|
|
// OD 17.12.2002 #103492# - delete assertion
|
|
|
|
|
;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bCallBase )
|
|
|
|
|
Window::Command( rCEvt );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 17.12.2002 #103492# - consider single-click to set selected page
|
|
|
|
|
if( MOUSE_LEFT == ( rMEvt.GetModifier() + rMEvt.GetButtons() ) )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
Point aPrevwPos( PixelToLogic( rMEvt.GetPosPixel() ) );
|
|
|
|
|
Point aDocPos;
|
|
|
|
|
bool bPosInEmptyPage;
|
|
|
|
|
sal_uInt16 nNewSelectedPage;
|
|
|
|
|
bool bIsDocPos =
|
|
|
|
|
mpPgPrevwLayout->IsPrevwPosInDocPrevwPage( aPrevwPos,
|
|
|
|
|
aDocPos, bPosInEmptyPage, nNewSelectedPage );
|
|
|
|
|
if ( bIsDocPos && rMEvt.GetClicks() == 2 )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// close page preview, set new cursor position and switch to
|
|
|
|
|
// normal view.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
String sNewCrsrPos( String::CreateFromInt32( aDocPos.X() ));
|
|
|
|
|
((( sNewCrsrPos += ';' )
|
|
|
|
|
+= String::CreateFromInt32( aDocPos.Y() )) )
|
|
|
|
|
+= ';';
|
2002-12-03 14:35:28 +00:00
|
|
|
|
mrView.SetNewCrsrPos( sNewCrsrPos );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2002-12-03 14:35:28 +00:00
|
|
|
|
SfxViewFrame *pTmpFrm = mrView.GetViewFrame();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pTmpFrm->GetBindings().Execute( SID_VIEWSHELL0, NULL, 0,
|
|
|
|
|
SFX_CALLMODE_ASYNCHRON );
|
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
else if ( bIsDocPos || bPosInEmptyPage )
|
2004-04-21 08:41:45 +00:00
|
|
|
|
// OD 2004-03-04 #i20684# - add missing parenthesis
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// show clicked page as the selected one
|
|
|
|
|
mpPgPrevwLayout->MarkNewSelectedPage( nNewSelectedPage );
|
|
|
|
|
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
|
|
|
|
|
// OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
|
|
|
|
|
if ( mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() )
|
|
|
|
|
{
|
|
|
|
|
mrView.SetVScrollbarThumbPos( nNewSelectedPage );
|
|
|
|
|
}
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - invalidate page status.
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
|
|
|
|
FN_STAT_PAGE, 0
|
|
|
|
|
};
|
|
|
|
|
SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
|
|
|
|
|
rBindings.Invalidate( aInval );
|
2004-04-21 08:41:45 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Beschreibung: Userprefs bzw Viewoptions setzen
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::SetPagePreview( BYTE nRow, BYTE nCol )
|
|
|
|
|
{
|
|
|
|
|
SwMasterUsrPref *pOpt = (SwMasterUsrPref *)SW_MOD()->GetUsrPref(FALSE);
|
|
|
|
|
|
|
|
|
|
if (nRow != pOpt->GetPagePrevRow() || nCol != pOpt->GetPagePrevCol())
|
|
|
|
|
{
|
|
|
|
|
pOpt->SetPagePrevRow( nRow );
|
|
|
|
|
pOpt->SetPagePrevCol( nCol );
|
|
|
|
|
pOpt->SetModified();
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
//Scrollbar updaten!
|
|
|
|
|
mrView.ScrollViewSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
/** get selected page in document preview
|
|
|
|
|
|
|
|
|
|
OD 13.12.2002 #103492#
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
*/
|
|
|
|
|
sal_uInt16 SwPagePreViewWin::SelectedPage() const
|
|
|
|
|
{
|
|
|
|
|
return mpPgPrevwLayout->SelectedPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** set selected page number in document preview
|
|
|
|
|
|
|
|
|
|
OD 13.12.2002 #103492#
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
*/
|
|
|
|
|
void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
|
|
|
|
|
{
|
|
|
|
|
mpPgPrevwLayout->SetSelectedPage( _nSelectedPageNum );
|
|
|
|
|
}
|
|
|
|
|
|
2004-04-21 08:41:45 +00:00
|
|
|
|
/** method to enable/disable book preview
|
|
|
|
|
|
|
|
|
|
OD 2004-03-05 #i18143#
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
*/
|
|
|
|
|
bool SwPagePreViewWin::SetBookPreviewMode( const bool _bBookPreview )
|
|
|
|
|
{
|
|
|
|
|
return mpPgPrevwLayout->SetBookPreviewMode( _bBookPreview,
|
|
|
|
|
mnSttPage,
|
|
|
|
|
maPaintedPreviewDocRect );
|
|
|
|
|
}
|
|
|
|
|
|
2001-11-30 11:54:23 +00:00
|
|
|
|
void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-11-30 11:54:23 +00:00
|
|
|
|
Window::DataChanged( rDCEvt );
|
|
|
|
|
|
|
|
|
|
switch( rDCEvt.GetType() )
|
|
|
|
|
{
|
|
|
|
|
case DATACHANGED_SETTINGS:
|
|
|
|
|
// ScrollBars neu anordnen bzw. Resize ausloesen, da sich
|
|
|
|
|
// ScrollBar-Groesse geaendert haben kann. Dazu muss dann im
|
|
|
|
|
// Resize-Handler aber auch die Groesse der ScrollBars aus
|
|
|
|
|
// den Settings abgefragt werden.
|
|
|
|
|
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
|
2002-12-03 14:35:28 +00:00
|
|
|
|
mrView.InvalidateBorder(); //Scrollbarbreiten
|
2003-03-27 14:45:43 +00:00
|
|
|
|
//#106746# zoom has to be disabled if Accessibility support is switched on
|
|
|
|
|
lcl_InvalidateZoomSlots(mrView.GetViewFrame()->GetBindings());
|
2001-11-30 11:54:23 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DATACHANGED_PRINTER:
|
|
|
|
|
case DATACHANGED_DISPLAY:
|
|
|
|
|
case DATACHANGED_FONTS:
|
|
|
|
|
case DATACHANGED_FONTSUBSTITUTION:
|
2002-12-03 14:35:28 +00:00
|
|
|
|
mrView.GetDocShell()->UpdateFontList(); //Fontwechsel
|
|
|
|
|
if ( mpViewShell->GetWin() )
|
|
|
|
|
mpViewShell->GetWin()->Invalidate();
|
2001-11-30 11:54:23 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
/** help method to execute SfxRequest FN_PAGEUP and FN_PAGEDOWN
|
|
|
|
|
|
|
|
|
|
OD 04.03.2003 #107369#
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
*/
|
|
|
|
|
void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
|
|
|
|
|
SfxRequest* _pReq )
|
|
|
|
|
{
|
|
|
|
|
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
|
|
|
|
|
// check, if top/bottom of preview is *not* already visible.
|
|
|
|
|
if( pPagePrevwLay->GetWinPagesScrollAmount( _bPgUp ? -1 : 1 ) != 0 )
|
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() &&
|
|
|
|
|
pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() )
|
|
|
|
|
{
|
|
|
|
|
const int eMvMode = _bPgUp ?
|
|
|
|
|
SwPagePreViewWin::MV_PAGE_UP :
|
|
|
|
|
SwPagePreViewWin::MV_PAGE_DOWN;
|
|
|
|
|
if ( ChgPage( eMvMode, TRUE ) )
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SwTwips nScrollAmount;
|
|
|
|
|
sal_uInt16 nNewSelectedPageNum = 0;
|
|
|
|
|
const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
|
|
|
|
|
if( _bPgUp )
|
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() )
|
|
|
|
|
{
|
|
|
|
|
nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( -1 );
|
|
|
|
|
if ( (aViewWin.SelectedPage() - nVisPages) > 0 )
|
|
|
|
|
nNewSelectedPageNum = aViewWin.SelectedPage() - nVisPages;
|
|
|
|
|
else
|
|
|
|
|
nNewSelectedPageNum = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nScrollAmount = - Min( aViewWin.GetOutputSize().Height(),
|
|
|
|
|
aViewWin.GetPaintedPreviewDocRect().Top() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() )
|
|
|
|
|
{
|
|
|
|
|
nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( 1 );
|
|
|
|
|
if ( (aViewWin.SelectedPage() + nVisPages) <= mnPageCount )
|
|
|
|
|
nNewSelectedPageNum = aViewWin.SelectedPage() + nVisPages;
|
|
|
|
|
else
|
|
|
|
|
nNewSelectedPageNum = mnPageCount;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nScrollAmount = Min( aViewWin.GetOutputSize().Height(),
|
|
|
|
|
( pPagePrevwLay->GetPrevwDocSize().Height() -
|
|
|
|
|
aViewWin.GetPaintedPreviewDocRect().Bottom() ) );
|
|
|
|
|
}
|
|
|
|
|
aViewWin.Scroll( 0, nScrollAmount );
|
|
|
|
|
if ( nNewSelectedPageNum != 0 )
|
|
|
|
|
{
|
|
|
|
|
aViewWin.SetSelectedPage( nNewSelectedPageNum );
|
|
|
|
|
}
|
|
|
|
|
ScrollViewSzChg();
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - additional invalidate page status.
|
2003-03-27 14:45:43 +00:00
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
2003-04-17 09:16:40 +00:00
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
|
|
|
|
|
FN_STAT_PAGE, 0
|
2003-03-27 14:45:43 +00:00
|
|
|
|
};
|
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( _pReq )
|
|
|
|
|
_pReq->Done();
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
// dann mal alles fuer die SwPagePreView
|
|
|
|
|
void SwPagePreView::Execute( SfxRequest &rReq )
|
|
|
|
|
{
|
|
|
|
|
int eMvMode;
|
|
|
|
|
BYTE nRow = 1;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
BOOL bRetVal = FALSE;
|
|
|
|
|
bool bRefresh = true;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
switch(rReq.GetSlot())
|
|
|
|
|
{
|
|
|
|
|
case FN_REFRESH_VIEW:
|
|
|
|
|
case FN_STAT_PAGE:
|
|
|
|
|
case FN_STAT_ZOOM:
|
|
|
|
|
break;
|
|
|
|
|
|
2002-12-06 13:15:24 +00:00
|
|
|
|
case FN_SHOW_MULTIPLE_PAGES:
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
|
if( pArgs && pArgs->Count() >= 2 )
|
|
|
|
|
{
|
2001-05-17 08:32:40 +00:00
|
|
|
|
BYTE nCols = (BYTE)((SfxUInt16Item &)pArgs->Get(
|
2002-11-27 08:01:27 +00:00
|
|
|
|
SID_ATTR_TABLE_COLUMN)).GetValue();
|
2001-05-17 08:32:40 +00:00
|
|
|
|
BYTE nRows = (BYTE)((SfxUInt16Item &)pArgs->Get(
|
|
|
|
|
SID_ATTR_TABLE_ROW)).GetValue();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aViewWin.CalcWish( nRows, nCols );
|
2002-11-27 08:01:27 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SwPreViewZoomDlg( aViewWin ).Execute();
|
2002-11-27 08:01:27 +00:00
|
|
|
|
|
2004-04-21 08:41:45 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case FN_SHOW_BOOKVIEW:
|
|
|
|
|
{
|
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
|
bool bBookPreview = GetViewShell()->GetViewOptions()->IsPagePrevBookview();
|
|
|
|
|
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_SHOW_BOOKVIEW, FALSE, &pItem ) )
|
|
|
|
|
{
|
|
|
|
|
bBookPreview = static_cast< const SfxBoolItem* >( pItem )->GetValue();
|
|
|
|
|
( ( SwViewOption* ) GetViewShell()->GetViewOptions() )->SetPagePrevBookview( bBookPreview );
|
|
|
|
|
// cast is not gentleman like, but it's common use in writer and in this case
|
|
|
|
|
}
|
|
|
|
|
if ( aViewWin.SetBookPreviewMode( bBookPreview ) )
|
|
|
|
|
{
|
|
|
|
|
// book preview mode changed. Thus, adjust scrollbars and
|
|
|
|
|
// invalidate corresponding states.
|
|
|
|
|
ScrollViewSzChg();
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
|
|
|
|
|
FN_STAT_PAGE, FN_SHOW_BOOKVIEW, 0
|
|
|
|
|
};
|
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2002-11-27 08:01:27 +00:00
|
|
|
|
case FN_SHOW_TWO_PAGES:
|
|
|
|
|
aViewWin.CalcWish( nRow, 2 );
|
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2002-11-27 08:01:27 +00:00
|
|
|
|
case FN_PREVIEW_ZOOM:
|
|
|
|
|
case SID_ATTR_ZOOM:
|
|
|
|
|
{
|
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
|
const SfxPoolItem* pItem;
|
2004-02-03 15:56:59 +00:00
|
|
|
|
AbstractSvxZoomDialog *pDlg = 0;
|
2002-11-27 08:01:27 +00:00
|
|
|
|
if(!pArgs)
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aCoreSet(GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM);
|
2002-12-04 11:17:32 +00:00
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
2002-11-27 08:01:27 +00:00
|
|
|
|
SvxZoomItem aZoom( (SvxZoomType)pVOpt->GetZoomType(),
|
|
|
|
|
pVOpt->GetZoom() );
|
|
|
|
|
aZoom.SetValueSet(
|
|
|
|
|
SVX_ZOOM_ENABLE_50|
|
|
|
|
|
SVX_ZOOM_ENABLE_75|
|
|
|
|
|
SVX_ZOOM_ENABLE_100|
|
|
|
|
|
SVX_ZOOM_ENABLE_150|
|
|
|
|
|
SVX_ZOOM_ENABLE_200|
|
|
|
|
|
SVX_ZOOM_ENABLE_WHOLEPAGE);
|
|
|
|
|
aCoreSet.Put( aZoom );
|
|
|
|
|
|
2004-02-03 15:56:59 +00:00
|
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
|
if(pFact)
|
|
|
|
|
{
|
2007-04-26 08:21:14 +00:00
|
|
|
|
pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet, RID_SVXDLG_ZOOM);
|
2007-09-27 11:35:25 +00:00
|
|
|
|
DBG_ASSERT(pDlg, "Dialogdiet fail!");
|
2004-02-03 15:56:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-11-27 08:01:27 +00:00
|
|
|
|
pDlg->SetLimits( MINZOOM, MAXZOOM );
|
|
|
|
|
|
|
|
|
|
if( pDlg->Execute() != RET_CANCEL )
|
|
|
|
|
pArgs = pDlg->GetOutputItemSet();
|
|
|
|
|
}
|
|
|
|
|
if( pArgs )
|
|
|
|
|
{
|
|
|
|
|
enum SvxZoomType eType = SVX_ZOOM_PERCENT;
|
|
|
|
|
USHORT nZoomFactor = USHRT_MAX;
|
|
|
|
|
if(SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOM, TRUE, &pItem))
|
|
|
|
|
{
|
|
|
|
|
eType = ((const SvxZoomItem *)pItem)->GetType();
|
|
|
|
|
nZoomFactor = ((const SvxZoomItem *)pItem)->GetValue();
|
|
|
|
|
}
|
|
|
|
|
else if(SFX_ITEM_SET == pArgs->GetItemState(FN_PREVIEW_ZOOM, TRUE, &pItem))
|
|
|
|
|
nZoomFactor = ((const SfxUInt16Item *)pItem)->GetValue();
|
|
|
|
|
if(USHRT_MAX != nZoomFactor)
|
|
|
|
|
SetZoom(eType, nZoomFactor);
|
|
|
|
|
}
|
2002-12-02 07:36:05 +00:00
|
|
|
|
delete pDlg;
|
2002-11-27 08:01:27 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2008-03-07 14:06:36 +00:00
|
|
|
|
case SID_ATTR_ZOOMSLIDER :
|
|
|
|
|
{
|
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
|
|
|
|
|
|
if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, TRUE, &pItem ) )
|
|
|
|
|
{
|
|
|
|
|
const USHORT nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
|
|
|
|
|
SetZoom( SVX_ZOOM_PERCENT, nCurrentZoom );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-11-27 08:01:27 +00:00
|
|
|
|
case SID_ZOOM_IN:
|
|
|
|
|
case SID_ZOOM_OUT:
|
|
|
|
|
{
|
|
|
|
|
enum SvxZoomType eType = SVX_ZOOM_PERCENT;
|
2002-12-04 11:17:32 +00:00
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
2002-11-27 08:01:27 +00:00
|
|
|
|
SetZoom(eType,
|
|
|
|
|
lcl_GetNextZoomStep(pVOpt->GetZoom(), SID_ZOOM_IN == rReq.GetSlot()));
|
|
|
|
|
}
|
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_CHAR_LEFT:
|
|
|
|
|
case FN_CHAR_RIGHT:
|
|
|
|
|
case FN_LINE_UP:
|
|
|
|
|
case FN_LINE_DOWN:
|
2002-03-15 06:33:34 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
|
2002-12-06 15:25:21 +00:00
|
|
|
|
sal_uInt16 nNewSelectedPage;
|
|
|
|
|
sal_uInt16 nNewStartPage;
|
|
|
|
|
Point aNewStartPos;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
sal_Int16 nHoriMove = 0;
|
|
|
|
|
sal_Int16 nVertMove = 0;
|
|
|
|
|
switch(rReq.GetSlot())
|
|
|
|
|
{
|
|
|
|
|
case FN_CHAR_LEFT: nHoriMove = -1; break;
|
|
|
|
|
case FN_CHAR_RIGHT: nHoriMove = 1; break;
|
|
|
|
|
case FN_LINE_UP: nVertMove = -1; break;
|
|
|
|
|
case FN_LINE_DOWN: nVertMove = 1; break;
|
|
|
|
|
}
|
|
|
|
|
pPagePrevwLay->CalcStartValuesForSelectedPageMove( nHoriMove, nVertMove,
|
2002-12-06 15:25:21 +00:00
|
|
|
|
nNewSelectedPage, nNewStartPage, aNewStartPos );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if ( aViewWin.SelectedPage() != nNewSelectedPage )
|
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) )
|
|
|
|
|
{
|
|
|
|
|
pPagePrevwLay->MarkNewSelectedPage( nNewSelectedPage );
|
|
|
|
|
// OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
|
|
|
|
|
SetVScrollbarThumbPos( nNewSelectedPage );
|
|
|
|
|
bRefresh = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aViewWin.SetSelectedPage( nNewSelectedPage );
|
|
|
|
|
aViewWin.SetSttPage( nNewStartPage );
|
|
|
|
|
int nRet = ChgPage( SwPagePreViewWin::MV_SELPAGE, TRUE );
|
|
|
|
|
bRefresh = 0 != nRet;
|
|
|
|
|
}
|
|
|
|
|
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - invalidate page status.
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
|
|
|
|
FN_STAT_PAGE, 0
|
|
|
|
|
};
|
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
|
rBindings.Invalidate( aInval );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
rReq.Done();
|
|
|
|
|
}
|
2004-04-21 08:41:45 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bRefresh = false;
|
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
break;
|
2002-03-15 06:33:34 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_PAGEUP:
|
|
|
|
|
case FN_PAGEDOWN:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
_ExecPgUpAndPgDown( rReq.GetSlot() == FN_PAGEUP, &rReq );
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-03-15 06:33:34 +00:00
|
|
|
|
case FN_START_OF_LINE:
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_START_OF_DOCUMENT:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
aViewWin.SetSelectedPage( 1 );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
eMvMode = SwPagePreViewWin::MV_DOC_STT; bRetVal = TRUE; goto MOVEPAGE;
|
2002-03-15 06:33:34 +00:00
|
|
|
|
case FN_END_OF_LINE:
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_END_OF_DOCUMENT:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
aViewWin.SetSelectedPage( mnPageCount );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
eMvMode = SwPagePreViewWin::MV_DOC_END; bRetVal = TRUE; goto MOVEPAGE;
|
|
|
|
|
MOVEPAGE:
|
|
|
|
|
{
|
|
|
|
|
int nRet = ChgPage( eMvMode, TRUE );
|
|
|
|
|
// return value fuer Basic
|
|
|
|
|
if(bRetVal)
|
|
|
|
|
rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), nRet == 0));
|
|
|
|
|
|
|
|
|
|
bRefresh = 0 != nRet;
|
2002-11-25 10:49:52 +00:00
|
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FN_PRINT_PAGEPREVIEW:
|
|
|
|
|
{
|
|
|
|
|
const SwPagePreViewPrtData* pPPVPD = aViewWin.GetViewShell()->GetDoc()->GetPreViewPrtData();
|
|
|
|
|
// die Sache mit der Orientation
|
|
|
|
|
if(pPPVPD)
|
|
|
|
|
{
|
2005-04-01 15:34:16 +00:00
|
|
|
|
SfxPrinter* pPrinter = GetPrinter( TRUE );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if((pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE)
|
|
|
|
|
!= pPPVPD->GetLandscape())
|
|
|
|
|
pPrinter->SetOrientation(pPPVPD->GetLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
|
|
|
|
|
}
|
|
|
|
|
::SetAppPrintOptions( aViewWin.GetViewShell(), FALSE );
|
|
|
|
|
bNormalPrint = FALSE;
|
|
|
|
|
USHORT nPrtSlot = SID_PRINTDOC;
|
|
|
|
|
rReq.SetSlot( nPrtSlot );
|
|
|
|
|
SfxViewShell::ExecuteSlot( rReq, SfxViewShell::GetInterface() );
|
|
|
|
|
rReq.SetSlot( FN_PRINT_PAGEPREVIEW );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
case FN_PREVIEW_PRINT_OPTIONS :
|
|
|
|
|
{
|
|
|
|
|
SwPreviewPrintOptionsDialog aDlg(aViewWin, *this);
|
|
|
|
|
aDlg.Execute();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SID_PRINTDOCDIRECT:
|
|
|
|
|
case SID_PRINTDOC:
|
|
|
|
|
::SetAppPrintOptions( aViewWin.GetViewShell(), FALSE );
|
|
|
|
|
bNormalPrint = TRUE;
|
|
|
|
|
SfxViewShell::ExecuteSlot( rReq, SfxViewShell::GetInterface() );
|
|
|
|
|
return;
|
2002-03-20 10:00:27 +00:00
|
|
|
|
case FN_CLOSE_PAGEPREVIEW:
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case SID_PRINTPREVIEW:
|
|
|
|
|
// print preview is now always in the same frame as the tab view
|
|
|
|
|
// -> always switch this frame back to normal view
|
|
|
|
|
// (ScTabViewShell ctor reads stored view data)
|
2004-02-04 13:10:46 +00:00
|
|
|
|
GetViewFrame()->GetDispatcher()->Execute( SID_VIEWSHELL0, 0, 0, SFX_CALLMODE_ASYNCHRON );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
break;
|
2002-03-15 06:33:34 +00:00
|
|
|
|
case FN_INSERT_BREAK:
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
USHORT nSelPage = aViewWin.SelectedPage();
|
2002-03-20 08:18:37 +00:00
|
|
|
|
//if a dummy page is selected (e.g. a non-existing right/left page)
|
|
|
|
|
//the direct neighbor is used
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if(GetViewShell()->IsDummyPage( nSelPage ) && GetViewShell()->IsDummyPage( --nSelPage ))
|
2002-03-20 08:18:37 +00:00
|
|
|
|
nSelPage +=2;
|
|
|
|
|
SetNewPage( nSelPage );
|
2002-03-15 06:33:34 +00:00
|
|
|
|
SfxViewFrame *pTmpFrm = GetViewFrame();
|
|
|
|
|
pTmpFrm->GetBindings().Execute( SID_VIEWSHELL0, NULL, 0,
|
|
|
|
|
SFX_CALLMODE_ASYNCHRON );
|
|
|
|
|
}
|
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
default:
|
|
|
|
|
ASSERT(!this, falscher Dispatcher);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bRefresh )
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::GetState( SfxItemSet& rSet )
|
|
|
|
|
{
|
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
|
BYTE nRow = 1;
|
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
|
ASSERT(nWhich, leeres Set);
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
|
|
|
|
|
//#106746# zoom has to be disabled if Accessibility support is switched on
|
|
|
|
|
BOOL bZoomEnabled = !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
while(nWhich)
|
|
|
|
|
{
|
|
|
|
|
switch(nWhich)
|
|
|
|
|
{
|
2009-09-18 10:15:03 +00:00
|
|
|
|
case SID_BROWSER_MODE:
|
|
|
|
|
case FN_PRINT_LAYOUT:
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_START_OF_DOCUMENT:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->IsPageVisible( 1 ) )
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case FN_END_OF_DOCUMENT:
|
|
|
|
|
{
|
|
|
|
|
if ( pPagePrevwLay->IsPageVisible( mnPageCount ) )
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_PAGEUP:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
if( pPagePrevwLay->GetWinPagesScrollAmount( -1 ) == 0 )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
break;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
case FN_PAGEDOWN:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
if( pPagePrevwLay->GetWinPagesScrollAmount( 1 ) == 0 )
|
|
|
|
|
rSet.DisableItem(nWhich);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
break;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
case FN_STAT_PAGE:
|
|
|
|
|
{
|
|
|
|
|
String aStr( sPageStr );
|
2002-12-06 15:25:21 +00:00
|
|
|
|
aViewWin.GetStatusStr( aStr, mnPageCount );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rSet.Put( SfxStringItem( nWhich, aStr) );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SID_ATTR_ZOOM:
|
|
|
|
|
case FN_STAT_ZOOM:
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if(bZoomEnabled)
|
|
|
|
|
{
|
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
|
|
|
|
SvxZoomItem aZoom((SvxZoomType)pVOpt->GetZoomType(),
|
|
|
|
|
pVOpt->GetZoom());
|
|
|
|
|
aZoom.SetValueSet(
|
|
|
|
|
SVX_ZOOM_ENABLE_50|
|
|
|
|
|
SVX_ZOOM_ENABLE_75|
|
|
|
|
|
SVX_ZOOM_ENABLE_100|
|
|
|
|
|
SVX_ZOOM_ENABLE_150|
|
|
|
|
|
SVX_ZOOM_ENABLE_200);
|
|
|
|
|
rSet.Put( aZoom );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rSet.DisableItem(nWhich);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2002-11-27 08:01:27 +00:00
|
|
|
|
break;
|
2008-03-07 14:06:36 +00:00
|
|
|
|
case SID_ATTR_ZOOMSLIDER :
|
|
|
|
|
{
|
|
|
|
|
if(bZoomEnabled)
|
|
|
|
|
{
|
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
|
|
|
|
const USHORT nCurrentZoom = pVOpt->GetZoom();
|
|
|
|
|
SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM );
|
|
|
|
|
aZoomSliderItem.AddSnappingPoint( 100 );
|
|
|
|
|
rSet.Put( aZoomSliderItem );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-12-02 07:36:05 +00:00
|
|
|
|
case FN_PREVIEW_ZOOM:
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if(bZoomEnabled)
|
|
|
|
|
{
|
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
|
|
|
|
rSet.Put(SfxUInt16Item(nWhich, pVOpt->GetZoom()));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rSet.DisableItem(nWhich);
|
2002-12-02 07:36:05 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2002-11-27 08:01:27 +00:00
|
|
|
|
case SID_ZOOM_IN:
|
|
|
|
|
case SID_ZOOM_OUT:
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if(!bZoomEnabled || (SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM)||
|
2002-12-02 07:36:05 +00:00
|
|
|
|
(SID_ZOOM_IN == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM))
|
2002-11-27 08:01:27 +00:00
|
|
|
|
{
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-12-06 13:15:24 +00:00
|
|
|
|
case FN_SHOW_MULTIPLE_PAGES:
|
2002-11-27 08:01:27 +00:00
|
|
|
|
//should never be disabled
|
|
|
|
|
break;
|
2004-04-21 08:41:45 +00:00
|
|
|
|
case FN_SHOW_BOOKVIEW:
|
|
|
|
|
{
|
|
|
|
|
BOOL b = GetViewShell()->GetViewOptions()->IsPagePrevBookview();
|
|
|
|
|
rSet.Put(SfxBoolItem(nWhich, b));
|
|
|
|
|
}
|
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
case FN_SHOW_TWO_PAGES:
|
|
|
|
|
if( 2 == aViewWin.GetCol() && nRow == aViewWin.GetRow() )
|
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FN_PRINT_PAGEPREVIEW:
|
|
|
|
|
// hat den gleichen Status wie das normale Drucken
|
|
|
|
|
{
|
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
|
SfxItemSet aSet( *rSet.GetPool(), SID_PRINTDOC, SID_PRINTDOC );
|
|
|
|
|
GetSlotState( SID_PRINTDOC, SfxViewShell::GetInterface(), &aSet );
|
2006-03-22 08:32:25 +00:00
|
|
|
|
if( SFX_ITEM_DISABLED == aSet.GetItemState( SID_PRINTDOC,
|
|
|
|
|
FALSE, &pItem ))
|
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
else if( SFX_ITEM_SET == aSet.GetItemState( SID_PRINTDOC,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FALSE, &pItem ))
|
|
|
|
|
{
|
|
|
|
|
((SfxPoolItem*)pItem)->SetWhich( FN_PRINT_PAGEPREVIEW );
|
|
|
|
|
rSet.Put( *pItem );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SID_PRINTPREVIEW:
|
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, TRUE ) );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SID_PRINTDOC:
|
|
|
|
|
case SID_PRINTDOCDIRECT:
|
|
|
|
|
GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::StateUndo(SfxItemSet& rSet)
|
|
|
|
|
{
|
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
|
|
|
|
|
|
while (nWhich)
|
|
|
|
|
{
|
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::Init(const SwViewOption * pPrefs)
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if ( GetViewShell()->HasDrawView() )
|
|
|
|
|
GetViewShell()->GetDrawView()->SetAnimationEnabled( FALSE );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
bNormalPrint = TRUE;
|
|
|
|
|
|
|
|
|
|
// Die DocSize erfragen und verarbeiten. Ueber die Handler konnte
|
|
|
|
|
// die Shell nicht gefunden werden, weil die Shell innerhalb CTOR-Phase
|
|
|
|
|
// nicht in der SFX-Verwaltung bekannt ist.
|
|
|
|
|
|
|
|
|
|
if( !pPrefs )
|
|
|
|
|
pPrefs = SW_MOD()->GetUsrPref(FALSE);
|
|
|
|
|
|
|
|
|
|
// die Felder aktualisieren
|
|
|
|
|
// ACHTUNG: hochcasten auf die EditShell, um die SS zu nutzen.
|
|
|
|
|
// In den Methoden wird auf die akt. Shell abgefragt!
|
2002-12-04 11:17:32 +00:00
|
|
|
|
SwEditShell* pESh = (SwEditShell*)GetViewShell();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
BOOL bIsModified = pESh->IsModified();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwViewOption aOpt( *pPrefs );
|
2002-04-25 13:00:16 +00:00
|
|
|
|
aOpt.SetPagePreview(TRUE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aOpt.SetTab( FALSE );
|
|
|
|
|
aOpt.SetBlank( FALSE );
|
|
|
|
|
aOpt.SetHardBlank( FALSE );
|
|
|
|
|
aOpt.SetParagraph( FALSE );
|
|
|
|
|
aOpt.SetLineBreak( FALSE );
|
|
|
|
|
aOpt.SetPageBreak( FALSE );
|
|
|
|
|
aOpt.SetColumnBreak( FALSE );
|
|
|
|
|
aOpt.SetSoftHyph( FALSE );
|
|
|
|
|
aOpt.SetFldName( FALSE );
|
|
|
|
|
aOpt.SetPostIts( FALSE );
|
2004-02-26 14:43:28 +00:00
|
|
|
|
aOpt.SetShowHiddenChar( FALSE );
|
|
|
|
|
aOpt.SetShowHiddenField( FALSE );
|
|
|
|
|
aOpt.SetShowHiddenPara( FALSE );
|
2002-09-20 11:10:10 +00:00
|
|
|
|
aOpt.SetViewHRuler( FALSE );
|
|
|
|
|
aOpt.SetViewVRuler( FALSE );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aOpt.SetGraphic( TRUE );
|
|
|
|
|
aOpt.SetTable( TRUE );
|
|
|
|
|
aOpt.SetSnap( FALSE );
|
|
|
|
|
aOpt.SetGridVisible( FALSE );
|
2002-12-04 11:17:32 +00:00
|
|
|
|
GetViewShell()->ApplyViewOptions( aOpt );
|
|
|
|
|
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 09.01.2003 #i6467# - adjust view shell option to the same as for print
|
|
|
|
|
SwPrtOptions aPrintOptions( GetViewFrame()->GetObjectShell()->GetTitle(0) );
|
2007-04-03 12:49:16 +00:00
|
|
|
|
SwView::MakeOptions( 0, aPrintOptions, 0, 0, false, 0, 0 );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
|
|
|
|
|
|
2006-08-14 16:56:12 +00:00
|
|
|
|
IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess();
|
|
|
|
|
if( pIDSA->get(IDocumentSettingAccess::BROWSE_MODE))
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2006-08-14 16:56:12 +00:00
|
|
|
|
pIDSA->set(IDocumentSettingAccess::BROWSE_MODE, false);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pESh->CheckBrowseView( TRUE );
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
GetViewShell()->CalcLayout();
|
|
|
|
|
DocSzChgd( GetViewShell()->GetDocSize() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( !bIsModified )
|
|
|
|
|
pESh->ResetModified();
|
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
pVScrollbar->ExtendedShow(pPrefs->IsViewVScrollBar());
|
|
|
|
|
pHScrollbar->ExtendedShow(pPrefs->IsViewHScrollBar());
|
2002-06-28 11:11:19 +00:00
|
|
|
|
pScrollFill->Show(pPrefs->IsViewVScrollBar() && pPrefs->IsViewHScrollBar());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
|
|
|
|
|
SfxViewShell( pViewFrame, SWVIEWFLAGS ),
|
|
|
|
|
aViewWin( &pViewFrame->GetWindow(), *this ),
|
|
|
|
|
nNewPage(USHRT_MAX),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pHScrollbar(0),
|
|
|
|
|
pVScrollbar(0),
|
|
|
|
|
pPageUpBtn(0),
|
|
|
|
|
pPageDownBtn(0),
|
2007-09-27 11:35:25 +00:00
|
|
|
|
pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(),
|
|
|
|
|
pViewFrame->GetFrame()->GetParentFrame() ? 0 : WB_SIZEABLE )),
|
2002-12-06 15:25:21 +00:00
|
|
|
|
mnPageCount( 0 ),
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 09.01.2003 #106334#
|
|
|
|
|
mbResetFormDesignMode( false ),
|
|
|
|
|
mbFormDesignModeToReset( false )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
SetName(String::CreateFromAscii("PageView" ));
|
|
|
|
|
SetWindow( &aViewWin );
|
|
|
|
|
SetHelpId(SW_PAGEPREVIEW);
|
2002-06-28 11:11:19 +00:00
|
|
|
|
_CreateScrollbar( TRUE );
|
|
|
|
|
_CreateScrollbar( FALSE );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if ( !pOldSh )
|
|
|
|
|
{
|
|
|
|
|
//Gibt es schon eine Sicht auf das Dokument?
|
|
|
|
|
SfxViewFrame *pF = SfxViewFrame::GetFirst( pObjShell );
|
2007-09-27 11:35:25 +00:00
|
|
|
|
if ( pF == pViewFrame )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pF = SfxViewFrame::GetNext( *pF, pObjShell );
|
|
|
|
|
if ( pF )
|
|
|
|
|
pOldSh = pF->GetViewShell();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ViewShell *pVS, *pNew;
|
|
|
|
|
|
|
|
|
|
if( pOldSh && pOldSh->IsA( TYPE( SwPagePreView ) ) )
|
2002-12-04 11:17:32 +00:00
|
|
|
|
pVS = ((SwPagePreView*)pOldSh)->GetViewShell();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if( pOldSh && pOldSh->IsA( TYPE( SwView ) ) )
|
|
|
|
|
{
|
|
|
|
|
pVS = ((SwView*)pOldSh)->GetWrtShellPtr();
|
|
|
|
|
// save the current ViewData of the previous SwView
|
|
|
|
|
pOldSh->WriteUserData( sSwViewData, FALSE );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
pVS = GetDocShell()->GetWrtShell();
|
|
|
|
|
if( pVS )
|
|
|
|
|
{
|
|
|
|
|
// setze die akt. Seite als die erste
|
|
|
|
|
USHORT nPhysPg, nVirtPg;
|
|
|
|
|
((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, /*FALSE*/TRUE, FALSE );
|
|
|
|
|
if( 1 != aViewWin.GetCol() && 1 == nPhysPg )
|
|
|
|
|
--nPhysPg;
|
|
|
|
|
aViewWin.SetSttPage( nPhysPg );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 09.01.2003 #106334# - for form shell remember design mode of draw view
|
|
|
|
|
// of previous view shell
|
|
|
|
|
if ( pVS && pVS->HasDrawView() )
|
|
|
|
|
{
|
|
|
|
|
mbResetFormDesignMode = true;
|
|
|
|
|
mbFormDesignModeToReset = pVS->GetDrawView()->IsDesignMode();
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( pVS )
|
2000-10-25 11:07:02 +00:00
|
|
|
|
pNew = new ViewShell( *pVS, &aViewWin, 0, VSHELLFLAG_ISPREVIEW );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else
|
2000-10-25 11:07:02 +00:00
|
|
|
|
pNew = new ViewShell(
|
2007-09-27 11:35:25 +00:00
|
|
|
|
*((SwDocShell*)pViewFrame->GetObjectShell())->GetDoc(),
|
2000-10-25 11:07:02 +00:00
|
|
|
|
&aViewWin, 0, 0, VSHELLFLAG_ISPREVIEW );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aViewWin.SetViewShell( pNew );
|
|
|
|
|
pNew->SetSfxViewShell( this );
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwPagePreView::~SwPagePreView()
|
|
|
|
|
{
|
|
|
|
|
SetWindow( 0 );
|
|
|
|
|
|
|
|
|
|
delete pScrollFill;
|
|
|
|
|
delete pHScrollbar;
|
|
|
|
|
delete pVScrollbar;
|
|
|
|
|
delete pPageUpBtn;
|
|
|
|
|
delete pPageDownBtn;
|
|
|
|
|
|
|
|
|
|
/* SfxObjectShell* pDocSh = GetDocShell();
|
2009-11-30 12:56:04 +01:00
|
|
|
|
for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh );
|
|
|
|
|
pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( pFrame != GetViewFrame() )
|
|
|
|
|
{
|
|
|
|
|
// es gibt noch eine weitere Sicht auf unser Dokument, also
|
|
|
|
|
// aktiviere dieses
|
|
|
|
|
pFrame->GetFrame()->Appear();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
*/}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwDocShell* SwPagePreView::GetDocShell()
|
|
|
|
|
{
|
|
|
|
|
return PTR_CAST(SwDocShell, GetViewFrame()->GetObjectShell());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
int SwPagePreView::_CreateScrollbar( BOOL bHori )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
Window *pMDI = &GetViewFrame()->GetWindow();
|
|
|
|
|
SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
|
|
|
|
|
|
|
|
|
|
ASSERT( !*ppScrollbar, "vorher abpruefen!" )
|
|
|
|
|
|
|
|
|
|
if( !bHori )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
pPageUpBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEUP ) );
|
|
|
|
|
pPageUpBtn->SetHelpId(FN_PAGEUP);
|
|
|
|
|
pPageDownBtn = new ImageButton(pMDI, SW_RES( BTN_PAGEDOWN ) );
|
|
|
|
|
pPageDownBtn->SetHelpId(FN_PAGEDOWN);
|
|
|
|
|
Link aLk( LINK( this, SwPagePreView, BtnPage ) );
|
|
|
|
|
pPageUpBtn->SetClickHdl( aLk );
|
|
|
|
|
pPageDownBtn->SetClickHdl( aLk );
|
|
|
|
|
pPageUpBtn->Show();
|
|
|
|
|
pPageDownBtn->Show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*ppScrollbar = new SwScrollbar( pMDI, bHori );
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ScrollDocSzChg();
|
|
|
|
|
(*ppScrollbar)->EnableDrag( TRUE );
|
|
|
|
|
(*ppScrollbar)->SetEndScrollHdl( LINK( this, SwPagePreView, EndScrollHdl ));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(*ppScrollbar)->SetScrollHdl( LINK( this, SwPagePreView, ScrollHdl ));
|
|
|
|
|
|
|
|
|
|
InvalidateBorder();
|
2007-09-27 11:35:25 +00:00
|
|
|
|
(*ppScrollbar)->ExtendedShow();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Button-Handler
|
|
|
|
|
*/
|
|
|
|
|
IMPL_LINK_INLINE_START( SwPagePreView, BtnPage, Button *, pButton )
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 04.03.2003 #107369# - use new helper method to perform page up
|
|
|
|
|
// respectively page down.
|
|
|
|
|
_ExecPgUpAndPgDown( pButton == pPageUpBtn );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
IMPL_LINK_INLINE_END( SwPagePreView, BtnPage, Button *, pButton )
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
|
|
|
|
|
{
|
|
|
|
|
Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) );
|
|
|
|
|
int bChg = aViewWin.MovePage( eMvMode ) ||
|
2003-03-27 14:45:43 +00:00
|
|
|
|
eMvMode == SwPagePreViewWin::MV_CALC ||
|
|
|
|
|
eMvMode == SwPagePreViewWin::MV_NEWWINSIZE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aVisArea = aViewWin.PixelToLogic( aPixVisArea );
|
|
|
|
|
|
|
|
|
|
if( bChg )
|
|
|
|
|
{
|
|
|
|
|
// Statusleiste updaten
|
|
|
|
|
String aStr( sPageStr );
|
2002-12-06 15:25:21 +00:00
|
|
|
|
aViewWin.GetStatusStr( aStr, mnPageCount );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
|
|
|
|
|
|
if( bUpdateScrollbar )
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ScrollViewSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT,
|
|
|
|
|
FN_PAGEUP, FN_PAGEDOWN, 0
|
|
|
|
|
};
|
|
|
|
|
rBindings.Invalidate( aInval );
|
|
|
|
|
}
|
|
|
|
|
rBindings.SetState( SfxStringItem( FN_STAT_PAGE, aStr ) );
|
|
|
|
|
}
|
|
|
|
|
return bChg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ab hier alles aus der SwView uebernommen
|
|
|
|
|
|
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, BOOL /*bInner*/ )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
// const long nAdd = bInner ? 0 : ScrollBar::GetWindowOverlapPixel();
|
|
|
|
|
const StyleSettings &rSet = aViewWin.GetSettings().GetStyleSettings();
|
|
|
|
|
const long nTmp = rSet.GetScrollBarSize();// - nAdd;
|
2007-09-27 11:35:25 +00:00
|
|
|
|
if ( pVScrollbar->IsVisible( FALSE ))
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rToFill.Right() = nTmp;
|
2007-09-27 11:35:25 +00:00
|
|
|
|
if ( pHScrollbar->IsVisible( FALSE ) )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rToFill.Bottom() = nTmp;
|
|
|
|
|
SetBorderPixel( rToFill );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
|
|
|
|
|
{
|
|
|
|
|
SvBorder aBorder;
|
|
|
|
|
CalcAndSetBorderPixel( aBorder, TRUE );
|
|
|
|
|
Rectangle aRect( rOfst, rSize );
|
|
|
|
|
aRect += aBorder;
|
|
|
|
|
ViewResizePixel( aViewWin, aRect.TopLeft(), aRect.GetSize(),
|
|
|
|
|
aViewWin.GetOutputSizePixel(),
|
|
|
|
|
TRUE,
|
2002-06-28 11:11:19 +00:00
|
|
|
|
*pVScrollbar, *pHScrollbar, pPageUpBtn, pPageDownBtn, 0,
|
|
|
|
|
*pScrollFill );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
//EditWin niemals einstellen!
|
|
|
|
|
//VisArea niemals einstellen!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
|
|
|
|
|
{
|
|
|
|
|
SvBorder aBorder;
|
|
|
|
|
CalcAndSetBorderPixel( aBorder, FALSE );
|
|
|
|
|
ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(),
|
2002-06-28 11:11:19 +00:00
|
|
|
|
FALSE, *pVScrollbar,
|
|
|
|
|
*pHScrollbar, pPageUpBtn, pPageDownBtn, 0, *pScrollFill );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
//EditWin niemals einstellen!
|
|
|
|
|
|
|
|
|
|
Size aTmpSize( aViewWin.GetOutputSizePixel() );
|
|
|
|
|
Point aBottomRight( aViewWin.PixelToLogic( Point( aTmpSize.Width(), aTmpSize.Height() ) ) );
|
|
|
|
|
SetVisArea( Rectangle( Point(), aBottomRight ) );
|
|
|
|
|
|
|
|
|
|
//Aufruf der DocSzChgd-Methode der Scrollbars ist noetig, da vom maximalen
|
|
|
|
|
//Scrollrange immer die halbe Hoehe der VisArea abgezogen wird.
|
|
|
|
|
if ( pVScrollbar )
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ScrollDocSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::SetVisArea( const Rectangle &rRect, BOOL bUpdateScrollbar )
|
|
|
|
|
{
|
|
|
|
|
const Point aTopLeft(AlignToPixel(rRect.TopLeft()));
|
|
|
|
|
const Point aBottomRight(AlignToPixel(rRect.BottomRight()));
|
|
|
|
|
Rectangle aLR(aTopLeft,aBottomRight);
|
|
|
|
|
|
|
|
|
|
if(aLR == aVisArea)
|
|
|
|
|
return;
|
|
|
|
|
// keine negative Position, keine neg. Groesse
|
|
|
|
|
|
|
|
|
|
if(aLR.Top() < 0)
|
|
|
|
|
{
|
|
|
|
|
aLR.Bottom() += Abs(aLR.Top());
|
|
|
|
|
aLR.Top() = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(aLR.Left() < 0)
|
|
|
|
|
{
|
|
|
|
|
aLR.Right() += Abs(aLR.Left());
|
|
|
|
|
aLR.Left() = 0;
|
|
|
|
|
}
|
|
|
|
|
if(aLR.Right() < 0) aLR.Right() = 0;
|
|
|
|
|
if(aLR.Bottom() < 0) aLR.Bottom() = 0;
|
|
|
|
|
if(aLR == aVisArea ||
|
|
|
|
|
// JP 29.10.97: Bug 45173 - Leeres Rechteck nicht beachten
|
|
|
|
|
( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( aLR.Left() > aLR.Right() || aLR.Top() > aLR.Bottom() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
//Bevor die Daten veraendert werden ggf. ein Update rufen. Dadurch wird
|
2006-08-14 16:56:12 +00:00
|
|
|
|
//sichergestellt, da? anliegende Paints korrekt in Dokumentkoordinaten
|
2000-09-18 16:15:01 +00:00
|
|
|
|
//umgerechnet werden.
|
|
|
|
|
//Vorsichtshalber tun wir das nur wenn an der Shell eine Action laeuft,
|
|
|
|
|
//denn dann wir nicht wirklich gepaintet sondern die Rechtecke werden
|
|
|
|
|
//lediglich (in Dokumentkoordinaten) vorgemerkt.
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if( GetViewShell()->ActionPend() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aViewWin.Update();
|
|
|
|
|
|
|
|
|
|
// setze am View-Win die aktuelle Size
|
|
|
|
|
aVisArea = aLR;
|
|
|
|
|
aViewWin.SetWinSize( aLR.GetSize() );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 18.12.2002 #103492# - use new mode
|
|
|
|
|
ChgPage( SwPagePreViewWin::MV_NEWWINSIZE, bUpdateScrollbar );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if(!GetViewShell())
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( !pScrollbar->IsHoriScroll() &&
|
2002-12-04 11:17:32 +00:00
|
|
|
|
pScrollbar->GetType() == SCROLL_DRAG &&
|
|
|
|
|
Help::IsQuickHelpEnabled() &&
|
2003-03-27 14:45:43 +00:00
|
|
|
|
GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
// wieviele Seiten scrollen ??
|
|
|
|
|
String sStateStr(sPageStr);
|
|
|
|
|
USHORT nThmbPos = (USHORT)pScrollbar->GetThumbPos();
|
|
|
|
|
if( 1 == aViewWin.GetCol() || !nThmbPos )
|
|
|
|
|
++nThmbPos;
|
|
|
|
|
sStateStr += String::CreateFromInt32( nThmbPos );
|
|
|
|
|
Point aPos = pScrollbar->GetParent()->OutputToScreenPixel(
|
|
|
|
|
pScrollbar->GetPosPixel());
|
|
|
|
|
aPos.Y() = pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y();
|
|
|
|
|
Size aSize = pScrollbar->GetSizePixel();
|
|
|
|
|
Rectangle aRect;
|
|
|
|
|
aRect.Left() = aPos.X() -8;
|
|
|
|
|
aRect.Right() = aRect.Left();
|
|
|
|
|
aRect.Top() = aPos.Y();
|
|
|
|
|
aRect.Bottom() = aRect.Top();
|
|
|
|
|
|
|
|
|
|
Help::ShowQuickHelp(pScrollbar, aRect, sStateStr,
|
|
|
|
|
QUICKHELP_RIGHT|QUICKHELP_VCENTER);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
EndScrollHdl( pScrollbar );
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if(!GetViewShell())
|
|
|
|
|
return 0;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
|
|
// OD 04.03.2003 #107369# - boolean to avoid unnecessary invalidation of the window.
|
|
|
|
|
bool bInvalidateWin = true;
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if( !pScrollbar->IsHoriScroll() ) // scroll vertically
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if ( Help::IsQuickHelpEnabled() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
Help::ShowQuickHelp(pScrollbar, Rectangle(), aEmptyStr, 0);
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if ( GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
// wieviele Seiten scrollen ??
|
|
|
|
|
USHORT nThmbPos = (USHORT)pScrollbar->GetThumbPos();
|
2002-12-06 15:25:21 +00:00
|
|
|
|
// OD 05.12.2002 #103492# - adjust to new preview functionality
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if( nThmbPos != aViewWin.SelectedPage() )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 17.01.2003 #103492# - consider case that page <nThmbPos>
|
|
|
|
|
// is already visible
|
|
|
|
|
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
|
|
|
|
|
if ( pPagePrevwLay->IsPageVisible( nThmbPos ) )
|
|
|
|
|
{
|
|
|
|
|
pPagePrevwLay->MarkNewSelectedPage( nThmbPos );
|
|
|
|
|
// OD 04.03.2003 #107369# - invalidation of window is unnecessary
|
|
|
|
|
bInvalidateWin = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// OD 17.01.2003 #103492# - consider whether layout columns
|
|
|
|
|
// fit or not.
|
|
|
|
|
if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() )
|
|
|
|
|
{
|
|
|
|
|
aViewWin.SetSttPage( nThmbPos );
|
|
|
|
|
aViewWin.SetSelectedPage( nThmbPos );
|
|
|
|
|
ChgPage( SwPagePreViewWin::MV_SCROLL, FALSE );
|
|
|
|
|
// OD 20.01.2003 #103492# - update scrollbars
|
|
|
|
|
ScrollViewSzChg();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// OD 04.03.2003 #107369# - correct scroll amount
|
|
|
|
|
const sal_Int16 nPageDiff = nThmbPos - aViewWin.SelectedPage();
|
|
|
|
|
const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
|
|
|
|
|
sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
|
|
|
|
|
if ( nPageDiff % nVisPages )
|
|
|
|
|
{
|
|
|
|
|
// decrease/increase number of preview pages to scroll
|
|
|
|
|
nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll;
|
|
|
|
|
}
|
|
|
|
|
aViewWin.SetSelectedPage( nThmbPos );
|
|
|
|
|
aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// OD 17.01.2003 #103492# - update accessibility
|
|
|
|
|
GetViewShell()->ShowPreViewSelection( nThmbPos );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// OD 04.03.2003 #107369# - invalidation of window is unnecessary
|
|
|
|
|
bInvalidateWin = false;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2002-12-04 11:17:32 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
long nThmbPos = pScrollbar->GetThumbPos();
|
|
|
|
|
aViewWin.Scroll(0, nThmbPos - aViewWin.GetPaintedPreviewDocRect().Top());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-12-04 11:17:32 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
long nThmbPos = pScrollbar->GetThumbPos();
|
|
|
|
|
aViewWin.Scroll(nThmbPos - aViewWin.GetPaintedPreviewDocRect().Left(), 0);
|
|
|
|
|
}
|
2003-04-17 09:16:40 +00:00
|
|
|
|
// OD 24.03.2003 #108282# - additional invalidate page status.
|
2002-12-04 11:17:32 +00:00
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
2003-04-17 09:16:40 +00:00
|
|
|
|
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
|
|
|
|
|
FN_STAT_PAGE, 0
|
2002-12-04 11:17:32 +00:00
|
|
|
|
};
|
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
|
rBindings.Invalidate( aInval );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 04.03.2003 #107369# - control invalidation of window
|
|
|
|
|
if ( bInvalidateWin )
|
|
|
|
|
{
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Point SwPagePreView::AlignToPixel(const Point &rPt) const
|
|
|
|
|
{
|
|
|
|
|
return aViewWin.PixelToLogic( aViewWin.LogicToPixel( rPt ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwPagePreView::DocSzChgd( const Size &rSz )
|
|
|
|
|
{
|
|
|
|
|
if( aDocSz == rSz )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
aDocSz = rSz;
|
|
|
|
|
|
2009-08-27 14:36:29 +00:00
|
|
|
|
// --> OD 2009-08-20 #i96726#
|
|
|
|
|
// Due to the multiple page layout it is needed to trigger recalculation
|
|
|
|
|
// of the page preview layout, even if the count of pages is not changing.
|
|
|
|
|
mnPageCount = GetViewShell()->GetNumPages();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( aVisArea.GetWidth() )
|
|
|
|
|
{
|
|
|
|
|
ChgPage( SwPagePreViewWin::MV_CALC, TRUE );
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ScrollDocSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aViewWin.Invalidate();
|
|
|
|
|
}
|
2009-08-27 14:36:29 +00:00
|
|
|
|
// <--
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
void SwPagePreView::ScrollViewSzChg()
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
if(!GetViewShell())
|
|
|
|
|
return ;
|
|
|
|
|
if(pVScrollbar)
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if(GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
|
2002-12-04 11:17:32 +00:00
|
|
|
|
{
|
|
|
|
|
//vertical scrolling by row
|
2002-12-06 15:25:21 +00:00
|
|
|
|
// OD 04.12.2002 #103492# - adjust to new preview functionality
|
|
|
|
|
USHORT nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
|
|
|
|
|
pVScrollbar->SetVisibleSize( nVisPages );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 19.02.2003 #107369# - set selected page as scroll bar position,
|
|
|
|
|
// if it is visible.
|
|
|
|
|
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
|
|
|
|
|
if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) )
|
|
|
|
|
{
|
|
|
|
|
pVScrollbar->SetThumbPos( aViewWin.SelectedPage() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pVScrollbar->SetThumbPos( aViewWin.GetSttPage() );
|
|
|
|
|
}
|
2002-12-06 15:25:21 +00:00
|
|
|
|
pVScrollbar->SetLineSize( aViewWin.GetCol() );
|
|
|
|
|
pVScrollbar->SetPageSize( nVisPages );
|
|
|
|
|
// calculate and set scrollbar range
|
|
|
|
|
Range aScrollbarRange( 1, mnPageCount );
|
|
|
|
|
// increase range by one, because left-top-corner is left blank.
|
|
|
|
|
++aScrollbarRange.Max();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 17.01.2003 #103492# - increase range in order to access all pages
|
|
|
|
|
aScrollbarRange.Max() += ( nVisPages - 1 );
|
2002-12-06 15:25:21 +00:00
|
|
|
|
pVScrollbar->SetRange( aScrollbarRange );
|
2002-12-04 11:17:32 +00:00
|
|
|
|
}
|
|
|
|
|
else //vertical scrolling by pixel
|
|
|
|
|
{
|
|
|
|
|
const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
const Size& rPreviewSize =
|
|
|
|
|
GetViewShell()->PagePreviewLayout()->GetPrevwDocSize();
|
2002-12-04 11:17:32 +00:00
|
|
|
|
pVScrollbar->SetRangeMax(rPreviewSize.Height()) ;
|
|
|
|
|
long nVisHeight = rDocRect.GetHeight();
|
|
|
|
|
pVScrollbar->SetVisibleSize( nVisHeight );
|
|
|
|
|
pVScrollbar->SetThumbPos( rDocRect.Top() );
|
|
|
|
|
pVScrollbar->SetLineSize( nVisHeight / 10 );
|
|
|
|
|
pVScrollbar->SetPageSize( nVisHeight / 2 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(pHScrollbar)
|
|
|
|
|
{
|
|
|
|
|
const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
const Size& rPreviewSize =
|
|
|
|
|
GetViewShell()->PagePreviewLayout()->GetPrevwDocSize();
|
2002-12-04 11:17:32 +00:00
|
|
|
|
long nVisWidth = 0;
|
|
|
|
|
long nThumb = 0;
|
|
|
|
|
Range aRange(0,0);
|
|
|
|
|
|
|
|
|
|
if(rDocRect.GetWidth() < rPreviewSize.Width())
|
|
|
|
|
{
|
|
|
|
|
nVisWidth = rDocRect.GetWidth();
|
|
|
|
|
nThumb = rDocRect.Left();
|
|
|
|
|
aRange = Range(0, rPreviewSize.Width());
|
|
|
|
|
}
|
2002-12-06 15:25:21 +00:00
|
|
|
|
pHScrollbar->SetRange( aRange );
|
2002-12-04 11:17:32 +00:00
|
|
|
|
pHScrollbar->SetVisibleSize( nVisWidth );
|
|
|
|
|
pHScrollbar->SetThumbPos( nThumb );
|
|
|
|
|
pHScrollbar->SetLineSize( nVisWidth / 10 );
|
|
|
|
|
pHScrollbar->SetPageSize( nVisWidth / 2 );
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
void SwPagePreView::ScrollDocSzChg()
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ScrollViewSzChg();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alles zum Thema Drucken
|
|
|
|
|
|
2007-01-25 10:45:50 +00:00
|
|
|
|
USHORT SwPagePreView::Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pDlg )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-05-17 08:32:40 +00:00
|
|
|
|
ViewShell* pSh = aViewWin.GetViewShell();
|
|
|
|
|
SfxPrinter* pPrinter = GetPrinter();
|
2007-01-25 10:45:50 +00:00
|
|
|
|
if( !pPrinter || !pPrinter->InitJob( &aViewWin,
|
|
|
|
|
pSh->HasDrawView() && !bIsAPI && pSh->GetDrawView()->GetModel()->HasTransparentObjects() ))
|
2001-05-17 08:32:40 +00:00
|
|
|
|
return ERRCODE_IO_ABORT;
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SwWait aWait( *GetDocShell(), TRUE );
|
|
|
|
|
|
|
|
|
|
USHORT nRowCol = ( aViewWin.GetRow() << 8 ) +
|
|
|
|
|
aViewWin.GetCol(); // Zeilen / DoppelSeiten
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// die Felder aktualisieren
|
|
|
|
|
// ACHTUNG: hochcasten auf die EditShell, um die SS zu nutzen.
|
|
|
|
|
// In den Methoden wird auf die akt. Shell abgefragt!
|
|
|
|
|
SwEditShell* pESh = (SwEditShell*)pSh;
|
|
|
|
|
SwDocStat aDocStat;
|
|
|
|
|
BOOL bIsModified = pESh->IsModified();
|
|
|
|
|
|
|
|
|
|
pESh->StartAllAction();
|
|
|
|
|
pESh->UpdateDocStat( aDocStat );
|
|
|
|
|
pSh->UpdateFlds();
|
|
|
|
|
pESh->EndAllAction();
|
|
|
|
|
|
|
|
|
|
if( !bIsModified )
|
|
|
|
|
pESh->ResetModified();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Druckauftrag starten
|
|
|
|
|
SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell();
|
|
|
|
|
SwPrtOptions aOpts( pObjShell->GetTitle(0) );
|
|
|
|
|
|
|
|
|
|
BOOL bPrtPros;
|
2007-04-03 12:49:16 +00:00
|
|
|
|
BOOL bPrtPros_RTL;
|
|
|
|
|
SwView::MakeOptions( pDlg, aOpts, &bPrtPros, &bPrtPros_RTL, FALSE, GetPrinter(), GetDocShell()->GetDoc()->getPrintData() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( bNormalPrint )
|
|
|
|
|
{
|
|
|
|
|
if( bPrtPros )
|
2007-04-03 12:49:16 +00:00
|
|
|
|
pSh->PrintProspect( aOpts, rProgress, bPrtPros_RTL );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else
|
2005-03-23 10:56:44 +00:00
|
|
|
|
pSh->Prt( aOpts, &rProgress );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const SwPagePreViewPrtData* pPPVPD = pSh->GetDoc()->GetPreViewPrtData();
|
|
|
|
|
if( pPPVPD && pPPVPD->GetCol() && pPPVPD->GetRow() )
|
|
|
|
|
{
|
|
|
|
|
// Zeilen / Seiten
|
|
|
|
|
nRowCol = ( pPPVPD->GetRow() << 8 ) + pPPVPD->GetCol();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
pPPVPD = 0;
|
|
|
|
|
pSh->PrintPreViewPage( aOpts, nRowCol, rProgress, pPPVPD );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0; // OK
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SfxPrinter* SwPagePreView::GetPrinter( BOOL bCreate )
|
|
|
|
|
{
|
2006-08-14 16:56:12 +00:00
|
|
|
|
return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 12:11:44 +00:00
|
|
|
|
USHORT SwPagePreView::SetPrinter( SfxPrinter *pNew, USHORT nDiffFlags, bool )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ViewShell &rSh = *GetViewShell();
|
2009-09-18 10:15:03 +00:00
|
|
|
|
SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
|
|
|
|
|
if ( pOld && pOld->IsPrinting() )
|
|
|
|
|
return SFX_PRINTERROR_BUSY;
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SwEditShell &rESh = (SwEditShell&)rSh; //Buh...
|
|
|
|
|
if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags )
|
|
|
|
|
{
|
2006-08-14 16:56:12 +00:00
|
|
|
|
rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( nDiffFlags & SFX_PRINTER_PRINTER )
|
|
|
|
|
rESh.SetModified();
|
|
|
|
|
}
|
|
|
|
|
if ( ( nDiffFlags & SFX_PRINTER_OPTIONS ) == SFX_PRINTER_OPTIONS )
|
2008-03-05 15:48:00 +00:00
|
|
|
|
::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, FALSE );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
const BOOL bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ? TRUE : FALSE;
|
|
|
|
|
const BOOL bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE ? TRUE : FALSE;
|
|
|
|
|
if ( bChgOri || bChgSize )
|
|
|
|
|
{
|
|
|
|
|
rESh.StartAllAction();
|
|
|
|
|
if ( bChgOri )
|
|
|
|
|
rSh.ChgAllPageOrientation( USHORT(pNew->GetOrientation()) );
|
|
|
|
|
if ( bChgSize )
|
|
|
|
|
{
|
|
|
|
|
Size aSz( SvxPaperInfo::GetPaperSize( pNew ) );
|
|
|
|
|
rSh.ChgAllPageSize( aSz );
|
|
|
|
|
}
|
|
|
|
|
if( !bNormalPrint )
|
|
|
|
|
aViewWin.CalcWish( aViewWin.GetRow(), aViewWin.GetCol() );
|
|
|
|
|
rESh.SetModified();
|
|
|
|
|
rESh.EndAllAction();
|
|
|
|
|
|
|
|
|
|
static USHORT __READONLY_DATA aInval[] =
|
|
|
|
|
{
|
|
|
|
|
SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
|
|
|
|
|
SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
|
|
|
|
|
};
|
|
|
|
|
#ifndef PRODUCT
|
|
|
|
|
{
|
|
|
|
|
const USHORT* pPtr = aInval + 1;
|
|
|
|
|
do {
|
|
|
|
|
ASSERT( *(pPtr - 1) < *pPtr, "falsche Sortierung!" );
|
|
|
|
|
} while( *++pPtr );
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
GetViewFrame()->GetBindings().Invalidate(aInval);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
|
|
|
|
|
const SfxItemSet &rOptions )
|
|
|
|
|
{
|
|
|
|
|
return ::CreatePrintOptionsPage( pParent, rOptions, !bNormalPrint );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintDialog* SwPagePreView::CreatePrintDialog( Window *pParent )
|
|
|
|
|
{
|
|
|
|
|
PrintDialog *pDlg = ::CreatePrintDialog( pParent, 1, 0 );
|
|
|
|
|
pDlg->DisableRange( PRINTDIALOG_SELECTION );
|
|
|
|
|
return pDlg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 18.12.2002 #103492# - no longer needed ??
|
2000-09-18 16:15:01 +00:00
|
|
|
|
Size SwPagePreView::GetOptimalSizePixel() const
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
|
|
|
|
|
return Size( -1, -1 );
|
|
|
|
|
/*
|
2000-09-18 16:15:01 +00:00
|
|
|
|
//JP 09.06.99: was wird hier errechnet ?????
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// ALT:
|
|
|
|
|
// SfxApplicationWindow* pWin = SFX_APPWINDOW ;
|
|
|
|
|
// Rectangle aRect = pWin->GetClientAreaPixel();
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
Window& rWin = GetViewFrame()->GetWindow();
|
|
|
|
|
Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() );
|
|
|
|
|
Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() );
|
|
|
|
|
Size aInSize = rWin.GetOutputSizePixel();
|
|
|
|
|
Size aOutSize = rWin.GetSizePixel();
|
|
|
|
|
USHORT nXBorder = USHORT(aOutSize.Width() - aInSize.Width());
|
|
|
|
|
USHORT nYBorder = USHORT(aOutSize.Height() - aInSize.Height());
|
|
|
|
|
aMaxSize.Width() -= nXBorder;
|
|
|
|
|
//'auf Verdacht' etwas vom Border abziehen (Menue)
|
|
|
|
|
nYBorder -= (nYBorder - nXBorder) / 2;
|
|
|
|
|
aMaxSize.Height() -= nYBorder;
|
|
|
|
|
//mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen
|
|
|
|
|
aViewWin.GetOptimalSize(aMaxSize);
|
|
|
|
|
// Border wieder dazuzaehlen
|
|
|
|
|
aMaxSize.Height() += nYBorder;
|
|
|
|
|
aMaxSize.Width() += nXBorder;
|
|
|
|
|
return aMaxSize;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 12.12.2002 #103492#
|
|
|
|
|
void SwPagePreViewWin::SetViewShell( ViewShell* pShell )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpViewShell = pShell;
|
|
|
|
|
if ( mpViewShell && mpViewShell->IsPreView() )
|
2002-12-02 06:57:41 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout = mpViewShell->PagePreviewLayout();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect )
|
|
|
|
|
{
|
2004-04-21 08:41:45 +00:00
|
|
|
|
// OD 2004-03-04 #i24183#
|
|
|
|
|
if ( mpPgPrevwLayout->PreviewLayoutValid() )
|
|
|
|
|
{
|
|
|
|
|
mpPgPrevwLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) );
|
|
|
|
|
}
|
2002-12-03 14:35:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** method to adjust preview to a new zoom factor
|
|
|
|
|
|
|
|
|
|
OD 02.12.2002 #103492#
|
2003-12-01 08:47:37 +00:00
|
|
|
|
OD 24.09.2003 #i19975# - also consider zoom type - adding parameter <_eZoomType>
|
2002-12-03 14:35:28 +00:00
|
|
|
|
*/
|
2003-12-01 08:47:37 +00:00
|
|
|
|
void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
|
|
|
|
|
const SvxZoomType _eZoomType )
|
|
|
|
|
{
|
|
|
|
|
// OD 24.09.2003 #i19975# - consider zoom type
|
|
|
|
|
if ( _eZoomType == SVX_ZOOM_WHOLEPAGE )
|
|
|
|
|
{
|
|
|
|
|
mnRow = 1;
|
|
|
|
|
mnCol = 1;
|
|
|
|
|
mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true );
|
|
|
|
|
mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize,
|
|
|
|
|
mnSttPage, maPaintedPreviewDocRect );
|
|
|
|
|
SetSelectedPage( mnSttPage );
|
|
|
|
|
SetPagePreview(mnRow, mnCol);
|
|
|
|
|
maScale = GetMapMode().GetScaleX();
|
|
|
|
|
}
|
|
|
|
|
else if ( _nZoomFactor != 0 )
|
|
|
|
|
{
|
|
|
|
|
// calculate new scaling and set mapping mode appropriately.
|
|
|
|
|
Fraction aNewScale( _nZoomFactor, 100 );
|
|
|
|
|
MapMode aNewMapMode = GetMapMode();
|
|
|
|
|
aNewMapMode.SetScaleX( aNewScale );
|
|
|
|
|
aNewMapMode.SetScaleY( aNewScale );
|
|
|
|
|
SetMapMode( aNewMapMode );
|
|
|
|
|
|
|
|
|
|
// calculate new start position for preview paint
|
|
|
|
|
Size aNewWinSize = PixelToLogic( maPxWinSize );
|
|
|
|
|
Point aNewPaintStartPos =
|
|
|
|
|
mpPgPrevwLayout->GetPreviewStartPosForNewScale( aNewScale, maScale, aNewWinSize );
|
|
|
|
|
|
|
|
|
|
// remember new scaling and prepare preview paint
|
|
|
|
|
// Note: paint of preview will be performed by a corresponding invalidate
|
|
|
|
|
// due to property changes.
|
|
|
|
|
maScale = aNewScale;
|
|
|
|
|
mpPgPrevwLayout->Prepare( 0, aNewPaintStartPos, maPxWinSize,
|
|
|
|
|
mnSttPage, maPaintedPreviewDocRect );
|
|
|
|
|
}
|
2002-12-03 14:35:28 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2002-12-04 11:17:32 +00:00
|
|
|
|
/* -----------------04.12.2002 10:46-----------------
|
|
|
|
|
* pixel scrolling - horizontally always or vertically
|
|
|
|
|
* when less than the desired number of rows fits into
|
|
|
|
|
* the view
|
|
|
|
|
* --------------------------------------------------*/
|
2007-09-27 11:35:25 +00:00
|
|
|
|
void SwPagePreViewWin::Scroll(long nXMove, long nYMove, USHORT /*nFlags*/)
|
2002-12-04 11:17:32 +00:00
|
|
|
|
{
|
|
|
|
|
maPaintedPreviewDocRect.Move(nXMove, nYMove);
|
2003-03-27 14:45:43 +00:00
|
|
|
|
mpPgPrevwLayout->Prepare( 0, maPaintedPreviewDocRect.TopLeft(),
|
2003-04-17 09:16:40 +00:00
|
|
|
|
maPxWinSize, mnSttPage,
|
2003-03-27 14:45:43 +00:00
|
|
|
|
maPaintedPreviewDocRect );
|
|
|
|
|
|
2002-12-04 11:17:32 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
BOOL SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt )
|
|
|
|
|
{
|
|
|
|
|
BOOL bOk = FALSE;
|
|
|
|
|
const CommandWheelData* pWData = rCEvt.GetWheelData();
|
|
|
|
|
if( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
|
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
if(!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
|
USHORT nFactor = GetViewShell()->GetViewOptions()->GetZoom();
|
|
|
|
|
const USHORT nOffset = 10;
|
|
|
|
|
if( 0L > pWData->GetDelta() )
|
|
|
|
|
{
|
|
|
|
|
nFactor -= nOffset;
|
|
|
|
|
if(nFactor < MIN_PREVIEW_ZOOM)
|
|
|
|
|
nFactor = MIN_PREVIEW_ZOOM;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nFactor += nOffset;
|
|
|
|
|
if(nFactor > MAX_PREVIEW_ZOOM)
|
|
|
|
|
nFactor = MAX_PREVIEW_ZOOM;
|
|
|
|
|
}
|
|
|
|
|
SetZoom(SVX_ZOOM_PERCENT, nFactor);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
bOk = TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
2003-03-27 14:45:43 +00:00
|
|
|
|
bOk = aViewWin.HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return bOk;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-22 10:48:43 +00:00
|
|
|
|
|
2007-09-27 11:35:25 +00:00
|
|
|
|
uno::Reference< ::com::sun::star::accessibility::XAccessible >
|
2002-05-22 10:48:43 +00:00
|
|
|
|
SwPagePreViewWin::CreateAccessible()
|
|
|
|
|
{
|
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
|
|
|
|
|
// happend already!!!
|
|
|
|
|
|
|
|
|
|
DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
return GetViewShell()->CreateAccessiblePreview();
|
2002-05-22 10:48:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-05-06 11:11:40 +00:00
|
|
|
|
/* -----------------------------06.05.2002 13:18------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2002-05-06 11:11:40 +00:00
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
void SwPagePreView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
GetViewShell()->ApplyAccessiblityOptions(rAccessibilityOptions);
|
2002-05-06 11:11:40 +00:00
|
|
|
|
}
|
2002-06-28 11:11:19 +00:00
|
|
|
|
/* -----------------------------2002/06/26 14:30------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2002-07-05 11:39:21 +00:00
|
|
|
|
void SwPagePreView::ShowHScrollbar(sal_Bool bShow)
|
2002-06-28 11:11:19 +00:00
|
|
|
|
{
|
2002-07-05 11:39:21 +00:00
|
|
|
|
pHScrollbar->Show(bShow);
|
|
|
|
|
InvalidateBorder();
|
2002-06-28 11:11:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -----------------------------2002/06/26 14:30------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
void SwPagePreView::ShowVScrollbar(sal_Bool bShow)
|
|
|
|
|
{
|
2002-07-05 11:39:21 +00:00
|
|
|
|
pVScrollbar->Show(bShow);
|
|
|
|
|
InvalidateBorder();
|
2002-06-28 11:11:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-11-27 08:01:27 +00:00
|
|
|
|
/* -----------------25.11.2002 16:36-----------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwPagePreView::SetZoom(SvxZoomType eType, USHORT nFactor)
|
|
|
|
|
{
|
2002-12-04 11:17:32 +00:00
|
|
|
|
ViewShell& rSh = *GetViewShell();
|
2002-11-27 08:01:27 +00:00
|
|
|
|
SwViewOption aOpt(*rSh.GetViewOptions());
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// OD 16.12.2002 #103492# - perform action only on changes of zoom or zoom type.
|
|
|
|
|
if ( aOpt.GetZoom() != nFactor ||
|
|
|
|
|
aOpt.GetZoomType() != eType )
|
|
|
|
|
{
|
|
|
|
|
aOpt.SetZoom(nFactor);
|
|
|
|
|
aOpt.SetZoomType(eType);
|
|
|
|
|
rSh.ApplyViewOptions( aOpt );
|
|
|
|
|
lcl_InvalidateZoomSlots(GetViewFrame()->GetBindings());
|
|
|
|
|
// OD 02.12.2002 #103492#
|
2003-12-01 08:47:37 +00:00
|
|
|
|
// OD 24.09.2003 #i19975# - also consider zoom type
|
|
|
|
|
aViewWin.AdjustPreviewToNewZoom( nFactor, eType );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
ScrollViewSzChg();
|
|
|
|
|
}
|
2002-11-27 08:01:27 +00:00
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
/** adjust position of vertical scrollbar
|
|
|
|
|
|
|
|
|
|
OD 19.02.2003 #107369
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
*/
|
|
|
|
|
void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
|
|
|
|
|
{
|
|
|
|
|
if ( pVScrollbar )
|
|
|
|
|
{
|
|
|
|
|
pVScrollbar->SetThumbPos( _nNewThumbPos );
|
|
|
|
|
}
|
|
|
|
|
}
|