2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 20:47:19 +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:47:19 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 20:47:19 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 20:47:19 +00:00
|
|
|
* $RCSfile: srcview.cxx,v $
|
2008-05-06 11:02:13 +00:00
|
|
|
* $Revision: 1.59 $
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 20:47:19 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 20:47:19 +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:47:19 +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:47:19 +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:23:03 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <hintids.hxx>
|
2001-03-12 07:18:49 +00:00
|
|
|
#include <com/sun/star/util/SearchOptions.hpp>
|
|
|
|
#include <com/sun/star/util/SearchFlags.hpp>
|
2001-03-19 15:00:15 +00:00
|
|
|
#include <com/sun/star/i18n/TransliterationModules.hpp>
|
2002-10-25 09:08:30 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
|
2000-11-06 08:30:33 +00:00
|
|
|
#include <unotools/tempfile.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#include <vcl/print.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <vcl/wrkwin.hxx>
|
|
|
|
#include <vcl/metric.hxx>
|
|
|
|
#include <svtools/ctrltool.hxx>
|
|
|
|
#include <svtools/intitem.hxx>
|
|
|
|
#include <svtools/stritem.hxx>
|
2000-10-06 12:41:54 +00:00
|
|
|
#include <svtools/pathoptions.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svtools/undo.hxx>
|
|
|
|
#include <svtools/txtcmp.hxx>
|
|
|
|
#include <svtools/eitem.hxx>
|
|
|
|
#include <svtools/whiter.hxx>
|
2000-10-06 12:41:54 +00:00
|
|
|
#include <svtools/saveopt.hxx>
|
2001-05-08 18:56:30 +00:00
|
|
|
#include <svtools/transfer.hxx>
|
|
|
|
|
2004-02-03 15:57:25 +00:00
|
|
|
#include <svx/htmlcfg.hxx>
|
|
|
|
#include <sfx2/app.hxx>
|
2004-10-04 18:31:59 +00:00
|
|
|
#include <sfx2/objface.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <sfx2/docfilt.hxx>
|
2004-08-02 12:10:26 +00:00
|
|
|
#include <sfx2/fcontnr.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <sfx2/prnmon.hxx>
|
|
|
|
#include <sfx2/docfile.hxx>
|
|
|
|
#include <svx/fhgtitem.hxx>
|
|
|
|
#include <svx/srchdlg.hxx>
|
|
|
|
#include <svx/srchitem.hxx>
|
|
|
|
#include <svx/fontitem.hxx>
|
|
|
|
#include <svx/flstitem.hxx>
|
2004-08-23 08:10:53 +00:00
|
|
|
#include "svx/unolingu.hxx"
|
2001-07-26 04:53:10 +00:00
|
|
|
#include <sfx2/sfxhtml.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <swtypes.hxx>
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
#include <docsh.hxx>
|
|
|
|
#include <wdocsh.hxx>
|
|
|
|
#include <srcview.hxx>
|
|
|
|
#include <viewfunc.hxx>
|
|
|
|
#include <doc.hxx>
|
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>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <shellio.hxx>
|
|
|
|
|
|
|
|
#include <cmdid.h> // FN_ ...
|
|
|
|
#include <helpid.h>
|
|
|
|
#include <globals.hrc>
|
|
|
|
#include <shells.hrc>
|
|
|
|
#include <popup.hrc>
|
|
|
|
#include <web.hrc>
|
|
|
|
#include <view.hrc>
|
2001-06-15 12:10:19 +00:00
|
|
|
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
|
|
|
|
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
|
2001-08-09 11:46:23 +00:00
|
|
|
#include <sfx2/filedlghelper.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#define SwSrcView
|
|
|
|
#define SearchSettings
|
|
|
|
#define _ExecSearch Execute
|
|
|
|
#define _StateSearch GetState
|
|
|
|
#include <svx/svxslots.hxx>
|
|
|
|
#include "swslots.hxx"
|
|
|
|
|
2007-09-27 11:35:49 +00:00
|
|
|
#include <unomid.h>
|
|
|
|
|
2008-02-26 13:26:11 +00:00
|
|
|
#include <com/sun/star/document/XDocumentProperties.hpp>
|
|
|
|
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
|
|
|
|
2007-09-27 11:35:49 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::i18n;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::ui::dialogs;
|
|
|
|
using namespace ::com::sun::star::i18n;
|
2001-05-15 09:14:56 +00:00
|
|
|
using namespace ::com::sun::star::lang;
|
2001-08-09 11:46:23 +00:00
|
|
|
using namespace ::sfx2;
|
2009-01-05 14:06:42 +00:00
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::com::sun::star::util::SearchOptions;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define SWSRCVIEWFLAGS ( SFX_VIEW_MAXIMIZE_FIRST| \
|
|
|
|
SFX_VIEW_OBJECTSIZE_EMBEDDED| \
|
|
|
|
SFX_VIEW_CAN_PRINT|\
|
|
|
|
SFX_VIEW_NO_NEWWINDOW )
|
|
|
|
|
|
|
|
#define SRC_SEARCHOPTIONS (0xFFFF & ~(SEARCH_OPTIONS_FORMAT|SEARCH_OPTIONS_FAMILIES|SEARCH_OPTIONS_SEARCH_ALL))
|
|
|
|
|
|
|
|
// Druckraender -> wie Basic - Ide
|
|
|
|
#define LMARGPRN 1700
|
|
|
|
#define RMARGPRN 900
|
|
|
|
#define TMARGPRN 2000
|
|
|
|
#define BMARGPRN 1000
|
|
|
|
#define BORDERPRN 300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SFX_IMPL_VIEWFACTORY(SwSrcView, SW_RES(STR_NONAME))
|
|
|
|
{
|
|
|
|
SFX_VIEW_REGISTRATION(SwWebDocShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SFX_IMPL_INTERFACE( SwSrcView, SfxViewShell, SW_RES(0) )
|
|
|
|
{
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_SRCVIEW_POPUPMENU));
|
|
|
|
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS|
|
|
|
|
SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
|
|
|
|
SW_RES(RID_WEBTOOLS_TOOLBOX) );
|
|
|
|
SFX_CHILDWINDOW_REGISTRATION(SvxSearchDialogWrapper::GetChildWindowId());
|
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT1(SwSrcView, SfxViewShell)
|
|
|
|
|
|
|
|
/*-----------------18.11.96 08.05-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
void lcl_PrintHeader( OutputDevice &rOutDev, USHORT nPages, USHORT nCurPage, const String& rTitle )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
short nLeftMargin = LMARGPRN;
|
2009-09-03 15:12:37 +00:00
|
|
|
Size aSz = rOutDev.GetOutputSize();
|
2000-09-18 16:15:01 +00:00
|
|
|
short nBorder = BORDERPRN;
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
Color aOldFillColor( rOutDev.GetFillColor() );
|
|
|
|
Font aOldFont( rOutDev.GetFont() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.SetFillColor( Color(COL_TRANSPARENT) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
Font aFont( aOldFont );
|
|
|
|
aFont.SetWeight( WEIGHT_BOLD );
|
|
|
|
aFont.SetAlign( ALIGN_BOTTOM );
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.SetFont( aFont );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
long nFontHeight = rOutDev.GetTextHeight();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
// 1.Border => Strich, 2+3 Border = Freiraum.
|
|
|
|
long nYTop = TMARGPRN-3*nBorder-nFontHeight;
|
|
|
|
|
|
|
|
long nXLeft = nLeftMargin-nBorder;
|
|
|
|
long nXRight = aSz.Width()-RMARGPRN+nBorder;
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.DrawRect( Rectangle(
|
2000-09-18 16:15:01 +00:00
|
|
|
Point( nXLeft, nYTop ),
|
|
|
|
Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
long nY = TMARGPRN-2*nBorder;
|
|
|
|
Point aPos( nLeftMargin, nY );
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.DrawText( aPos, rTitle );
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( nPages != 1 )
|
|
|
|
{
|
|
|
|
aFont.SetWeight( WEIGHT_NORMAL );
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.SetFont( aFont );
|
2000-09-18 16:15:01 +00:00
|
|
|
String aPageStr( C2S(" [") );
|
|
|
|
aPageStr += String( SW_RES( STR_PAGE ) );
|
|
|
|
aPageStr += ' ';
|
|
|
|
aPageStr += String::CreateFromInt32( nCurPage );
|
|
|
|
aPageStr += ']';
|
2009-09-03 15:12:37 +00:00
|
|
|
aPos.X() += rOutDev.GetTextWidth( rTitle );
|
|
|
|
rOutDev.DrawText( aPos, aPageStr );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nY = TMARGPRN-nBorder;
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
rOutDev.SetFont( aOldFont );
|
|
|
|
rOutDev.SetFillColor( aOldFillColor );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2003-12-01 10:30:19 +00:00
|
|
|
/* -----------------13.11.2003 16:24-----------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2003-12-01 10:30:19 +00:00
|
|
|
--------------------------------------------------*/
|
|
|
|
rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding)
|
|
|
|
{
|
|
|
|
rtl_TextEncoding eRet = eLoadEncoding;
|
|
|
|
if(RTL_TEXTENCODING_DONTKNOW == eRet)
|
|
|
|
{
|
2004-02-06 09:50:34 +00:00
|
|
|
SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
|
2003-12-01 10:30:19 +00:00
|
|
|
const sal_Char *pCharSet =
|
|
|
|
rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
|
|
|
|
eRet = rtl_getTextEncodingFromMimeCharset( pCharSet );
|
|
|
|
}
|
|
|
|
return eRet;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
/*-----------------18.11.96 08.21-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
|
|
|
void lcl_ConvertTabsToSpaces( String& rLine )
|
|
|
|
{
|
|
|
|
if ( rLine.Len() )
|
|
|
|
{
|
|
|
|
USHORT nPos = 0;
|
|
|
|
USHORT nMax = rLine.Len();
|
|
|
|
while ( nPos < nMax )
|
|
|
|
{
|
|
|
|
if ( rLine.GetChar(nPos) == '\t' )
|
|
|
|
{
|
|
|
|
// Nicht 4 Blanks, sondern an 4er TabPos:
|
|
|
|
String aBlanker;
|
|
|
|
aBlanker.Fill( ( 4 - ( nPos % 4 ) ), ' ' );
|
|
|
|
rLine.Erase( nPos, 1 );
|
|
|
|
rLine.Insert( aBlanker, nPos );
|
|
|
|
nMax = rLine.Len();
|
|
|
|
}
|
|
|
|
nPos++; // Nicht optimal, falls Tab, aber auch nicht verkehrt...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
2007-09-27 11:35:49 +00:00
|
|
|
SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
|
|
|
|
SfxViewShell( pViewFrame, SWSRCVIEWFLAGS ),
|
|
|
|
aEditWin( &pViewFrame->GetWindow(), this ),
|
2000-09-18 16:15:01 +00:00
|
|
|
pSearchItem(0),
|
2002-01-11 08:43:53 +00:00
|
|
|
bSourceSaved(FALSE),
|
|
|
|
eLoadEncoding(RTL_TEXTENCODING_DONTKNOW)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
SwSrcView::~SwSrcView()
|
|
|
|
{
|
|
|
|
SwDocShell* pDocShell = GetDocShell();
|
2008-11-10 15:06:12 +00:00
|
|
|
DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
|
2000-09-18 16:15:01 +00:00
|
|
|
const TextSelection& rSel = aEditWin.GetTextView()->GetSelection();
|
2004-08-02 12:10:26 +00:00
|
|
|
((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< USHORT >( rSel.GetStart().GetPara() ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2008-02-26 13:26:11 +00:00
|
|
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
|
|
|
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
|
|
|
|
uno::Reference<document::XDocumentProperties> xDocProps
|
|
|
|
= xDPS->getDocumentProperties();
|
|
|
|
::rtl::OUString url = xDocProps->getAutoloadURL();
|
|
|
|
sal_Int32 delay = xDocProps->getAutoloadSecs();
|
|
|
|
pDocShell->SetAutoLoad(INetURLObject(url), delay,
|
|
|
|
(delay != 0) || !url.equalsAscii(""));
|
2000-09-18 16:15:01 +00:00
|
|
|
// EndListening(*GetViewFrame());
|
|
|
|
EndListening(*pDocShell);
|
|
|
|
delete pSearchItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------24.04.97 10:37-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
void SwSrcView::SaveContentTo(SfxMedium& rMed)
|
|
|
|
{
|
2008-05-06 11:02:13 +00:00
|
|
|
SvStream* pOutStream = rMed.GetOutStream();
|
|
|
|
pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding));
|
|
|
|
aEditWin.Write( *pOutStream );//, EE_FORMAT_TEXT);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
void SwSrcView::Init()
|
|
|
|
{
|
|
|
|
SetHelpId(SW_SRC_VIEWSHELL);
|
|
|
|
SetName(C2S("Source"));
|
|
|
|
SetWindow( &aEditWin );
|
|
|
|
SwDocShell* pDocShell = GetDocShell();
|
|
|
|
// wird das Doc noch geladen, dann muss die DocShell das Load
|
|
|
|
// anwerfen, wenn das Laden abgeschlossen ist
|
|
|
|
if(!pDocShell->IsLoading())
|
|
|
|
Load(pDocShell);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aEditWin.SetReadonly(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
// StartListening(*GetViewFrame());
|
2006-02-10 09:12:28 +00:00
|
|
|
StartListening(*pDocShell,TRUE);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
SwDocShell* SwSrcView::GetDocShell()
|
|
|
|
{
|
|
|
|
SfxObjectShell* pObjShell = GetViewFrame()->GetObjectShell();
|
|
|
|
return PTR_CAST(SwDocShell, pObjShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
void SwSrcView::SaveContent(const String& rTmpFile)
|
|
|
|
{
|
|
|
|
SfxMedium aMedium( rTmpFile, STREAM_WRITE, TRUE);
|
|
|
|
SvStream* pOutStream = aMedium.GetOutStream();
|
2003-12-01 10:30:19 +00:00
|
|
|
pOutStream->SetStreamCharSet( lcl_GetStreamCharSet(eLoadEncoding) );
|
2000-09-18 16:15:01 +00:00
|
|
|
aEditWin.Write(*pOutStream);//, EE_FORMAT_TEXT);
|
|
|
|
aMedium.Commit();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
2000-10-06 12:41:54 +00:00
|
|
|
void SwSrcView::Execute(SfxRequest& rReq)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
USHORT nSlot = rReq.GetSlot();
|
|
|
|
TextView* pTextView = aEditWin.GetTextView();
|
|
|
|
switch( nSlot )
|
|
|
|
{
|
|
|
|
case SID_SAVEASDOC:
|
|
|
|
{
|
2000-10-06 12:41:54 +00:00
|
|
|
SvtPathOptions aPathOpt;
|
2004-08-02 12:10:26 +00:00
|
|
|
// filesave dialog with autoextension
|
2006-10-12 10:08:56 +00:00
|
|
|
FileDialogHelper aDlgHelper(
|
|
|
|
TemplateDescription::FILESAVE_AUTOEXTENSION,
|
|
|
|
TemplateDescription::FILESAVE_SIMPLE );
|
2007-06-05 16:43:55 +00:00
|
|
|
uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
|
2004-08-02 12:10:26 +00:00
|
|
|
// pFileDlg->SetHelpId(HID_FILEDLG_SRCVIEW);
|
2007-06-05 16:43:55 +00:00
|
|
|
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
|
2001-05-15 09:14:56 +00:00
|
|
|
|
2004-08-02 12:10:26 +00:00
|
|
|
// search for an html filter for export
|
|
|
|
SfxFilterContainer* pFilterCont = GetObjectShell()->GetFactory().GetFilterContainer();
|
|
|
|
const SfxFilter* pFilter =
|
|
|
|
pFilterCont->GetFilter4Extension( C2S("html"), SFX_FILTER_EXPORT );
|
|
|
|
if ( pFilter )
|
|
|
|
{
|
|
|
|
// filter found -> use its uiname and wildcard
|
|
|
|
const String& rUIName = pFilter->GetUIName();
|
|
|
|
const WildCard& rCard = pFilter->GetWildcard();
|
|
|
|
xFltMgr->appendFilter( rUIName, rCard() );
|
|
|
|
xFltMgr->setCurrentFilter( rUIName ) ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// filter not found
|
|
|
|
String sHtml(C2S("HTML"));
|
|
|
|
xFltMgr->appendFilter( sHtml, C2S("*.html;*.htm") );
|
|
|
|
xFltMgr->setCurrentFilter( sHtml ) ;
|
|
|
|
}
|
|
|
|
|
2001-05-15 09:14:56 +00:00
|
|
|
xFP->setDisplayDirectory( aPathOpt.GetWorkPath() );
|
2001-12-06 13:48:25 +00:00
|
|
|
if( aDlgHelper.Execute() == ERRCODE_NONE)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2001-06-15 12:10:19 +00:00
|
|
|
SfxMedium aMedium( xFP->getFiles().getConstArray()[0],
|
2000-11-01 18:32:39 +00:00
|
|
|
STREAM_WRITE | STREAM_SHARE_DENYNONE,
|
|
|
|
FALSE );
|
2003-12-01 10:30:19 +00:00
|
|
|
SvStream* pOutStream = aMedium.GetOutStream();
|
|
|
|
pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding));
|
|
|
|
aEditWin.Write( *pOutStream );
|
2000-11-01 18:32:39 +00:00
|
|
|
aMedium.Commit();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SAVEDOC:
|
|
|
|
{
|
|
|
|
SwDocShell* pDocShell = GetDocShell();
|
|
|
|
SfxMedium* pMed = 0;
|
|
|
|
if(pDocShell->HasName())
|
|
|
|
pMed = pDocShell->GetMedium();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SfxBoolItem* pItem = (SfxBoolItem*)pDocShell->ExecuteSlot(rReq, pDocShell->GetInterface());
|
|
|
|
if(pItem && pItem->GetValue())
|
|
|
|
pMed = pDocShell->GetMedium();
|
|
|
|
}
|
|
|
|
if(pMed)
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
SvStream* pOutStream = pMed->GetOutStream();
|
|
|
|
pOutStream->Seek(0);
|
|
|
|
pOutStream->SetStreamSize(0);
|
2003-12-01 10:30:19 +00:00
|
|
|
pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding));
|
2003-03-27 14:45:43 +00:00
|
|
|
aEditWin.Write( *pOutStream );
|
|
|
|
pMed->CloseOutStream();
|
2000-09-18 16:15:01 +00:00
|
|
|
pMed->Commit();
|
|
|
|
pDocShell->GetDoc()->ResetModified();
|
|
|
|
SourceSaved();
|
|
|
|
aEditWin.ClearModifyFlag();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FID_SEARCH_NOW:
|
|
|
|
{
|
2007-09-27 11:35:49 +00:00
|
|
|
const SfxItemSet* pTmpArgs = rReq.GetArgs();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-09-27 11:35:49 +00:00
|
|
|
USHORT nWhich = pTmpArgs->GetWhichByPos( 0 );
|
2000-09-18 16:15:01 +00:00
|
|
|
DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" );
|
2007-09-27 11:35:49 +00:00
|
|
|
const SfxPoolItem& rItem = pTmpArgs->Get( nWhich );
|
2000-09-18 16:15:01 +00:00
|
|
|
SetSearchItem( (const SvxSearchItem&)rItem);
|
|
|
|
StartSearchAndReplace( (const SvxSearchItem&)rItem, FALSE, rReq.IsAPI() );
|
|
|
|
if(aEditWin.IsModified())
|
|
|
|
GetDocShell()->GetDoc()->SetModified();
|
|
|
|
}
|
|
|
|
break;
|
2003-09-25 09:51:28 +00:00
|
|
|
case FN_REPEAT_SEARCH:
|
|
|
|
{
|
|
|
|
SvxSearchItem* pSrchItem = GetSearchItem();
|
|
|
|
if(pSrchItem)
|
|
|
|
{
|
|
|
|
StartSearchAndReplace( *pSrchItem, FALSE, rReq.IsAPI() );
|
|
|
|
if(aEditWin.IsModified())
|
|
|
|
GetDocShell()->GetDoc()->SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_PRINTDOC:
|
|
|
|
case SID_PRINTDOCDIRECT:
|
|
|
|
{
|
|
|
|
SfxViewShell::ExecuteSlot( rReq, SfxViewShell::GetInterface() );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_UNDO:
|
|
|
|
pTextView->Undo();
|
|
|
|
break;
|
|
|
|
case SID_REDO:
|
|
|
|
pTextView->Redo();
|
|
|
|
break;
|
|
|
|
case SID_REPEAT:
|
|
|
|
break;
|
|
|
|
case SID_CUT:
|
|
|
|
pTextView->Cut();
|
|
|
|
break;
|
|
|
|
case SID_COPY:
|
|
|
|
pTextView->Copy();
|
|
|
|
break;
|
|
|
|
case SID_PASTE:
|
|
|
|
pTextView->Paste();
|
|
|
|
break;
|
|
|
|
case SID_SELECTALL:
|
|
|
|
pTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
aEditWin.Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
2000-10-06 12:41:54 +00:00
|
|
|
void SwSrcView::GetState(SfxItemSet& rSet)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
TextView* pTextView = aEditWin.GetTextView();
|
|
|
|
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
switch(nWhich)
|
|
|
|
{
|
|
|
|
case SID_SAVEASDOC:
|
|
|
|
rSet.Put(SfxStringItem(nWhich, String(SW_RES(STR_SAVEAS_SRC))));
|
|
|
|
break;
|
|
|
|
case SID_SAVEDOC:
|
|
|
|
{
|
|
|
|
SwDocShell* pDocShell = GetDocShell();
|
|
|
|
if(!pDocShell->IsModified())
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_PRINTDOC:
|
|
|
|
case SID_PRINTDOCDIRECT:
|
|
|
|
break;
|
|
|
|
case SID_TABLE_CELL:
|
|
|
|
{
|
|
|
|
String aPos( SW_RES(STR_SRCVIEW_ROW) );
|
|
|
|
TextSelection aSel = pTextView->GetSelection();
|
|
|
|
aPos += String::CreateFromInt32( aSel.GetEnd().GetPara()+1 );
|
|
|
|
aPos +=C2S(" : ");
|
|
|
|
aPos += String(SW_RES(STR_SRCVIEW_COL));
|
|
|
|
aPos += String::CreateFromInt32( aSel.GetEnd().GetIndex()+1 );
|
|
|
|
SfxStringItem aItem( nWhich, aPos );
|
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SEARCH_OPTIONS:
|
|
|
|
{
|
|
|
|
USHORT nOpt = SRC_SEARCHOPTIONS;
|
|
|
|
if(GetDocShell()->IsReadOnly())
|
|
|
|
nOpt &= ~(SEARCH_OPTIONS_REPLACE|SEARCH_OPTIONS_REPLACE_ALL);
|
|
|
|
|
|
|
|
rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, nOpt) );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SEARCH_ITEM:
|
|
|
|
{
|
|
|
|
String sSelected;
|
|
|
|
if ( !pTextView->HasSelection() )
|
|
|
|
{
|
|
|
|
const TextSelection& rSel = pTextView->GetSelection();
|
|
|
|
sSelected = aEditWin.GetTextEngine()->GetWord( rSel.GetStart());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sSelected = pTextView->GetSelected();
|
|
|
|
}
|
|
|
|
SvxSearchItem * pSrchItem = GetSearchItem();
|
|
|
|
pSrchItem->SetSearchString( sSelected );
|
|
|
|
rSet.Put( *pSrchItem );
|
|
|
|
}
|
|
|
|
break;
|
2003-09-25 09:51:28 +00:00
|
|
|
case FN_REPEAT_SEARCH:
|
|
|
|
{
|
|
|
|
if(!GetSearchItem())
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
};
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_UNDO:
|
|
|
|
case SID_REDO:
|
|
|
|
{
|
|
|
|
SfxUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
|
|
|
|
USHORT nCount = 0;
|
|
|
|
if(nWhich == SID_UNDO)
|
|
|
|
{
|
|
|
|
nCount = rMgr.GetUndoActionCount();
|
|
|
|
if(nCount)
|
|
|
|
{
|
2007-04-26 08:21:28 +00:00
|
|
|
String aStr(ResId( STR_UNDO, *SFX_APP()->GetSfxResManager() ));;
|
2000-09-18 16:15:01 +00:00
|
|
|
aStr += rMgr.GetUndoActionComment(--nCount);
|
|
|
|
rSet.Put(SfxStringItem(nWhich, aStr));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nCount = rMgr.GetRedoActionCount();
|
|
|
|
if(nCount)
|
|
|
|
{
|
2007-04-26 08:21:28 +00:00
|
|
|
String aStr(ResId( STR_REDO, *SFX_APP()->GetSfxResManager() ));;
|
2000-09-18 16:15:01 +00:00
|
|
|
aStr += rMgr.GetRedoActionComment(--nCount);
|
|
|
|
rSet.Put(SfxStringItem(nWhich,aStr));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2003-03-27 14:45:43 +00:00
|
|
|
case SID_MAIL_SENDDOCASPDF:
|
|
|
|
case SID_MAIL_SENDDOC :
|
|
|
|
case SID_EXPORTDOCASPDF:
|
|
|
|
case SID_DIRECTEXPORTDOCASPDF:
|
|
|
|
case SID_EXPORTDOC:
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_REPEAT:
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
break;
|
|
|
|
case SID_CUT:
|
|
|
|
case SID_COPY:
|
|
|
|
if(!pTextView->HasSelection())
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
break;
|
|
|
|
case SID_PASTE:
|
|
|
|
{
|
2001-05-08 18:56:30 +00:00
|
|
|
BOOL bDisable = 0 == SW_MOD()->pClipboard;
|
|
|
|
if( bDisable )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2001-05-08 18:56:30 +00:00
|
|
|
TransferableDataHelper aDataHelper(
|
2001-05-22 15:41:30 +00:00
|
|
|
TransferableDataHelper::CreateFromSystemClipboard(
|
|
|
|
&aEditWin) );
|
2001-09-07 10:26:22 +00:00
|
|
|
bDisable = !aDataHelper.GetXTransferable().is() ||
|
2001-05-08 18:56:30 +00:00
|
|
|
0 == aDataHelper.GetFormatCount();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2001-03-23 14:55:45 +00:00
|
|
|
if( bDisable )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
SvxSearchItem* SwSrcView::GetSearchItem()
|
|
|
|
{
|
|
|
|
if(!pSearchItem)
|
|
|
|
{
|
|
|
|
pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM);
|
|
|
|
}
|
|
|
|
return pSearchItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
void SwSrcView::SetSearchItem( const SvxSearchItem& rItem )
|
|
|
|
{
|
|
|
|
delete pSearchItem;
|
|
|
|
pSearchItem = (SvxSearchItem*)rItem.Clone();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
|
|
|
BOOL bFromStart,
|
|
|
|
BOOL bApi,
|
|
|
|
BOOL bRecursive)
|
|
|
|
{
|
|
|
|
ExtTextView* pTextView = aEditWin.GetTextView();
|
|
|
|
TextSelection aSel;
|
2001-03-27 20:47:24 +00:00
|
|
|
TextPaM aPaM;
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
BOOL bForward = !rSearchItem.GetBackward();
|
2001-03-27 20:47:24 +00:00
|
|
|
BOOL bAtStart = pTextView->GetSelection() == TextSelection( aPaM, aPaM );
|
|
|
|
|
|
|
|
if( !bForward )
|
|
|
|
aPaM = TextPaM( (ULONG)-1, (USHORT)-1 );
|
|
|
|
|
|
|
|
if( bFromStart )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
aSel = pTextView->GetSelection();
|
2001-03-27 20:47:24 +00:00
|
|
|
pTextView->SetSelection( TextSelection( aPaM, aPaM ));
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
2008-12-09 07:49:49 +00:00
|
|
|
util::SearchOptions aSearchOpt( rSearchItem.GetSearchOptions() );
|
2004-08-23 08:10:53 +00:00
|
|
|
aSearchOpt.Locale = SvxCreateLocale(
|
|
|
|
static_cast< LanguageType >( GetAppLanguage() ) );
|
2001-03-12 07:18:49 +00:00
|
|
|
|
2001-03-27 20:47:24 +00:00
|
|
|
USHORT nFound;
|
|
|
|
BOOL bAll = FALSE;
|
|
|
|
switch( rSearchItem.GetCommand() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2001-03-27 20:47:24 +00:00
|
|
|
case SVX_SEARCHCMD_FIND:
|
|
|
|
case SVX_SEARCHCMD_FIND_ALL:
|
2001-03-12 07:18:49 +00:00
|
|
|
nFound = pTextView->Search( aSearchOpt, bForward );
|
2001-03-27 20:47:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SVX_SEARCHCMD_REPLACE_ALL: bAll = TRUE;
|
|
|
|
case SVX_SEARCHCMD_REPLACE:
|
2001-03-12 07:18:49 +00:00
|
|
|
nFound = pTextView->Replace( aSearchOpt, bAll, bForward );
|
2002-01-15 08:14:53 +00:00
|
|
|
break;
|
|
|
|
|
2001-03-27 20:47:24 +00:00
|
|
|
default:
|
|
|
|
nFound = 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2001-03-27 20:47:24 +00:00
|
|
|
|
|
|
|
if( !nFound )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
BOOL bNotFoundMessage = FALSE;
|
|
|
|
if(!bRecursive)
|
|
|
|
{
|
|
|
|
if(!bFromStart)
|
|
|
|
{
|
|
|
|
bNotFoundMessage = bAtStart;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bNotFoundMessage = TRUE;
|
|
|
|
pTextView->SetSelection( aSel );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(bAtStart)
|
|
|
|
{
|
|
|
|
bNotFoundMessage = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!bApi)
|
|
|
|
if(bNotFoundMessage)
|
|
|
|
{
|
|
|
|
InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute();
|
|
|
|
}
|
|
|
|
else if(!bRecursive && RET_YES ==
|
|
|
|
QueryBox(0, SW_RES( bForward ? MSG_SEARCH_END
|
|
|
|
: MSG_SEARCH_START)).Execute())
|
|
|
|
{
|
2001-03-27 20:47:24 +00:00
|
|
|
pTextView->SetSelection( TextSelection( aPaM, aPaM ) );
|
|
|
|
StartSearchAndReplace( rSearchItem, FALSE, FALSE, TRUE );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nFound;
|
|
|
|
}
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-07-17 12:11:57 +00:00
|
|
|
USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SwDocShell* pDocSh = GetDocShell();
|
|
|
|
if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
|
|
|
|
{
|
2006-08-14 16:56:25 +00:00
|
|
|
pDocSh->GetDoc()->setPrinter( pNew, true, true );
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( nDiffFlags & SFX_PRINTER_PRINTER )
|
|
|
|
pDocSh->SetModified();
|
|
|
|
}
|
|
|
|
if ( nDiffFlags & SFX_PRINTER_OPTIONS )
|
2008-03-05 15:48:23 +00:00
|
|
|
::SetPrinter( pDocSh->getIDocumentDeviceAccess(), pNew, TRUE );
|
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 )
|
|
|
|
{
|
|
|
|
pDocSh->SetModified();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
SfxPrinter* SwSrcView::GetPrinter( BOOL bCreate )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-09-03 15:12:37 +00:00
|
|
|
return GetDocShell()->GetDoc()->getPrinter( bCreate );
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
sal_Int32 SwSrcView::PrintSource(
|
|
|
|
OutputDevice *pOutDev,
|
|
|
|
sal_Int32 nPage,
|
|
|
|
bool bCalcNumPagesOnly )
|
|
|
|
{
|
|
|
|
if (!pOutDev || nPage <= 0)
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
//! this a lgorithm for printing the n-th page is very poor since it
|
|
|
|
//! needs to go over the text of all previous pages to get to the correct one.
|
|
|
|
//! But since HTML source code is expected to be just a small number of pages
|
|
|
|
//! even this poor algorithm should be enough...
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
pOutDev->Push();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
TextEngine* pTextEngine = aEditWin.GetTextEngine();
|
2009-09-03 15:12:37 +00:00
|
|
|
pOutDev->SetMapMode( MAP_100TH_MM );
|
|
|
|
Font aFont( aEditWin.GetOutWin()->GetFont() );
|
|
|
|
Size aSize( aFont.GetSize() );
|
|
|
|
aSize = aEditWin.GetOutWin()->PixelToLogic( aSize, MAP_100TH_MM );
|
|
|
|
aFont.SetSize( aSize );
|
|
|
|
aFont.SetColor( COL_BLACK );
|
|
|
|
pOutDev->SetFont( aFont );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
String aTitle( GetViewFrame()->GetWindow().GetText() );
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
USHORT nLineHeight = (USHORT) pOutDev->GetTextHeight(); // etwas mehr.
|
2000-09-18 16:15:01 +00:00
|
|
|
USHORT nParaSpace = 10;
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
Size aPaperSz = pOutDev->GetOutputSize();
|
|
|
|
aPaperSz.Width() -= (LMARGPRN + RMARGPRN);
|
|
|
|
aPaperSz.Height() -= (TMARGPRN + BMARGPRN);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
// nLinepPage stimmt nicht, wenn Zeilen umgebrochen werden muessen...
|
2009-09-03 15:12:37 +00:00
|
|
|
USHORT nLinespPage = (USHORT) (aPaperSz.Height() / nLineHeight);
|
|
|
|
USHORT nCharspLine = (USHORT) (aPaperSz.Width() / pOutDev->GetTextWidth( 'X' ));
|
2004-08-02 12:10:26 +00:00
|
|
|
USHORT nParas = static_cast< USHORT >( pTextEngine->GetParagraphCount() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
USHORT nPages = (USHORT) (nParas / nLinespPage + 1 );
|
2000-09-18 16:15:01 +00:00
|
|
|
USHORT nCurPage = 1;
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
// Header drucken...
|
|
|
|
if (!bCalcNumPagesOnly && nPage == nCurPage)
|
|
|
|
lcl_PrintHeader( *pOutDev, nPages, nCurPage, aTitle );
|
|
|
|
Point aPos( LMARGPRN, TMARGPRN );
|
|
|
|
for ( USHORT nPara = 0; nPara < nParas; ++nPara )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-09-03 15:12:37 +00:00
|
|
|
String aLine( pTextEngine->GetText( nPara ) );
|
|
|
|
lcl_ConvertTabsToSpaces( aLine );
|
|
|
|
USHORT nLines = aLine.Len() / nCharspLine + 1;
|
|
|
|
for ( USHORT nLine = 0; nLine < nLines; ++nLine )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-09-03 15:12:37 +00:00
|
|
|
String aTmpLine( aLine, nLine * nCharspLine, nCharspLine );
|
|
|
|
aPos.Y() += nLineHeight;
|
|
|
|
if ( aPos.Y() > ( aPaperSz.Height() + TMARGPRN ) )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2009-09-03 15:12:37 +00:00
|
|
|
++nCurPage;
|
|
|
|
if (!bCalcNumPagesOnly && nPage == nCurPage)
|
|
|
|
lcl_PrintHeader( *pOutDev, nPages, nCurPage, aTitle );
|
|
|
|
aPos = Point( LMARGPRN, TMARGPRN + nLineHeight );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2009-09-03 15:12:37 +00:00
|
|
|
if (!bCalcNumPagesOnly && nPage == nCurPage)
|
|
|
|
pOutDev->DrawText( aPos, aTmpLine );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2009-09-03 15:12:37 +00:00
|
|
|
aPos.Y() += nParaSpace;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
pOutDev->Pop();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-03 15:12:37 +00:00
|
|
|
DBG_ASSERT( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" );
|
|
|
|
return nCurPage;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
Beschreibung:
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
2000-10-06 12:41:54 +00:00
|
|
|
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
if ( rHint.ISA(SfxSimpleHint) &&
|
2009-02-13 11:19:56 +00:00
|
|
|
(
|
|
|
|
((SfxSimpleHint&) rHint).GetId() == SFX_HINT_MODECHANGED ||
|
|
|
|
(
|
|
|
|
((SfxSimpleHint&) rHint).GetId() == SFX_HINT_TITLECHANGED &&
|
|
|
|
!GetDocShell()->IsReadOnly() && aEditWin.IsReadonly()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
// Broadcast kommt nur einmal!
|
|
|
|
const SwDocShell* pDocSh = GetDocShell();
|
|
|
|
const BOOL bReadonly = pDocSh->IsReadOnly();
|
|
|
|
aEditWin.SetReadonly(bReadonly);
|
|
|
|
}
|
|
|
|
SfxViewShell::Notify(rBC, rHint);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------19.04.97 10:19-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
void SwSrcView::Load(SwDocShell* pDocShell)
|
|
|
|
{
|
2004-02-03 15:57:25 +00:00
|
|
|
SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
|
2000-09-18 16:15:01 +00:00
|
|
|
const sal_Char *pCharSet =
|
2001-07-26 04:53:10 +00:00
|
|
|
rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
|
2000-09-18 16:15:01 +00:00
|
|
|
rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
|
2001-07-26 04:53:10 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
aEditWin.SetReadonly(pDocShell->IsReadOnly());
|
2003-03-27 14:45:43 +00:00
|
|
|
aEditWin.SetTextEncoding(eDestEnc);
|
2000-09-18 16:15:01 +00:00
|
|
|
SfxMedium* pMedium = pDocShell->GetMedium();
|
|
|
|
|
|
|
|
const SfxFilter* pFilter = pMedium->GetFilter();
|
2001-07-10 07:51:04 +00:00
|
|
|
BOOL bHtml = pFilter && pFilter->GetUserData().EqualsAscii("HTML");
|
2000-09-18 16:15:01 +00:00
|
|
|
BOOL bDocModified = pDocShell->IsModified();
|
|
|
|
if(bHtml && !bDocModified && pDocShell->HasName())
|
|
|
|
{
|
|
|
|
SvStream* pStream = pMedium->GetInStream();
|
|
|
|
if(pStream && 0 == pStream->GetError() )
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
rtl_TextEncoding eHeaderEnc =
|
|
|
|
SfxHTMLParser::GetEncodingByHttpHeader(
|
|
|
|
pDocShell->GetHeaderAttributes() );
|
2003-04-01 14:42:05 +00:00
|
|
|
if( RTL_TEXTENCODING_DONTKNOW == eHeaderEnc )
|
|
|
|
{
|
2007-09-27 11:35:49 +00:00
|
|
|
const sal_Char *pTmpCharSet =
|
2003-04-01 14:42:05 +00:00
|
|
|
rtl_getBestMimeCharsetFromTextEncoding( RTL_TEXTENCODING_ISO_8859_1 );
|
2007-09-27 11:35:49 +00:00
|
|
|
eHeaderEnc = rtl_getTextEncodingFromMimeCharset( pTmpCharSet );
|
2003-04-01 14:42:05 +00:00
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
if( RTL_TEXTENCODING_DONTKNOW != eHeaderEnc &&
|
|
|
|
eDestEnc != eHeaderEnc )
|
|
|
|
{
|
|
|
|
eDestEnc = eHeaderEnc;
|
|
|
|
aEditWin.SetTextEncoding(eDestEnc);
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
pStream->SetStreamCharSet( eDestEnc );
|
|
|
|
pStream->Seek(0);
|
2002-07-01 13:50:10 +00:00
|
|
|
TextEngine* pTextEngine = aEditWin.GetTextEngine();
|
|
|
|
pTextEngine->EnableUndo(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
aEditWin.Read(*pStream);//, EE_FORMAT_TEXT);
|
2002-07-01 13:50:10 +00:00
|
|
|
pTextEngine->EnableUndo(TRUE);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-09-27 11:35:49 +00:00
|
|
|
Window *pTmpWindow = &GetViewFrame()->GetWindow();
|
|
|
|
InfoBox(pTmpWindow, SW_RES(MSG_ERR_SRCSTREAM)).Execute();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-11-06 08:30:33 +00:00
|
|
|
utl::TempFile aTempFile;
|
2000-09-18 16:15:01 +00:00
|
|
|
aTempFile.EnableKillingFile();
|
2005-01-11 11:44:26 +00:00
|
|
|
String sFileURL( aTempFile.GetURL() );
|
2000-10-06 12:41:54 +00:00
|
|
|
SvtSaveOptions aOpt;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
SfxMedium aMedium( sFileURL,STREAM_READWRITE, TRUE );
|
|
|
|
SwWriter aWriter( aMedium, *pDocShell->GetDoc() );
|
|
|
|
WriterRef xWriter;
|
2005-01-11 11:44:26 +00:00
|
|
|
::GetHTMLWriter(aEmptyStr, aMedium.GetBaseURL( true ), xWriter);
|
2000-09-18 16:15:01 +00:00
|
|
|
String sWriteName = pDocShell->HasName() ?
|
|
|
|
pMedium->GetName() :
|
|
|
|
(const String&) sFileURL;
|
|
|
|
ULONG nRes = aWriter.Write(xWriter, &sWriteName);
|
|
|
|
if(nRes)
|
|
|
|
{
|
|
|
|
ErrorHandler::HandleError(ErrCode(nRes));
|
|
|
|
aEditWin.SetReadonly(TRUE);
|
|
|
|
}
|
2001-08-23 13:48:44 +00:00
|
|
|
aMedium.Commit();
|
2000-09-18 16:15:01 +00:00
|
|
|
SvStream* pInStream = aMedium.GetInStream();
|
|
|
|
pInStream->Seek(0);
|
|
|
|
pInStream->SetStreamCharSet( eDestEnc );
|
|
|
|
|
|
|
|
|
|
|
|
aEditWin.Read(*pInStream);//, EE_FORMAT_TEXT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aEditWin.ClearModifyFlag();
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
eLoadEncoding = eDestEnc;
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
if(bDocModified)
|
|
|
|
pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt
|
|
|
|
// AutoLoad abschalten
|
|
|
|
pDocShell->SetAutoLoad(INetURLObject(), 0, FALSE);
|
2008-11-10 15:06:12 +00:00
|
|
|
DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
|
2000-09-18 16:15:01 +00:00
|
|
|
USHORT nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
|
|
|
|
aEditWin.SetStartLine(nLine);
|
|
|
|
aEditWin.GetTextEngine()->ResetUndo();
|
|
|
|
aEditWin.GetOutWin()->GrabFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
|