diff options
author | Release Engineers <releng@openoffice.org> | 2009-07-02 09:05:03 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-07-02 09:05:03 +0000 |
commit | 65f02b557c44b9a544dc0cd336b318c61491bf97 (patch) | |
tree | 182a6af207c98feea1ed1d8cc5244b6b48d292bd /sw/inc | |
parent | 4579eb460a99b3873d69b03d876b5658abd53557 (diff) |
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
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/doc.hxx | 39 | ||||
-rw-r--r-- | sw/inc/docsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/edimp.hxx | 9 | ||||
-rw-r--r-- | sw/inc/editsh.hxx | 6 | ||||
-rw-r--r-- | sw/inc/fmtftn.hxx | 8 | ||||
-rw-r--r-- | sw/inc/ftninfo.hxx | 2 | ||||
-rw-r--r-- | sw/inc/hintids.hxx | 47 | ||||
-rw-r--r-- | sw/inc/ndhints.hxx | 147 | ||||
-rw-r--r-- | sw/inc/ndtxt.hxx | 126 | ||||
-rw-r--r-- | sw/inc/pam.hxx | 96 | ||||
-rw-r--r-- | sw/inc/rolbck.hxx | 372 | ||||
-rw-r--r-- | sw/inc/segdefs.hxx | 30 | ||||
-rw-r--r-- | sw/inc/segdefs_.hxx | 29 | ||||
-rw-r--r-- | sw/inc/swcrsr.hxx | 68 | ||||
-rw-r--r-- | sw/inc/txatbase.hxx | 284 | ||||
-rw-r--r-- | sw/inc/txtatr.hxx | 35 | ||||
-rw-r--r-- | sw/inc/txtflcnt.hxx | 4 | ||||
-rw-r--r-- | sw/inc/txtfld.hxx | 21 | ||||
-rw-r--r-- | sw/inc/txtftn.hxx | 28 | ||||
-rw-r--r-- | sw/inc/txtinet.hxx | 32 | ||||
-rw-r--r-- | sw/inc/txtrfmrk.hxx | 22 | ||||
-rw-r--r-- | sw/inc/txttxmrk.hxx | 22 | ||||
-rw-r--r-- | sw/inc/undobj.hxx | 148 | ||||
-rw-r--r-- | sw/inc/unocoll.hxx | 3 | ||||
-rw-r--r-- | sw/inc/unocrsr.hxx | 23 | ||||
-rw-r--r-- | sw/inc/unoobj.hxx | 40 | ||||
-rw-r--r-- | sw/inc/unoport.hxx | 6 | ||||
-rw-r--r-- | sw/inc/viscrs.hxx | 12 |
28 files changed, 868 insertions, 793 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index a82ea0235359..937a9adcd965 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -32,45 +32,23 @@ /** SwDoc interfaces */ -#ifndef IINTERFACE_HXX_INCLUDED #include <IInterface.hxx> -#endif #include <IDocumentSettingAccess.hxx> -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> -#endif #include <IDocumentMarkAccess.hxx> -#ifndef IREDLINEACCESS_HXX_INCLUDED #include <IDocumentRedlineAccess.hxx> -#endif #include <IDocumentUndoRedo.hxx> #include <IDocumentLinksAdministration.hxx> #include <IDocumentFieldsAccess.hxx> -#ifndef IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED #include <IDocumentContentOperations.hxx> -#endif -#ifndef IDOCUMENTSTYLEPOOLACCESS_HXX_INCLUDED #include <IDocumentStylePoolAccess.hxx> -#endif -#ifndef IDOCUMENTLINENUMBERACCESS_HXX_INCLUDED #include <IDocumentLineNumberAccess.hxx> -#endif -#ifndef IDOCUMENTSTATISTICS_HXX_INCLUDED #include <IDocumentStatistics.hxx> -#endif -#ifndef IDOCUMENTSTATE_HXX_INCLUDED #include <IDocumentState.hxx> -#endif -#ifndef IDOCUMENTDRAWMODELACCESS_HXX_INCLUDED #include <IDocumentDrawModelAccess.hxx> -#endif #include <IDocumentLayoutAccess.hxx> -#ifndef IDOCUMENTTIMERACCESS_HXX_INCLUDED #include <IDocumentTimerAccess.hxx> -#endif -#ifndef IDOCUMENTCHARTDATAPROVIDER_HXX_INCLUDED #include <IDocumentChartDataProviderAccess.hxx> -#endif // --> OD 2007-10-26 #i83479# #include <IDocumentOutlineNodes.hxx> #include <IDocumentListItems.hxx> @@ -92,15 +70,11 @@ class SwList; #include <toxe.hxx> // enums #include <flyenum.hxx> #include <itabenum.hxx> -#ifndef _SWDBDATA_HXXnLinkCt #include <swdbdata.hxx> -#endif #include <chcmprse.hxx> #include <com/sun/star/linguistic2/XSpellChecker1.hpp> #include <com/sun/star/linguistic2/XHyphenatedWord.hpp> -#ifndef _VOS_REF_HXX #include <vos/ref.hxx> -#endif #include <svx/svdtypes.hxx> #include <svtools/style.hxx> #include <svx/numitem.hxx> @@ -113,6 +87,7 @@ class SwList; #include <svtools/embedhlp.hxx> #include <vector> +#include <memory> #include <boost/scoped_ptr.hpp> @@ -258,6 +233,7 @@ namespace container { namespace sfx2 { class SvLinkSource; + class IXmlIdRegistry; } //PageDescriptor-Schnittstelle, Array hier wegen inlines. @@ -433,6 +409,8 @@ private: tImplSortedNodeNumList* mpListItemsList; // <-- + ::std::auto_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry; + // ------------------------------------------------------------------- // sonstige sal_uInt16 nUndoPos; // akt. Undo-InsertPosition (fuers Redo!) @@ -1121,9 +1099,9 @@ public: void SetEndNoteInfo(const SwEndNoteInfo& rInfo); SwFtnIdxs& GetFtnIdxs() { return *pFtnIdxs; } const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; } - // Fussnoten im Bereich aendern - sal_Bool SetCurFtn( const SwPaM& rPam, const String& rNumStr, - sal_uInt16 nNumber, sal_Bool bIsEndNote ); + // change footnotes in area + bool SetCurFtn( const SwPaM& rPam, const String& rNumStr, + sal_uInt16 nNumber, bool bIsEndNote ); /** Operations on the content of the document e.g. spell-checking/hyphenating/word-counting @@ -1437,6 +1415,7 @@ public: void SetInReading( bool bNew ) { mbInReading = bNew; } bool IsClipBoard() const { return mbClipBoard; } + // N.B.: must be called right after constructor! (@see GetXmlIdRegistry) void SetClipBoard( bool bNew ) { mbClipBoard = bNew; } bool IsColumnSelection() const { return mbColumnSelection; } @@ -2100,6 +2079,8 @@ public: { return n32DummyCompatabilityOptions2; } + + ::sfx2::IXmlIdRegistry& GetXmlIdRegistry(); }; diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 8f5a04658e6c..45cb37f8ac68 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -299,6 +299,8 @@ public: GetController(); SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef ); + + virtual const ::sfx2::IXmlIdRegistry* GetXmlIdRegistry() const; }; class Graphic; diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index 16d841d5774a..8cfa04648cf7 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -52,15 +52,6 @@ class SwNodeIndex; } -#define FOREACHCURSOR_START(pCURSH) \ - {\ - SwShellCrsr *_pStartCrsr = *(pCURSH)->GetSwCrsr(), *__pStartCrsr = _pStartCrsr; \ - do { - -#define FOREACHCURSOR_END() \ - } while( (_pStartCrsr=*(SwCursor*)_pStartCrsr->GetNext()) != __pStartCrsr ); \ - } - struct SwPamRange { diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 4e1eba53115b..83b0e5242a9e 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -801,11 +801,11 @@ public: // erfrage und setze den Fussnoten-Text/Nummer. Set.. auf akt. SSelection! BOOL GetCurFtn( SwFmtFtn* pToFillFtn = 0 ); - BOOL SetCurFtn( const SwFmtFtn& rFillFtn ); - BOOL HasFtns( BOOL bEndNotes = FALSE ) const; + bool SetCurFtn( const SwFmtFtn& rFillFtn ); + bool HasFtns( bool bEndNotes = false ) const; //z.Zt nicht benoetigt USHORT GetFtnCnt( BOOL bEndNotes = FALSE ) const; // gebe Liste aller Fussnoten und deren Anfangstexte - USHORT GetSeqFtnList( SwSeqFldList& rList, BOOL bEndNotes = FALSE ); + USHORT GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes = false ); // SS fuer Bereiche const SwSection* InsertSection( const SwSection& rNew, diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx index 5afdfadc8b46..e31001ced75f 100644 --- a/sw/inc/fmtftn.hxx +++ b/sw/inc/fmtftn.hxx @@ -45,14 +45,14 @@ class SW_DLLPUBLIC SwFmtFtn: public SfxPoolItem SwTxtFtn* pTxtAttr; //mein TextAttribut String aNumber; //Benutzerdefinierte 'Nummer' USHORT nNumber; //Automatische Nummerierung - BOOL bEndNote; //Ist es eine Endnote? + bool m_bEndNote; // is it an End note? // geschuetzter CopyCtor SwFmtFtn& operator=(const SwFmtFtn& rFtn); SwFmtFtn( const SwFmtFtn& ); public: - SwFmtFtn( BOOL bEndNote = FALSE ); + SwFmtFtn( bool bEndNote = false ); virtual ~SwFmtFtn(); // "pure virtual Methoden" vom SfxPoolItem @@ -61,11 +61,11 @@ public: const String &GetNumStr() const { return aNumber; } const USHORT &GetNumber() const { return nNumber; } - BOOL IsEndNote() const { return bEndNote;} + bool IsEndNote() const { return m_bEndNote;} void SetNumStr( const String& rStr ) { aNumber = rStr; } void SetNumber( USHORT nNo ) { nNumber = nNo; } - void SetEndNote( BOOL b ); + void SetEndNote( bool b ); void SetNumber( const SwFmtFtn& rFtn ) { nNumber = rFtn.nNumber; aNumber = rFtn.aNumber; } diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index 4ab9e53c6b27..6e84f3ead81b 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -50,7 +50,7 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient String sPrefix; String sSuffix; protected: - BOOL bEndNote; + bool m_bEndNote; public: SvxNumberType aFmt; USHORT nFtnOffset; diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 53fcb75910f5..9e847064eaaf 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -375,6 +375,53 @@ RES_FLTRATTR_END #define RES_WHICHHINT_END HINT_END +inline bool isATR(const USHORT nWhich) +{ + return (RES_CHRATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich); +} +inline bool isCHRATR(const USHORT nWhich) +{ + return (RES_CHRATR_BEGIN <= nWhich) && (RES_CHRATR_END > nWhich); +} +inline bool isTXTATR_WITHEND(const USHORT nWhich) +{ + return (RES_TXTATR_WITHEND_BEGIN <= nWhich) + && (RES_TXTATR_WITHEND_END > nWhich); +} +inline bool isTXTATR_NOEND(const USHORT nWhich) +{ + return (RES_TXTATR_NOEND_BEGIN <= nWhich) + && (RES_TXTATR_NOEND_END > nWhich); +} +inline bool isTXTATR(const USHORT nWhich) +{ + return (RES_TXTATR_BEGIN <= nWhich) && (RES_TXTATR_END > nWhich); +} +inline bool isPARATR(const USHORT nWhich) +{ + return (RES_PARATR_BEGIN <= nWhich) && (RES_PARATR_END > nWhich); +} +inline bool isPARATR_LIST(const USHORT nWhich) +{ + return (RES_PARATR_LIST_BEGIN <= nWhich) && (RES_PARATR_LIST_END > nWhich); } +inline bool isFRMATR(const USHORT nWhich) +{ + return (RES_FRMATR_BEGIN <= nWhich) && (RES_FRMATR_END > nWhich); +} +inline bool isGRFATR(const USHORT nWhich) +{ + return (RES_GRFATR_BEGIN <= nWhich) && (RES_GRFATR_END > nWhich); +} +inline bool isBOXATR(const USHORT nWhich) +{ + return (RES_BOXATR_BEGIN <= nWhich) && (RES_BOXATR_END > nWhich); +} +inline bool isUNKNOWNATR(const USHORT nWhich) +{ + return (RES_UNKNOWNATR_BEGIN <= nWhich) && (RES_UNKNOWNATR_END > nWhich); +} + + /* * hole aus der statischen Default-Attribut Tabelle ueber den Which-Wert * das entsprechende default Attribut. diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx index ad4403d9f7e3..04bf3a7914b3 100644 --- a/sw/inc/ndhints.hxx +++ b/sw/inc/ndhints.hxx @@ -61,41 +61,45 @@ SV_DECL_PTRARR_SORT(SwpHtEnd,SwTxtAttr*,1,1) * class SwpHintsArr *************************************************************************/ -// Das neue Hintsarray: -class SwpHintsArr : private SwpHtStart +/// the Hints array +class SwpHintsArray { protected: - SwpHtEnd aHtEnd; + SwpHtStart m_HintStarts; + SwpHtEnd m_HintEnds; + //FIXME: why are the non-const methods public? public: void Insert( const SwTxtAttr *pHt ); void DeleteAtPos( const USHORT nPosInStart ); - BOOL Resort(); - SwTxtAttr *Cut( const USHORT nPosInStart ); - - inline const SwTxtAttr *GetStart( const USHORT nPos ) const { return (*this)[nPos]; } - inline const SwTxtAttr *GetEnd( const USHORT nPos ) const { return aHtEnd[nPos]; } - inline SwTxtAttr *GetStart( const USHORT nPos ) { return GetHt(nPos); } - inline SwTxtAttr *GetEnd( const USHORT nPos ) { return aHtEnd[nPos]; } - inline USHORT GetEndCount() const { return aHtEnd.Count(); } - inline USHORT GetStartCount() const { return Count(); } + bool Resort(); + SwTxtAttr * Cut( const USHORT nPosInStart ); + + inline const SwTxtAttr * GetStart( const USHORT nPos ) const + { return m_HintStarts[nPos]; } + inline const SwTxtAttr * GetEnd ( const USHORT nPos ) const + { return m_HintEnds [nPos]; } + inline SwTxtAttr * GetStart( const USHORT nPos ) + { return m_HintStarts[nPos]; } + inline SwTxtAttr * GetEnd ( const USHORT nPos ) + { return m_HintEnds [nPos]; } + + inline USHORT GetEndCount() const { return m_HintEnds .Count(); } + inline USHORT GetStartCount() const { return m_HintStarts.Count(); } + inline USHORT GetStartOf( const SwTxtAttr *pHt ) const; inline USHORT GetPos( const SwTxtAttr *pHt ) const -// OS: in svmem.hxx wird fuer TCPP GetPos ohne const gerufen -#ifdef TCPP - { return SwpHtStart::GetPos( (SwTxtAttr *)pHt ); } -#else - { return SwpHtStart::GetPos( pHt ); } -#endif + { return m_HintStarts.GetPos( pHt ); } - inline SwTxtAttr *GetHt( const USHORT nIdx ) { return SwpHtStart::operator[](nIdx); } - inline const SwTxtAttr *operator[]( const USHORT nIdx )const - { return SwpHtStart::operator[](nIdx); } - inline USHORT Count() const { return SwpHtStart::Count(); } + inline SwTxtAttr * GetTextHint( const USHORT nIdx ) + { return GetStart(nIdx); } + inline const SwTxtAttr * operator[]( const USHORT nIdx ) const + { return m_HintStarts[nIdx]; } + inline USHORT Count() const { return m_HintStarts.Count(); } #ifndef PRODUCT - BOOL Check() const; + bool Check() const; #endif }; @@ -103,67 +107,68 @@ public: * class SwpHints *************************************************************************/ -// Die public-Schnittstelle zum Node hin -class SwpHints: public SwpHintsArr +// public interface +class SwpHints : public SwpHintsArray { private: - SwRegHistory* pHistory; - // Numerierung - BOOL bHasHiddenParaField :1; // HiddenParaFld - BOOL bFntChg :1; // Fontwechsel - BOOL bFtn :1; // Fussnoten - BOOL bInSplitNode: 1; // TRUE: der Node ist im Split und die Frames - // werden verschoben! - BOOL bDDEFlds : 1; // es sind DDE-Felder am TextNode vorhanden - BOOL bCalcHiddenParaField : 1; // bHasHiddenParaField ist invalid, CalcHiddenParaField() rufen - - // Haelt ein neues Attribut in pHistory fest. - void NoteInHistory( SwTxtAttr *pAttr, const BOOL bNew = FALSE ); + SwRegHistory* m_pHistory; // for Undo + + bool m_bFontChange : 1; // font change + // true: the Node is in Split and Frames are moved + bool m_bInSplitNode : 1; + // m_bHasHiddenParaField is invalid, call CalcHiddenParaField() + bool m_bCalcHiddenParaField : 1; + bool m_bHasHiddenParaField : 1; // HiddenParaFld + bool m_bFootnote : 1; // footnotes + bool m_bDDEFields : 1; // the TextNode has DDE fields + + // records a new attibute in m_pHistory. + void NoteInHistory( SwTxtAttr *pAttr, const bool bNew = false ); void CalcFlags( ); - // die Delete Methoden duerfen nur vom TextNode gerufen werden !! - // Dieser sorgt dafuer, das bei Attributen ohne Ende auch das - // entsp. Zeichen entfernt wird !! + // Delete methods may only be called by the TextNode! + // Because the TextNode also guarantees removal of the Character for + // attributes without an end. friend class SwTxtNode; void DeleteAtPos( const USHORT nPos ); - // Ist der Hint schon bekannt, dann suche die Position und loesche ihn. - // Ist er nicht im Array, so gibt es ein ASSERT !! + // Delete the given Hint. The Hint must actually be in the array! void Delete( SwTxtAttr* pTxtHt ); - inline void SetCalcHiddenParaField(){ bCalcHiddenParaField = TRUE; } - inline void SetHiddenParaField( const BOOL bNew ) { bHasHiddenParaField = bNew; } - inline BOOL HasHiddenParaField() const - { if( bCalcHiddenParaField ) ((SwpHints*)this)->CalcHiddenParaField(); return bHasHiddenParaField; } + inline void SetInSplitNode(bool bInSplit) { m_bInSplitNode = bInSplit; } + inline void SetCalcHiddenParaField() { m_bCalcHiddenParaField = true; } + inline void SetHiddenParaField( const bool bNew ) + { m_bHasHiddenParaField = bNew; } + inline bool HasHiddenParaField() const + { + if ( m_bCalcHiddenParaField ) + { + (const_cast<SwpHints*>(this))->CalcHiddenParaField(); + } + return m_bHasHiddenParaField; + } void BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, USHORT nMode ); bool MergePortions( SwTxtNode& rNode ); public: - inline BOOL CanBeDeleted() const { return !Count(); } + SwpHints(); + + inline bool CanBeDeleted() const { return !Count(); } - // damit das SwDoc::Undo ueber alle Attributaenderungen informiert - // wird, gibt es hier einen Pointer auf die History. Nur wenn dieser - // != 0 ist, muessen alle Attributaenderungen "gemeldet" werden. - void Register( SwRegHistory* pHist ) { pHistory = pHist; } + // register a History, which receives all attribute changes (for Undo) + void Register( SwRegHistory* pHist ) { m_pHistory = pHist; } + // deregister the currently registered History void DeRegister() { Register(0); } - SwRegHistory* getHistory() const { return pHistory; } + SwRegHistory* GetHistory() const { return m_pHistory; } - void Insert( SwTxtAttr* pHt, SwTxtNode &rNode, USHORT nMode = 0 ); + void Insert( SwTxtAttr* pHt, SwTxtNode &rNode, USHORT nMode = 0 ); - inline BOOL HasFtn() const { return bFtn; } - inline BOOL IsInSplitNode() const { return bInSplitNode; } + inline bool HasFtn() const { return m_bFootnote; } + inline bool IsInSplitNode() const { return m_bInSplitNode; } - // Konstruktor (wird im nur einmal benutzt!) - SwpHints() - { - pHistory = 0; - bFntChg = TRUE; - bDDEFlds = bFtn = bInSplitNode = bCalcHiddenParaField = bHasHiddenParaField = FALSE; - } - - // Berechnung von bHasHiddenParaField, return-Wert TRUE bei Aenderung - BOOL CalcHiddenParaField(); + // calc current value of m_bHasHiddenParaField, returns true iff changed + bool CalcHiddenParaField(); DECL_FIXEDMEMPOOL_NEWDEL(SwpHints) }; @@ -172,20 +177,22 @@ public: SvStream &operator<<(SvStream &aS, const SwpHints &rHints); //$ ostream /************************************************************************* - * Inline-Implementationen + * Inline Implementations *************************************************************************/ -inline USHORT SwpHintsArr::GetStartOf( const SwTxtAttr *pHt ) const +inline USHORT SwpHintsArray::GetStartOf( const SwTxtAttr *pHt ) const { USHORT nPos; - if( !Seek_Entry( pHt, &nPos ) ) + if ( !m_HintStarts.Seek_Entry( pHt, &nPos ) ) + { nPos = USHRT_MAX; + } return nPos; } -inline SwTxtAttr *SwpHintsArr::Cut( const USHORT nPosInStart ) +inline SwTxtAttr *SwpHintsArray::Cut( const USHORT nPosInStart ) { - SwTxtAttr *pHt = GetHt(nPosInStart); + SwTxtAttr *pHt = GetTextHint(nPosInStart); DeleteAtPos( nPosInStart ); return pHt; } diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 33fd760ab108..df21f6cb8aa8 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -38,6 +38,13 @@ #include <errhdl.hxx> #include <modeltoviewhelper.hxx> #include <SwNumberTreeTypes.hxx> + +#include <sfx2/Metadatable.hxx> + +#include <vector> +#include <set> + + class SwNumRule; class SwNodeNum; // --> OD 2008-05-06 #refactorlists# @@ -47,9 +54,6 @@ class SwList; class SvxLRSpaceItem; // <-- -#include <vector> -#include <set> - namespace utl { class TransliterationWrapper; } @@ -85,7 +89,7 @@ typedef std::set< xub_StrLen > SwSoftPageBreakList; // -------------------- // SwTxtNode // -------------------- -class SW_DLLPUBLIC SwTxtNode: public SwCntntNode +class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable { // fuer das Erzeugen des ersten TextNode @@ -98,25 +102,25 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode //Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen. //Also niemals direkt zugreifen! - SwpHints *pSwpHints; + SwpHints *m_pSwpHints; // --> OD 2005-11-02 #i51089 - TUNING# mutable SwNodeNum* mpNodeNum; // Numerierung fuer diesen Absatz // <-- - XubString aText; + XubString m_Text; - SwParaIdleData_Impl* pParaIdleData_Impl; + SwParaIdleData_Impl* m_pParaIdleData_Impl; // Some of the chars this para are hidden. Paragraph has to be reformatted // on changing the view to print preview. - mutable BOOL bContainsHiddenChars : 1; + mutable bool m_bContainsHiddenChars : 1; // The whole paragraph is hidden because of the hidden text attribute - mutable BOOL bHiddenCharsHidePara : 1; + mutable bool m_bHiddenCharsHidePara : 1; // The last two flags have to be recalculated if this flag is set: - mutable BOOL bRecalcHiddenCharFlags : 1; + mutable bool m_bRecalcHiddenCharFlags : 1; - bool bNotifiable; - mutable BOOL bLastOutlineState : 1; + mutable bool m_bLastOutlineState : 1; + bool m_bNotifiable; // BYTE nOutlineLevel; //#outline level, removed by zhaojianwei. // --> OD 2008-11-19 #i70748# @@ -134,6 +138,7 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode SwList* mpList; // <-- + SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl, const SfxItemSet* pAutoAttr = 0 ); @@ -160,12 +165,13 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode // Optimization: Asking for information about hidden characters at SwScriptInfo // updates these flags. - inline bool IsCalcHiddenCharFlags() const { return bRecalcHiddenCharFlags; } + inline bool IsCalcHiddenCharFlags() const + { return m_bRecalcHiddenCharFlags; } inline void SetHiddenCharAttribute( bool bNewHiddenCharsHidePara, bool bNewContainsHiddenChars ) const { - bHiddenCharsHidePara = bNewHiddenCharsHidePara; - bContainsHiddenChars = bNewContainsHiddenChars; - bRecalcHiddenCharFlags = false; + m_bHiddenCharsHidePara = bNewHiddenCharsHidePara; + m_bContainsHiddenChars = bNewContainsHiddenChars; + m_bRecalcHiddenCharFlags = false; } SW_DLLPRIVATE void CalcHiddenCharFlags() const; @@ -194,6 +200,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode */ SwNodeNum* CreateNum() const; + inline void TryDeleteSwpHints(); + public: bool IsWordCountDirty() const; bool IsWrongDirty() const; @@ -223,14 +231,14 @@ public: public: using SwCntntNode::GetAttr; - const String& GetTxt() const { return aText; } + const String& GetTxt() const { return m_Text; } - // Zugriff auf SwpHints + // getters for SwpHints inline SwpHints &GetSwpHints(); inline const SwpHints &GetSwpHints() const; - inline SwpHints *GetpSwpHints() { return pSwpHints; } - inline const SwpHints *GetpSwpHints() const { return pSwpHints; } - inline BOOL HasHints() const { return pSwpHints ? TRUE : FALSE; } + inline SwpHints *GetpSwpHints() { return m_pSwpHints; } + inline const SwpHints *GetpSwpHints() const { return m_pSwpHints; } + inline bool HasHints() const { return m_pSwpHints ? true : false; } inline SwpHints &GetOrCreateSwpHints(); virtual ~SwTxtNode(); @@ -341,7 +349,7 @@ public: SwCntntNode *AppendNode( const SwPosition & ); // setze ggf. das DontExpand-Flag an INet bzw. Zeichenvorlagen - BOOL DontExpandFmt( const SwIndex& rIdx, BOOL bFlag = TRUE, + BOOL DontExpandFmt( const SwIndex& rIdx, bool bFlag = true, BOOL bFmtToTxtAttributes = TRUE ); // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx) @@ -400,12 +408,12 @@ public: /** Returns if this text node is an outline. - @retval TRUE this text node is an outline - @retval FALSE else + @retval true this text node is an outline + @retval false else */ - BOOL IsOutline() const; + bool IsOutline() const; - BOOL IsOutlineStateChanged() const; + bool IsOutlineStateChanged() const; void UpdateOutlineState(); @@ -712,29 +720,29 @@ public: // Passes back info needed on the dropcap dimensions bool GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const; - - // // Hidden Paragraph Field: - // - inline BOOL CalcHiddenParaField() - { if(pSwpHints) return pSwpHints->CalcHiddenParaField(); return FALSE; } - // Setzen des CalcVisible-Flags - inline void SetCalcHiddenParaField(){ if(pSwpHints) pSwpHints->SetCalcHiddenParaField(); } + inline bool CalcHiddenParaField() + { return m_pSwpHints ? m_pSwpHints->CalcHiddenParaField() : false; } + // set CalcVisible flags + inline void SetCalcHiddenParaField() + { if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); } - // Ist der Absatz sichtbar - inline BOOL HasHiddenParaField() const - { return pSwpHints ? pSwpHints->HasHiddenParaField() : FALSE; } + // is the paragraph visible? + inline bool HasHiddenParaField() const + { return m_pSwpHints ? m_pSwpHints->HasHiddenParaField() : false; } // // Hidden Paragraph Field: // inline bool HasHiddenCharAttribute( bool bWholePara ) const { - if ( bRecalcHiddenCharFlags ) + if ( m_bRecalcHiddenCharFlags ) CalcHiddenCharFlags(); - return bWholePara ? bHiddenCharsHidePara : bContainsHiddenChars; + return bWholePara ? m_bHiddenCharsHidePara : m_bContainsHiddenChars; } - inline void SetCalcHiddenCharFlags() const { bRecalcHiddenCharFlags = TRUE; } + + inline void SetCalcHiddenCharFlags() const + { m_bRecalcHiddenCharFlags = true; } // --> FME 2004-06-08 #i12836# enhanced pdf // @@ -808,32 +816,50 @@ public: USHORT GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const; + // sfx2::Metadatable + virtual ::sfx2::IXmlIdRegistry& GetRegistry(); + virtual bool IsInClipboard() const; + virtual bool IsInUndo() const; + virtual bool IsInContent() const; + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable > MakeUnoObject(); + DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode) }; //----------------------------------------------------------------------------- -inline SwpHints &SwTxtNode::GetSwpHints() +inline SwpHints & SwTxtNode::GetSwpHints() { - ASSERT_ID( pSwpHints, ERR_NOHINTS); - return *pSwpHints; + ASSERT_ID( m_pSwpHints, ERR_NOHINTS); + return *m_pSwpHints; } inline const SwpHints &SwTxtNode::GetSwpHints() const { - ASSERT_ID( pSwpHints, ERR_NOHINTS); - return *pSwpHints; + ASSERT_ID( m_pSwpHints, ERR_NOHINTS); + return *m_pSwpHints; } inline SwpHints& SwTxtNode::GetOrCreateSwpHints() { - if( !pSwpHints ) - pSwpHints = new SwpHints; - return *pSwpHints; + if ( !m_pSwpHints ) + { + m_pSwpHints = new SwpHints; + } + return *m_pSwpHints; +} + +inline void SwTxtNode::TryDeleteSwpHints() +{ + if ( m_pSwpHints && m_pSwpHints->CanBeDeleted() ) + { + DELETEZ( m_pSwpHints ); + } } inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const { - return (SwTxtFmtColl*)GetRegisteredIn(); + return static_cast<SwTxtFmtColl*>(const_cast<SwModify*>(GetRegisteredIn())); } // fuer den IBM-Compiler nicht inlinen wg. 42876 @@ -841,11 +867,11 @@ inline SwTxtFmtColl* SwTxtNode::GetTxtColl() const // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! inline SwTxtNode *SwNode::GetTxtNode() { - return ND_TEXTNODE == nNodeType ? (SwTxtNode*)this : 0; + return ND_TEXTNODE == nNodeType ? static_cast<SwTxtNode*>(this) : 0; } inline const SwTxtNode *SwNode::GetTxtNode() const { - return ND_TEXTNODE == nNodeType ? (const SwTxtNode*)this : 0; + return ND_TEXTNODE == nNodeType ? static_cast<const SwTxtNode*>(this) : 0; } #endif diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 8b5af17f820c..18579f1a918b 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -60,13 +60,10 @@ struct SW_DLLPUBLIC SwPosition SwNodeIndex nNode; SwIndex nContent; - SwPosition( const SwNode& rNode ); - SwPosition( const SwNodeIndex &rNode ); SwPosition( const SwNodeIndex &rNode, const SwIndex &rCntnt ); - /* @@@MAINTAINABILITY-HORROR@@@ - SwPosition desperately needs a constructor - SwPosition( const SwNode& rNode, xub_StrLen nOffset ); - */ + explicit SwPosition( const SwNodeIndex &rNode ); + explicit SwPosition( const SwNode& rNode ); + explicit SwPosition( SwCntntNode& rNode, const xub_StrLen nOffset = 0 ); SwPosition( const SwPosition & ); SwPosition &operator=(const SwPosition &); @@ -128,11 +125,11 @@ void _InitPam(); class SW_DLLPUBLIC SwPaM : public Ring { - SwPosition aBound1; - SwPosition aBound2; - SwPosition *pPoint; - SwPosition *pMark; - BOOL bIsInFrontOfLabel; + SwPosition m_Bound1; + SwPosition m_Bound2; + SwPosition * m_pPoint; // points at either m_Bound1 or m_Bound2 + SwPosition * m_pMark; // points at either m_Bound1 or m_Bound2 + bool m_bIsInFrontOfLabel; SwPaM* MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg = 0 ); @@ -180,54 +177,66 @@ public: SwMoveFn fnMove, BOOL bSrchForward, BOOL bRegSearch, BOOL bChkEmptyPara, BOOL bChkParaEnd, xub_StrLen &nStart, xub_StrLen &nEnde,xub_StrLen nTxtLen,SwNode* pNode, SwPaM* pPam); - inline BOOL IsInFrontOfLabel() const { return bIsInFrontOfLabel; } - inline void _SetInFrontOfLabel( BOOL bNew ) { bIsInFrontOfLabel = bNew; } + inline bool IsInFrontOfLabel() const { return m_bIsInFrontOfLabel; } + inline void _SetInFrontOfLabel( bool bNew ) { m_bIsInFrontOfLabel = bNew; } virtual void SetMark(); - void DeleteMark() { pMark = pPoint; } + + void DeleteMark() + { + if (m_pMark != m_pPoint) + { + // clear the mark position; this helps if mark's SwIndex is + // registered at some node, and that node is then deleted + *m_pMark = SwPosition( SwNodeIndex( GetNode()->GetNodes() ) ); + m_pMark = m_pPoint; + } + } + #ifdef PRODUCT void Exchange() { - if(pPoint != pMark) + if (m_pPoint != m_pMark) { - SwPosition *pTmp = pPoint; - pPoint = pMark; - pMark = pTmp; + SwPosition *pTmp = m_pPoint; + m_pPoint = m_pMark; + m_pMark = pTmp; } } #else void Exchange(); #endif - /* - * Undocumented Feature: Liefert zurueck, ob das Pam ueber - * eine Selektion verfuegt oder nicht. Definition einer - * Selektion: Point und Mark zeigen auf unterschiedliche - * Puffer. + + /** A PaM marks a selection if Point and Mark are distinct positions. + @return true iff the PaM spans a selection */ - BOOL HasMark() const { return pPoint == pMark? FALSE : TRUE; } + bool HasMark() const { return m_pPoint == m_pMark ? false : true; } - const SwPosition *GetPoint() const { return pPoint; } - SwPosition *GetPoint() { return pPoint; } - const SwPosition *GetMark() const { return pMark; } - SwPosition *GetMark() { return pMark; } + const SwPosition *GetPoint() const { return m_pPoint; } + SwPosition *GetPoint() { return m_pPoint; } + const SwPosition *GetMark() const { return m_pMark; } + SwPosition *GetMark() { return m_pMark; } const SwPosition *Start() const - { return (*pPoint) <= (*pMark)? pPoint: pMark; } + { return (*m_pPoint) <= (*m_pMark) ? m_pPoint : m_pMark; } SwPosition *Start() - { return (*pPoint) <= (*pMark)? pPoint: pMark; } + { return (*m_pPoint) <= (*m_pMark) ? m_pPoint : m_pMark; } + const SwPosition *End() const - { return (*pPoint) > (*pMark)? pPoint: pMark; } + { return (*m_pPoint) > (*m_pMark) ? m_pPoint : m_pMark; } SwPosition *End() - { return (*pPoint) > (*pMark)? pPoint: pMark; } + { return (*m_pPoint) > (*m_pMark) ? m_pPoint : m_pMark; } - // erfrage vom SwPaM den aktuellen Node/ContentNode am SPoint / Mark - SwNode* GetNode( BOOL bPoint = TRUE ) const + /// @return current Node at Point/Mark + SwNode * GetNode ( bool bPoint = true ) const { - return &( bPoint ? pPoint->nNode : pMark->nNode ).GetNode(); + return &( bPoint ? m_pPoint->nNode : m_pMark->nNode ).GetNode(); } - SwCntntNode* GetCntntNode( BOOL bPoint = TRUE ) const + + /// @return current ContentNode at Point/Mark + SwCntntNode* GetCntntNode( bool bPoint = true ) const { - return ( bPoint ? pPoint->nNode : pMark->nNode ).GetNode().GetCntntNode(); + return GetNode(bPoint)->GetCntntNode(); } /** @@ -238,12 +247,13 @@ public: */ SwPaM & Normalize(BOOL bPointFirst = TRUE); - // erfrage vom SwPaM das Dokument, in dem er angemeldet ist - SwDoc* GetDoc() const { return pPoint->nNode.GetNode().GetDoc(); } - SwPosition& GetBound( BOOL bOne = TRUE ) - { return bOne ? aBound1 : aBound2; } - const SwPosition& GetBound( BOOL bOne = TRUE ) const - { return bOne ? aBound1 : aBound2; } + /// @return the document (SwDoc) at which the PaM is registered + SwDoc* GetDoc() const { return m_pPoint->nNode.GetNode().GetDoc(); } + + SwPosition& GetBound( bool bOne = true ) + { return bOne ? m_Bound1 : m_Bound2; } + const SwPosition& GetBound( bool bOne = true ) const + { return bOne ? m_Bound1 : m_Bound2; } // erfrage die Seitennummer auf der der Cursor steht USHORT GetPageNum( BOOL bAtPoint = TRUE, const Point* pLayPos = 0 ); diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index f137b8b73e6c..fabe23403ac1 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -43,7 +43,7 @@ class SwDoc; class SwFmt; class SwFmtColl; -class SwHstryHint; +class SwHistoryHint; class SwTxtAttr; class SfxPoolItem; class SwTxtNode; @@ -72,10 +72,13 @@ class SwCharFmt; #include <IDocumentMarkAccess.hxx> // <-- +#include <memory> + + #ifndef PRODUCT class Writer; -#define OUT_HSTR_HINT( name ) \ - friend Writer& OutUndo_Hstr_ ## name( Writer&, const SwHstryHint& ); +#define OUT_HSTR_HINT( name ) \ + friend Writer& OutUndo_Hstr_ ## name( Writer&, const SwHistoryHint& ); #else #define OUT_HSTR_HINT( name ) #endif @@ -99,169 +102,188 @@ enum HISTORY_HINT { HSTRY_CHGCHARFMT, // #i27615# HSTRY_END }; -class SwHstryHint + +class SwHistoryHint { - HISTORY_HINT eWhichId; + const HISTORY_HINT m_eWhichId; + public: - SwHstryHint( HISTORY_HINT eWh ) : eWhichId( eWh ) {} - virtual ~SwHstryHint() {} // jetzt inline - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ) = 0; - HISTORY_HINT Which() const { return eWhichId; } + SwHistoryHint( HISTORY_HINT eWhich ) : m_eWhichId( eWhich ) {} + virtual ~SwHistoryHint() {} + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ) = 0; + HISTORY_HINT Which() const { return m_eWhichId; } virtual String GetDescription() const; }; -class SwSetFmtHint : public SwHstryHint +class SwHistorySetFmt : public SwHistoryHint { - SfxPoolItem* pAttr; - ULONG nNode; + ::std::auto_ptr<SfxPoolItem> m_pAttr; + const ULONG m_nNodeIndex; + public: - SwSetFmtHint( const SfxPoolItem* pFmtHt, ULONG nNode ); - virtual ~SwSetFmtHint(); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetFmt( const SfxPoolItem* pFmtHt, ULONG nNode ); + virtual ~SwHistorySetFmt(); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); virtual String GetDescription() const; OUT_HSTR_HINT(SetFmtHnt) }; -class SwResetFmtHint : public SwHstryHint +class SwHistoryResetFmt : public SwHistoryHint { - ULONG nNode; - USHORT nWhich; + const ULONG m_nNodeIndex; + const USHORT m_nWhich; + public: // --> OD 2008-02-27 #refactorlists# - removed <rDoc> - SwResetFmtHint( const SfxPoolItem* pFmtHt, ULONG nNodeIdx ); + SwHistoryResetFmt( const SfxPoolItem* pFmtHt, ULONG nNodeIdx ); // <-- - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + OUT_HSTR_HINT(ResetFmtHnt) }; -class SwSetTxtHint : public SwHstryHint +class SwHistorySetTxt : public SwHistoryHint { - SfxPoolItem *pAttr; - ULONG nNode; - xub_StrLen nStart, nEnd; + ::std::auto_ptr<SfxPoolItem> m_pAttr; + const ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const xub_StrLen m_nEnd; + public: - SwSetTxtHint( /*const*/ SwTxtAttr* pTxtHt, ULONG nNode ); - virtual ~SwSetTxtHint(); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetTxt( SwTxtAttr* pTxtHt, ULONG nNode ); + virtual ~SwHistorySetTxt(); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); OUT_HSTR_HINT(SetTxtHnt) }; -class SwSetTxtFldHint : public SwHstryHint +class SwHistorySetTxtFld : public SwHistoryHint { - SwFmtFld* pFld; - SwFieldType* pFldType; - ULONG nNode; - xub_StrLen nPos; - USHORT nFldWhich; + const ::std::auto_ptr<SwFmtFld> m_pFld; + ::std::auto_ptr<SwFieldType> m_pFldType; + ULONG m_nNodeIndex; + xub_StrLen m_nPos; + USHORT m_nFldWhich; + public: - SwSetTxtFldHint( SwTxtFld* pTxtFld, ULONG nNode ); - virtual ~SwSetTxtFldHint(); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetTxtFld( SwTxtFld* pTxtFld, ULONG nNode ); + virtual ~SwHistorySetTxtFld(); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); virtual String GetDescription() const; OUT_HSTR_HINT(SetTxtFldHnt) }; -class SwSetRefMarkHint : public SwHstryHint +class SwHistorySetRefMark : public SwHistoryHint { - String aRefName; - ULONG nNode; - xub_StrLen nStart, nEnd; + const String m_RefName; + const ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const xub_StrLen m_nEnd; + public: - SwSetRefMarkHint( SwTxtRefMark* pTxtHt, ULONG nNode ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetRefMark( SwTxtRefMark* pTxtHt, ULONG nNode ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + OUT_HSTR_HINT(SetRefMarkHnt) }; -class SwSetTOXMarkHint : public SwHstryHint +class SwHistorySetTOXMark : public SwHistoryHint { - String aTOXName; - TOXTypes eTOXTypes; - SwTOXMark aTOXMark; - ULONG nNode; - xub_StrLen nStart, nEnd; + SwTOXMark m_TOXMark; + const String m_TOXName; + const TOXTypes m_eTOXTypes; + const ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const xub_StrLen m_nEnd; + public: - SwSetTOXMarkHint( SwTxtTOXMark* pTxtHt, ULONG nNode ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, ULONG nNode ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); int IsEqual( const SwTOXMark& rCmp ) const; + OUT_HSTR_HINT(SetToxMarkHnt) }; -class SwResetTxtHint : public SwHstryHint +class SwHistoryResetTxt : public SwHistoryHint { - ULONG nNode; - xub_StrLen nStart, nEnd; - USHORT nAttr; + const ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const xub_StrLen m_nEnd; + const USHORT m_nAttr; + public: - SwResetTxtHint( USHORT nWhich, xub_StrLen nStt, xub_StrLen nEnd, ULONG nNode ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistoryResetTxt( USHORT nWhich, xub_StrLen nStt, xub_StrLen nEnd, + ULONG nNode ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + + USHORT GetWhich() const { return m_nAttr; } + ULONG GetNode() const { return m_nNodeIndex; } + xub_StrLen GetCntnt() const { return m_nStart; } - USHORT GetWhich() const { return nAttr; } - ULONG GetNode() const { return nNode; } - xub_StrLen GetCntnt() const { return nStart; } OUT_HSTR_HINT(ResetTxtHnt) }; -class SwSetFtnHint : public SwHstryHint +class SwHistorySetFootnote : public SwHistoryHint { - String aFtnStr; - SwUndoSaveSection* pUndo; - ULONG nNode; - xub_StrLen nStart; - BOOL bEndNote; + const ::std::auto_ptr<SwUndoSaveSection> m_pUndo; + const String m_FootnoteNumber; + ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const bool m_bEndNote; + public: - SwSetFtnHint( SwTxtFtn* pTxtFtn, ULONG nNode ); - SwSetFtnHint( const SwTxtFtn& ); - ~SwSetFtnHint(); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetFootnote( SwTxtFtn* pTxtFtn, ULONG nNode ); + SwHistorySetFootnote( const SwTxtFtn& ); + virtual ~SwHistorySetFootnote(); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); virtual String GetDescription() const; OUT_HSTR_HINT(SetFtnHnt) }; -class SwChgFmtColl : public SwHstryHint +class SwHistoryChangeFmtColl : public SwHistoryHint { - const SwFmtColl* pColl; - ULONG nNode; - BYTE nNdWhich; - // --> OD 2007-07-09 #i77372# - // adjust (naming and type) and extend (add <mbIsCounted>) numbering attributes - int mnNumLvl; - bool mbIsRestart; - SwNumberTree::tSwNumTreeNumber mnRestartVal; - bool mbIsCounted; - // <-- + SwFmtColl * const m_pColl; + const ULONG m_nNodeIndex; + const BYTE m_nNodeType; + public: - SwChgFmtColl( const SwFmtColl* pColl, ULONG nNode, BYTE nNodeWhich ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); - OUT_HSTR_HINT(ChgFmtColl) + SwHistoryChangeFmtColl( SwFmtColl* pColl, ULONG nNode, BYTE nNodeWhich ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + + OUT_HSTR_HINT(ChangeFmtColl) }; -class SwHstryTxtFlyCnt : public SwHstryHint +class SwHistoryTxtFlyCnt : public SwHistoryHint { - SwUndoDelLayFmt* pUndo; + ::std::auto_ptr<SwUndoDelLayFmt> m_pUndo; + public: - SwHstryTxtFlyCnt( SwTxtFlyCnt* pTxtFly ); // fuer Zeichengebundene - SwHstryTxtFlyCnt( SwFlyFrmFmt* pFlyFmt ); // fuer Absatzgebundene - ~SwHstryTxtFlyCnt(); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); - SwUndoDelLayFmt* GetUDelLFmt() { return pUndo; } + SwHistoryTxtFlyCnt( SwTxtFlyCnt* pTxtFly ); // for character-bound + SwHistoryTxtFlyCnt( SwFlyFrmFmt* pFlyFmt ); // for paragraph-bound + virtual ~SwHistoryTxtFlyCnt(); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + SwUndoDelLayFmt* GetUDelLFmt() { return m_pUndo.get(); } + OUT_HSTR_HINT(FlyCnt) }; -class SwHstryBookmark : public SwHstryHint +class SwHistoryBookmark : public SwHistoryHint { public: - SwHstryBookmark(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOtherPos); - virtual void SetInDoc(SwDoc * pDoc, BOOL); - OUT_HSTR_HINT(Bookmark) + SwHistoryBookmark(const ::sw::mark::IMark& rBkmk, + bool bSavePos, bool bSaveOtherPos); + virtual void SetInDoc(SwDoc * pDoc, bool); - BOOL IsEqualBookmark(const ::sw::mark::IMark& rBkmk); + bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk); const ::rtl::OUString& GetName() const; + + OUT_HSTR_HINT(Bookmark) + private: const ::rtl::OUString m_aName; ::rtl::OUString m_aShortName; @@ -276,129 +298,135 @@ class SwHstryBookmark : public SwHstryHint const IDocumentMarkAccess::MarkType m_eBkmkType; }; -class SwHstrySetAttrSet : public SwHstryHint +class SwHistorySetAttrSet : public SwHistoryHint { - SfxItemSet aOldSet; - SvUShorts aResetArr; - ULONG nNode; - // --> OD 2007-07-09 #i77372# - // adjust (naming and type) and extend (add <mbIsCounted>) numbering attributes - int mnNumLvl; - bool mbIsRestart; - SwNumberTree::tSwNumTreeNumber mnRestartVal; - bool mbIsCounted; - // <-- + SfxItemSet m_OldSet; + SvUShorts m_ResetArray; + const ULONG m_nNodeIndex; + public: - SwHstrySetAttrSet( const SfxItemSet& rSet, ULONG nNode, - const SvUShortsSort& rSetArr ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistorySetAttrSet( const SfxItemSet& rSet, ULONG nNode, + const SvUShortsSort& rSetArr ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + OUT_HSTR_HINT(SetAttrSet) }; -class SwHstryResetAttrSet : public SwHstryHint +class SwHistoryResetAttrSet : public SwHistoryHint { - ULONG nNode; - xub_StrLen nStart, nEnd; - SvUShorts aArr; + const ULONG m_nNodeIndex; + const xub_StrLen m_nStart; + const xub_StrLen m_nEnd; + SvUShorts m_Array; + public: - SwHstryResetAttrSet( const SfxItemSet& rSet, ULONG nNode, + SwHistoryResetAttrSet( const SfxItemSet& rSet, ULONG nNode, xub_StrLen nStt = STRING_MAXLEN, xub_StrLen nEnd = STRING_MAXLEN ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + + const SvUShorts& GetArr() const { return m_Array; } + ULONG GetNode() const { return m_nNodeIndex; } + xub_StrLen GetCntnt() const { return m_nStart; } - const SvUShorts& GetArr() const { return aArr; } - ULONG GetNode() const { return nNode; } - xub_StrLen GetCntnt() const { return nStart; } OUT_HSTR_HINT(ResetAttrSet) }; -class SwHstryChgFlyAnchor : public SwHstryHint +class SwHistoryChangeFlyAnchor : public SwHistoryHint { - SwFrmFmt* pFmt; - ULONG nOldPos; - xub_StrLen nOldCnt; + SwFrmFmt & m_rFmt; + const ULONG m_nOldNodeIndex; + const xub_StrLen m_nOldContentIndex; + public: - SwHstryChgFlyAnchor( const SwFrmFmt& rFmt ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); }; -class SwHstryChgFlyChain : public SwHstryHint +class SwHistoryChangeFlyChain : public SwHistoryHint { - SwFlyFrmFmt *pPrevFmt, *pNextFmt, *pFlyFmt; + SwFlyFrmFmt * const m_pPrevFmt; + SwFlyFrmFmt * const m_pNextFmt; + SwFlyFrmFmt * const m_pFlyFmt; + public: - SwHstryChgFlyChain( const SwFlyFrmFmt& rFmt, const SwFmtChain& rAttr ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistoryChangeFlyChain( SwFlyFrmFmt& rFmt, const SwFmtChain& rAttr ); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); }; // #i27615# -class SwHstryChgCharFmt : public SwHstryHint +class SwHistoryChangeCharFmt : public SwHistoryHint { - SfxItemSet aOldSet; - String sFmt; + const SfxItemSet m_OldSet; + const String m_Fmt; + public: - SwHstryChgCharFmt( const SfxItemSet& rSet, const String & sFmt); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); + SwHistoryChangeCharFmt( const SfxItemSet& rSet, const String & sFmt); + virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); + OUT_HSTR_HINT(SetAttrSet) }; #endif -typedef SwHstryHint* SwHstryHintPtr; -SV_DECL_PTRARR_DEL( SwpHstry, SwHstryHintPtr, 0, 2 ) +typedef SwHistoryHint* SwHistoryHintPtr; +SV_DECL_PTRARR_DEL( SwpHstry, SwHistoryHintPtr, 0, 2 ) -class SwHistory : private SwpHstry +class SwHistory { - friend class SwDoc; // eig. darf nur SwDoc::DelUndoObj zugreifen - friend class SwUndoWriter; // fuer den Undo/Redo-Writer - friend class SwRegHistory; // fuer Insert, von Histoy-Attributen + friend class SwDoc; // actually only SwDoc::DelUndoObj may access + friend class SwUndoWriter; // for Undo/Redo Writer + friend class SwRegHistory; // for inserting History attributes + + SwpHstry m_SwpHstry; + USHORT m_nEndDiff; - USHORT nEndDiff; public: SwHistory( USHORT nInitSz = 0, USHORT nGrowSz = 2 ); ~SwHistory(); - // loesche die History ab Start bis zum Ende + + // delete History from nStart to array end void Delete( USHORT nStart = 0 ); - // alle Objecte zwischen nStart und Array-Ende aufrufen und loeschen - BOOL Rollback( SwDoc* pDoc, USHORT nStart = 0 ); - // alle Objecte zwischen nStart und temporaeren Ende aufrufen und - // den Start als temporaeres Ende speichern - BOOL TmpRollback( SwDoc* pDoc, USHORT nStart, BOOL ToFirst = TRUE ); + // call and delete all objects between nStart and array end + bool Rollback( SwDoc* pDoc, USHORT nStart = 0 ); + // call all objects between nStart and TmpEnd; store nStart as TmpEnd + bool TmpRollback( SwDoc* pDoc, USHORT nStart, bool ToFirst = true ); // --> OD 2008-02-27 #refactorlists# - removed <rDoc> void Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue, ULONG nNodeIdx ); // <-- - void Add( const SwTxtAttr* pTxtHt, ULONG nNodeIdx, - BOOL bNewAttr = TRUE ); - void Add( const SwFmtColl*, ULONG nNodeIdx, BYTE nWhichNd ); + void Add( SwTxtAttr* pTxtHt, ULONG nNodeIdx, bool bNewAttr = true ); + void Add( SwFmtColl*, ULONG nNodeIdx, BYTE nWhichNd ); void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos ); - void Add( const SwFrmFmt& rFmt ); - void Add( const SwFlyFrmFmt&, USHORT& rSetPos ); + void Add( SwFrmFmt& rFmt ); + void Add( SwFlyFrmFmt&, USHORT& rSetPos ); void Add( const SwTxtFtn& ); void Add( const SfxItemSet & rSet, const SwCharFmt & rCharFmt); // #i27615# - USHORT Count() const { return SwpHstry::Count(); } - USHORT GetTmpEnd() const { return SwpHstry::Count() - nEndDiff; } - USHORT SetTmpEnd( USHORT nTmpEnd ); // returne alten Wert - SwHstryHint* operator[]( USHORT nPos ) const { return SwpHstry::operator[](nPos); } + USHORT Count() const { return m_SwpHstry.Count(); } + USHORT GetTmpEnd() const { return m_SwpHstry.Count() - m_nEndDiff; } + USHORT SetTmpEnd( USHORT nTmpEnd ); // return previous value + SwHistoryHint * operator[]( USHORT nPos ) { return m_SwpHstry[nPos]; } + SwHistoryHint const* operator[]( USHORT nPos ) const + { return m_SwpHstry[nPos]; } - // fuer SwUndoDelete::Undo/Redo + // for SwUndoDelete::Undo/Redo void Move( USHORT nPos, SwHistory *pIns, - USHORT nStart = 0, USHORT nEnd = USHRT_MAX ) + USHORT nStart = 0, USHORT nEnd = USHRT_MAX ) { - SwpHstry::Insert( pIns, nPos, nStart, nEnd ); - SwpHstry* pDel = pIns; - pDel->Remove( nStart, nEnd == USHRT_MAX - ? pDel->Count() - nStart - : nEnd ); + m_SwpHstry.Insert( &pIns->m_SwpHstry, nPos, nStart, nEnd ); + pIns->m_SwpHstry.Remove( nStart, (nEnd == USHRT_MAX) + ? pIns->Count() - nStart + : nEnd ); } - // Hilfs-Methoden zum Sichern von Attributen in der History. - // Wird von UndoKlasse benutzt (Delete/Overwrite/Inserts) - void CopyAttr( const SwpHints* pHts, ULONG nNodeIdx, xub_StrLen nStt, - xub_StrLen nEnd, BOOL bFields ); + // helper methods for recording attribute in History + // used by Undo classes (Delete/Overwrite/Inserts) + void CopyAttr( SwpHints* pHts, ULONG nNodeIdx, xub_StrLen nStart, + xub_StrLen nEnd, bool bFields ); // --> OD 2008-02-27 #refactorlists# - removed <rDoc> void CopyFmtAttr( const SfxItemSet& rSet, ULONG nNodeIdx ); // <-- @@ -408,11 +436,13 @@ public: class SwRegHistory : public SwClient { - SvUShortsSort aSetWhichIds; - SwHistory* pHstry; - ULONG nNodeIdx; +private: + SvUShortsSort m_WhichIdSet; + SwHistory * const m_pHistory; + ULONG m_nNodeIndex; void _MakeSetWhichIds(); + public: // --> OD 2008-02-27 #refactorlists# - removed <rDoc> SwRegHistory( SwHistory* pHst ); @@ -424,10 +454,10 @@ public: SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst ); virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); - void Add( SwTxtAttr* pHt, const BOOL bNew = FALSE ); + void AddHint( SwTxtAttr* pHt, const bool bNew = false ); void RegisterInModify( SwModify* pRegIn, const SwNode& rNd ); - void ChangeNodeIndex( ULONG nNew ) { nNodeIdx = nNew; } + void ChangeNodeIndex( ULONG nNew ) { m_nNodeIndex = nNew; } }; #endif diff --git a/sw/inc/segdefs.hxx b/sw/inc/segdefs.hxx deleted file mode 100644 index 3ef806270595..000000000000 --- a/sw/inc/segdefs.hxx +++ /dev/null @@ -1,30 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: segdefs.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#include "segdefs_.hxx" diff --git a/sw/inc/segdefs_.hxx b/sw/inc/segdefs_.hxx deleted file mode 100644 index 7e4b36c657f4..000000000000 --- a/sw/inc/segdefs_.hxx +++ /dev/null @@ -1,29 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: segdefs_.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 8dd654c4034a..42597cb62559 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -35,11 +35,6 @@ #include <cshtyp.hxx> -class SwShellCrsr; -class SwShellTableCrsr; -class SwTableCursor; -class SwUnoCrsr; -class SwUnoTableCrsr; struct _SwCursor_SavePos; namespace com { namespace sun { namespace star { namespace util { @@ -89,6 +84,11 @@ protected: const _SwCursor_SavePos* GetSavePos() const { return pSavePos; } + virtual const SwCntntFrm* DoSetBidiLevelLeftRight( + BOOL & io_rbLeft, BOOL bVisualAllowed, BOOL bInsertCrsr); + virtual void DoSetBidiLevelUpDown(); + virtual bool IsSelOvrCheck(int eFlags); + public: // single argument ctors shall be explicit. SwCursor( const SwPosition &rPos, SwPaM* pRing, bool bColumnSel ); @@ -105,18 +105,6 @@ public: virtual SwCursor* Create( SwPaM* pRing = 0 ) const; - virtual operator SwShellCrsr* (); - virtual operator SwShellTableCrsr* (); - virtual operator SwTableCursor* (); - virtual operator SwUnoCrsr* (); - virtual operator SwUnoTableCrsr* (); - - inline operator const SwShellCrsr* () const; - inline operator const SwShellTableCrsr* () const; - inline operator const SwTableCursor* () const; - inline operator const SwUnoCrsr* () const; - inline operator const SwUnoTableCrsr* () const; - virtual short MaxReplaceArived(); //returns RET_YES/RET_CANCEL/RET_NO virtual void SaveTblBoxCntnt( const SwPosition* pPos = 0 ); @@ -178,8 +166,8 @@ public: BOOL GoPrevSentence(){return GoSentence(PREV_SENT);} BOOL GoStartSentence(){return GoSentence(START_SENT);} - BOOL LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, BOOL bAllowVisual, BOOL bSkipHidden, - BOOL bInsertCrsr ); + virtual BOOL LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, + BOOL bAllowVisual, BOOL bSkipHidden, BOOL bInsertCrsr ); BOOL UpDown( BOOL bUp, USHORT nCnt, Point* pPt, long nUpDownX ); BOOL LeftRightMargin( BOOL bLeftMargin, BOOL bAPI = FALSE ); BOOL IsAtLeftRightMargin( BOOL bLeftMargin, BOOL bAPI = FALSE ) const; @@ -192,7 +180,7 @@ public: { return LeftRight( FALSE, nCnt, nMode, bAllowVisual, bSkipHidden, FALSE ); } BOOL GoNextCell( USHORT nCnt = 1 ) { return GoPrevNextCell( TRUE, nCnt ); } BOOL GoPrevCell( USHORT nCnt = 1 ) { return GoPrevNextCell( FALSE, nCnt ); } - BOOL GotoTable( const String& rName ); + virtual BOOL GotoTable( const String& rName ); BOOL GotoTblBox( const String& rName ); BOOL GotoRegion( const String& rName ); BOOL GotoFtnAnchor(); @@ -224,7 +212,10 @@ public: virtual BOOL IsAtValidPos( BOOL bPoint = TRUE ) const; // darf der Cursor in ReadOnlyBereiche? - BOOL IsReadOnlyAvailable() const; + virtual bool IsReadOnlyAvailable() const; + + virtual BOOL IsSkipOverProtectSections() const; + virtual BOOL IsSkipOverHiddenSections() const; BYTE GetCrsrBidiLevel() const { return nCursorBidiLevel; } void SetCrsrBidiLevel( BYTE nNewLevel ) { nCursorBidiLevel = nNewLevel; } @@ -275,12 +266,16 @@ protected: BOOL bChg : 1; BOOL bParked : 1; // Tabellen-Cursor wurde geparkt + virtual bool IsSelOvrCheck(int eFlags); + public: SwTableCursor( const SwPosition &rPos, SwPaM* pRing = 0 ); SwTableCursor( SwTableCursor& ); virtual ~SwTableCursor(); - virtual operator SwTableCursor* (); + virtual BOOL LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, + BOOL bAllowVisual, BOOL bSkipHidden, BOOL bInsertCrsr ); + virtual BOOL GotoTable( const String& rName ); void InsertBox( const SwTableBox& rTblBox ); void DeleteBox( USHORT nPos ) { aSelBoxes.Remove( nPos ); bChg = TRUE; } @@ -313,34 +308,5 @@ public: void ActualizeSelection( const SwSelBoxes &rBoxes ); }; - -// --------------------------- inline Methoden ---------------------- - -inline SwCursor::operator const SwShellCrsr* () const -{ - return (SwShellCrsr*)*((SwCursor*)this); -} - -inline SwCursor::operator const SwShellTableCrsr* () const -{ - return (SwShellTableCrsr*)*((SwCursor*)this); -} - -inline SwCursor::operator const SwTableCursor* () const -{ - return (SwTableCursor*)*((SwCursor*)this); -} - -inline SwCursor::operator const SwUnoCrsr* () const -{ - return (SwUnoCrsr*)*((SwCursor*)this); -} - -inline SwCursor::operator const SwUnoTableCrsr* () const -{ - return (SwUnoTableCrsr*)*((SwCursor*)this); -} - - #endif diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index 45bacf92eb5c..90602a7b941c 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -29,11 +29,15 @@ ************************************************************************/ #ifndef _TXATBASE_HXX #define _TXATBASE_HXX + #include <tools/solar.h> #include <svtools/poolitem.hxx> #include <hintids.hxx> #include <errhdl.hxx> +#include <boost/utility.hpp> + + class SfxItemPool; class SvxBrushItem; class SvxFontItem; @@ -76,28 +80,29 @@ class SwFmtFlyCnt; class SwTOXMark; class SwFmtRefMark; -class SwTxtAttr +class SwTxtAttr : private boost::noncopyable { - const SfxPoolItem* pAttr; - xub_StrLen nStart; - BOOL bDontExpand : 1; - BOOL bLockExpandFlag : 1; + const SfxPoolItem* m_pAttr; + xub_StrLen m_nStart; + bool m_bDontExpand : 1; + bool m_bLockExpandFlag : 1; + + bool m_bDontMergeAttr : 1; // refmarks, toxmarks, ruby + bool m_bDontMoveAttr : 1; // refmarks, toxmarks + bool m_bCharFmtAttr : 1; // charfmt, inet + bool m_bOverlapAllowedAttr : 1; // refmarks, toxmarks + bool m_bPriorityAttr : 1; // attribute has priority (redlining) + bool m_bDontExpandStart : 1; // don't expand start at paragraph start (ruby) - BOOL bDontMergeAttr : 1; // refmarks, toxmarks, ruby - BOOL bDontMoveAttr : 1; // refmarks, toxmarks - BOOL bCharFmtAttr : 1; // charfmt, inet - BOOL bOverlapAllowedAttr : 1; // refmarks, toxmarks - BOOL bPriorityAttr : 1; // attribute has priority (redlining) - BOOL bDontExpandStart : 1; // don't expand start at paragraph start (ruby) protected: SwTxtAttr( const SfxPoolItem& rAttr, xub_StrLen nStart ); - void SetLockExpandFlag( BOOL bFlag ) { bLockExpandFlag = bFlag; } - void SetDontMergeAttr( BOOL bFlag ) { bDontMergeAttr = bFlag; } - void SetDontMoveAttr( BOOL bFlag ) { bDontMoveAttr = bFlag; } - void SetCharFmtAttr( BOOL bFlag ) { bCharFmtAttr = bFlag; } - void SetOverlapAllowedAttr( BOOL bFlag ){ bOverlapAllowedAttr = bFlag; } - void SetDontExpandStartAttr(BOOL bFlag) { bDontExpandStart = bFlag; } + void SetLockExpandFlag( bool bFlag ) { m_bLockExpandFlag = bFlag; } + void SetDontMergeAttr( bool bFlag ) { m_bDontMergeAttr = bFlag; } + void SetDontMoveAttr( bool bFlag ) { m_bDontMoveAttr = bFlag; } + void SetCharFmtAttr( bool bFlag ) { m_bCharFmtAttr = bFlag; } + void SetOverlapAllowedAttr( bool bFlag ){ m_bOverlapAllowedAttr = bFlag; } + void SetDontExpandStartAttr(bool bFlag) { m_bDontExpandStart = bFlag; } public: virtual ~SwTxtAttr(); @@ -105,25 +110,26 @@ public: // RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!! void RemoveFromPool( SfxItemPool& rPool ); - // Start Position erfragen - xub_StrLen* GetStart() { return &nStart; } - const xub_StrLen* GetStart() const { return &nStart; } + /// start position + xub_StrLen* GetStart() { return & m_nStart; } + const xub_StrLen* GetStart() const { return & m_nStart; } - // End Position erfragen + /// end position virtual xub_StrLen* GetEnd(); inline const xub_StrLen* GetEnd() const; + /// end (if available), else start inline const xub_StrLen* GetAnyEnd() const; - inline void SetDontExpand( BOOL bNew ); - BOOL DontExpand() const { return bDontExpand; } - BOOL IsLockExpandFlag() const { return bLockExpandFlag; } - BOOL IsDontMergeAttr() const { return bDontMergeAttr; } - BOOL IsDontMoveAttr() const { return bDontMoveAttr; } - BOOL IsCharFmtAttr() const { return bCharFmtAttr; } - BOOL IsOverlapAllowedAttr() const { return bOverlapAllowedAttr; } - BOOL IsPriorityAttr() const { return bPriorityAttr; } - void SetPriorityAttr( BOOL bFlag ) { bPriorityAttr = bFlag; } - BOOL IsDontExpandStartAttr() const { return bDontExpandStart; } + inline void SetDontExpand( bool bDontExpand ); + bool DontExpand() const { return m_bDontExpand; } + bool IsLockExpandFlag() const { return m_bLockExpandFlag; } + bool IsDontMergeAttr() const { return m_bDontMergeAttr; } + bool IsDontMoveAttr() const { return m_bDontMoveAttr; } + bool IsCharFmtAttr() const { return m_bCharFmtAttr; } + bool IsOverlapAllowedAttr() const { return m_bOverlapAllowedAttr; } + bool IsPriorityAttr() const { return m_bPriorityAttr; } + void SetPriorityAttr( bool bFlag ) { m_bPriorityAttr = bFlag; } + bool IsDontExpandStartAttr() const { return m_bDontExpandStart; } inline const SfxPoolItem& GetAttr() const; inline USHORT Which() const { return GetAttr().Which(); } @@ -170,9 +176,6 @@ public: inline const SvxCharReliefItem &GetCharRelief() const; inline const SvxCharHiddenItem &GetCharHidden() const; -private: - SwTxtAttr( const SwTxtAttr& ); - SwTxtAttr& operator=( const SwTxtAttr& ); }; class SwTxtAttrEnd : public SwTxtAttr @@ -180,7 +183,7 @@ class SwTxtAttrEnd : public SwTxtAttr using SwTxtAttr::GetEnd; protected: - xub_StrLen nEnd; + xub_StrLen m_nEnd; public: SwTxtAttrEnd( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); @@ -193,258 +196,297 @@ public: inline const xub_StrLen* SwTxtAttr::GetEnd() const { - return ((SwTxtAttr*)this)->GetEnd(); + return const_cast<SwTxtAttr * >(this)->GetEnd(); } inline const xub_StrLen* SwTxtAttr::GetAnyEnd() const { const xub_StrLen* pEnd = GetEnd(); - return pEnd ? pEnd : &nStart; + return pEnd ? pEnd : GetStart(); } inline const SfxPoolItem& SwTxtAttr::GetAttr() const { - ASSERT( pAttr, "wo ist mein Attribut?" ); - return *pAttr; + ASSERT( m_pAttr, "SwTxtAttr: where is my attribute?" ); + return *m_pAttr; } -inline void SwTxtAttr::SetDontExpand( BOOL bNew ) +inline void SwTxtAttr::SetDontExpand( bool bDontExpand ) { - if( !bLockExpandFlag ) - bDontExpand = bNew; + if ( !m_bLockExpandFlag ) + { + m_bDontExpand = bDontExpand; + } } inline const SvxFontItem& SwTxtAttr::GetFont() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_FONT, "Falsche Abfrage" ); - return (const SvxFontItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_FONT, "Wrong attribute" ); + return (const SvxFontItem&)(*m_pAttr); } inline const SvxPostureItem& SwTxtAttr::GetPosture() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_POSTURE, "Falsche Abfrage" ); - return (const SvxPostureItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_POSTURE, + "Wrong attribute" ); + return (const SvxPostureItem&)(*m_pAttr); } inline const SvxWeightItem& SwTxtAttr::GetWeight() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_WEIGHT, "Falsche Abfrage" ); - return (const SvxWeightItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_WEIGHT, + "Wrong attribute" ); + return (const SvxWeightItem&)(*m_pAttr); } inline const SvxUnderlineItem& SwTxtAttr::GetUnderline() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_UNDERLINE, "Falsche Abfrage" ); - return (const SvxUnderlineItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_UNDERLINE, + "Wrong attribute" ); + return (const SvxUnderlineItem&)(*m_pAttr); } inline const SvxOverlineItem& SwTxtAttr::GetOverline() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_OVERLINE, "Falsche Abfrage" ); - return (const SvxOverlineItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_OVERLINE, + "Wrong attribute" ); + return (const SvxOverlineItem&)(*m_pAttr); } inline const SvxFontHeightItem& SwTxtAttr::GetFontSize() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_FONTSIZE, "Falsche Abfrage" ); - return (const SvxFontHeightItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_FONTSIZE, + "Wrong attribute" ); + return (const SvxFontHeightItem&)(*m_pAttr); } inline const SvxPropSizeItem& SwTxtAttr::GetPropSize() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_PROPORTIONALFONTSIZE, "Falsche Abfrage" ); - return (const SvxPropSizeItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_PROPORTIONALFONTSIZE, + "Wrong attribute" ); + return (const SvxPropSizeItem&)(*m_pAttr); } inline const SvxShadowedItem& SwTxtAttr::GetShadowed() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_SHADOWED, "Falsche Abfrage" ); - return (const SvxShadowedItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_SHADOWED, + "Wrong attribute" ); + return (const SvxShadowedItem&)(*m_pAttr); } inline const SvxAutoKernItem& SwTxtAttr::GetAutoKern() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_AUTOKERN, "Falsche Abfrage" ); - return (const SvxAutoKernItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_AUTOKERN, + "Wrong attribute" ); + return (const SvxAutoKernItem&)(*m_pAttr); } inline const SvxWordLineModeItem& SwTxtAttr::GetWordLineMode() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_WORDLINEMODE, "Falsche Abfrage" ); - return (const SvxWordLineModeItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_WORDLINEMODE, + "Wrong attribute" ); + return (const SvxWordLineModeItem&)(*m_pAttr); } inline const SvxContourItem& SwTxtAttr::GetContour() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_CONTOUR, "Falsche Abfrage" ); - return (const SvxContourItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CONTOUR, + "Wrong attribute" ); + return (const SvxContourItem&)(*m_pAttr); } inline const SvxCrossedOutItem& SwTxtAttr::GetCrossedOut() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_CROSSEDOUT, "Falsche Abfrage" ); - return (const SvxCrossedOutItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CROSSEDOUT, + "Wrong attribute" ); + return (const SvxCrossedOutItem&)(*m_pAttr); } inline const SvxColorItem& SwTxtAttr::GetColor() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_COLOR, "Falsche Abfrage" ); - return (const SvxColorItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_COLOR, + "Wrong attribute" ); + return (const SvxColorItem&)(*m_pAttr); } inline const SvxCharSetColorItem& SwTxtAttr::GetCharSetColor() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_CHARSETCOLOR, "Falsche Abfrage" ); - return (const SvxCharSetColorItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CHARSETCOLOR, + "Wrong attribute" ); + return (const SvxCharSetColorItem&)(*m_pAttr); } inline const SwFmtCharFmt& SwTxtAttr::GetCharFmt() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_CHARFMT, "Falsche Abfrage" ); - return (const SwFmtCharFmt&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_CHARFMT, + "Wrong attribute" ); + return (const SwFmtCharFmt&)(*m_pAttr); } inline const SwFmtAutoFmt& SwTxtAttr::GetAutoFmt() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_AUTOFMT, "Wrong request" ); - return (const SwFmtAutoFmt&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_AUTOFMT, + "Wrong attribute" ); + return (const SwFmtAutoFmt&)(*m_pAttr); } inline const SvxKerningItem& SwTxtAttr::GetKerning() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_KERNING, "Falsche Abfrage" ); - return (const SvxKerningItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_KERNING, + "Wrong attribute" ); + return (const SvxKerningItem&)(*m_pAttr); } inline const SvxCaseMapItem& SwTxtAttr::GetCaseMap() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_CASEMAP, "Falsche Abfrage" ); - return (const SvxCaseMapItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CASEMAP, + "Wrong attribute" ); + return (const SvxCaseMapItem&)(*m_pAttr); } inline const SvxLanguageItem& SwTxtAttr::GetLanguage() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_LANGUAGE, "Falsche Abfrage" ); - return (const SvxLanguageItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_LANGUAGE, + "Wrong attribute" ); + return (const SvxLanguageItem&)(*m_pAttr); } inline const SvxEscapementItem& SwTxtAttr::GetEscapement() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_ESCAPEMENT, "Falsche Abfrage" ); - return (const SvxEscapementItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_ESCAPEMENT, + "Wrong attribute" ); + return (const SvxEscapementItem&)(*m_pAttr); } inline const SvxBlinkItem& SwTxtAttr::GetBlink() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_BLINK, "Falsche Abfrage" ); - return (const SvxBlinkItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_BLINK, + "Wrong attribute" ); + return (const SvxBlinkItem&)(*m_pAttr); } inline const SvxBrushItem& SwTxtAttr::GetChrBackground() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_BACKGROUND, "Falsche Abfrage" ); - return (const SvxBrushItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_BACKGROUND, + "Wrong attribute" ); + return (const SvxBrushItem&)(*m_pAttr); } inline const SvxNoHyphenItem& SwTxtAttr::GetNoHyphenHere() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_NOHYPHEN, "Falsche Abfrage" ); - return (const SvxNoHyphenItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_NOHYPHEN, + "Wrong attribute" ); + return (const SvxNoHyphenItem&)(*m_pAttr); } inline const SwFmtSoftHyph& SwTxtAttr::GetSoftHyph() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_SOFTHYPH, "Falsche Abfrage" ); - return (const SwFmtSoftHyph&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_SOFTHYPH, + "Wrong attribute" ); + return (const SwFmtSoftHyph&)(*m_pAttr); } inline const SwFmtHardBlank& SwTxtAttr::GetHardBlank() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_HARDBLANK, "Falsche Abfrage" ); - return (const SwFmtHardBlank&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_HARDBLANK, + "Wrong attribute" ); + return (const SwFmtHardBlank&)(*m_pAttr); } inline const SwFmtFld& SwTxtAttr::GetFld() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_FIELD, "Falsche Abfrage" ); - return (const SwFmtFld&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FIELD, + "Wrong attribute" ); + return (const SwFmtFld&)(*m_pAttr); } inline const SwFmtFtn& SwTxtAttr::GetFtn() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_FTN, "Falsche Abfrage" ); - return (const SwFmtFtn&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FTN, "Wrong attribute" ); + return (const SwFmtFtn&)(*m_pAttr); } inline const SwFmtFlyCnt& SwTxtAttr::GetFlyCnt() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_FLYCNT, "Falsche Abfrage" ); - return (const SwFmtFlyCnt&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FLYCNT, + "Wrong attribute" ); + return (const SwFmtFlyCnt&)(*m_pAttr); } inline const SwTOXMark& SwTxtAttr::GetTOXMark() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_TOXMARK, "Falsche Abfrage" ); - return (const SwTOXMark&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_TOXMARK, + "Wrong attribute" ); + return (const SwTOXMark&)(*m_pAttr); } inline const SwFmtRefMark& SwTxtAttr::GetRefMark() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_REFMARK, "Falsche Abfrage" ); - return (const SwFmtRefMark&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_REFMARK, + "Wrong attribute" ); + return (const SwFmtRefMark&)(*m_pAttr); } inline const SwFmtINetFmt& SwTxtAttr::GetINetFmt() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_INETFMT, "Falsche Abfrage" ); - return (const SwFmtINetFmt&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_INETFMT, + "Wrong attribute" ); + return (const SwFmtINetFmt&)(*m_pAttr); } inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const { - ASSERT( pAttr && pAttr->Which() == RES_UNKNOWNATR_CONTAINER, "Falsche Abfrage" ); - return (const SvXMLAttrContainerItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_UNKNOWNATR_CONTAINER, + "Wrong attribute" ); + return (const SvXMLAttrContainerItem&)(*m_pAttr); } inline const SwFmtRuby& SwTxtAttr::GetRuby() const { - ASSERT( pAttr && pAttr->Which() == RES_TXTATR_CJK_RUBY, "Falsche Abfrage" ); - return (const SwFmtRuby&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_CJK_RUBY, + "Wrong attribute" ); + return (const SwFmtRuby&)(*m_pAttr); } inline const SvxTwoLinesItem& SwTxtAttr::Get2Lines() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_TWO_LINES, "Falsche Abfrage" ); - return (const SvxTwoLinesItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_TWO_LINES, + "Wrong attribute" ); + return (const SvxTwoLinesItem&)(*m_pAttr); } inline const SvxEmphasisMarkItem& SwTxtAttr::GetEmphasisMark() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_EMPHASIS_MARK, "Falsche Abfrage" ); - return (const SvxEmphasisMarkItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_EMPHASIS_MARK, + "Wrong attribute" ); + return (const SvxEmphasisMarkItem&)(*m_pAttr); } inline const SvxCharScaleWidthItem& SwTxtAttr::GetCharScaleW() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_SCALEW, "Falsche Abfrage" ); - return (const SvxCharScaleWidthItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_SCALEW, + "Wrong attribute" ); + return (const SvxCharScaleWidthItem&)(*m_pAttr); } -inline const SvxCharRotateItem& SwTxtAttr::GetCharRotate() const +inline const SvxCharRotateItem& SwTxtAttr::GetCharRotate() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_ROTATE, "Falsche Abfrage" ); - return (const SvxCharRotateItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_ROTATE, + "Wrong attribute" ); + return (const SvxCharRotateItem&)(*m_pAttr); } inline const SvxCharReliefItem& SwTxtAttr::GetCharRelief() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_RELIEF, "Falsche Abfrage" ); - return (const SvxCharReliefItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_RELIEF, + "Wrong attribute" ); + return (const SvxCharReliefItem&)(*m_pAttr); } inline const SvxCharHiddenItem& SwTxtAttr::GetCharHidden() const { - ASSERT( pAttr && pAttr->Which() == RES_CHRATR_HIDDEN, "Falsche Abfrage" ); - return (const SvxCharHiddenItem&)*pAttr; + ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_HIDDEN, + "Wrong attribute" ); + return (const SvxCharHiddenItem&)(*m_pAttr); } #endif diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index 50914169d6fc..3b03173e17ed 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -42,32 +42,33 @@ class SvxTwoLinesItem; class SwTxtCharFmt : public SwTxtAttrEnd { - SwTxtNode* pMyTxtNd; - USHORT mnSortNumber; + SwTxtNode * m_pTxtNode; + USHORT m_nSortNumber; public: - SwTxtCharFmt( const SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); - ~SwTxtCharFmt( ); + SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + virtual ~SwTxtCharFmt( ); // werden vom SwFmtCharFmt hierher weitergeleitet virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; - // erfrage und setze den TxtNode Pointer - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + // get and set TxtNode pointer + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } - void SetSortNumber( USHORT nSortNumber ) { mnSortNumber = nSortNumber; } - USHORT GetSortNumber() const { return mnSortNumber; } + void SetSortNumber( USHORT nSortNumber ) { m_nSortNumber = nSortNumber; } + USHORT GetSortNumber() const { return m_nSortNumber; } }; // ATT_HARDBLANK ****************************** class SwTxtHardBlank : public SwTxtAttr { - sal_Unicode cChar; + sal_Unicode m_Char; + public: SwTxtHardBlank( const SwFmtHardBlank& rAttr, xub_StrLen nStart ); - inline sal_Unicode GetChar() const { return cChar; } + inline sal_Unicode GetChar() const { return m_Char; } }; // ATT_XNLCONTAINERITEM ****************************** @@ -83,20 +84,20 @@ public: class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrEnd, public SwClient { - SwTxtNode* pMyTxtNd; + SwTxtNode* m_pTxtNode; public: - SwTxtRuby( const SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtRuby(); TYPEINFO(); virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; - // erfrage und setze den TxtNode Pointer - const SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + /// get and set TxtNode pointer + const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; } inline const SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } SwCharFmt* GetCharFmt(); const SwCharFmt* GetCharFmt() const @@ -116,8 +117,8 @@ public: inline const SwTxtNode& SwTxtRuby::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtRuby:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtRuby: where is my TxtNode?" ); + return *m_pTxtNode; } #endif diff --git a/sw/inc/txtflcnt.hxx b/sw/inc/txtflcnt.hxx index ca8fbbf4f2ea..e88fbb55bee5 100644 --- a/sw/inc/txtflcnt.hxx +++ b/sw/inc/txtflcnt.hxx @@ -45,7 +45,7 @@ class SwTxtFlyCnt : public SwTxtAttr SwFlyInCntFrm *_GetFlyFrm( const SwFrm *pCurrFrm ); public: - SwTxtFlyCnt( const SwFmtFlyCnt& rAttr, xub_StrLen nStart ); + SwTxtFlyCnt( SwFmtFlyCnt& rAttr, xub_StrLen nStart ); // Setzt den Anker im pFmt und void SetAnchor( const SwTxtNode *pNode ); @@ -64,7 +64,7 @@ inline SwFlyInCntFrm *SwTxtFlyCnt::GetFlyFrm( const SwFrm *pCurrFrm ) inline const SwFlyInCntFrm *SwTxtFlyCnt::GetFlyFrm( const SwFrm *pCurrFrm ) const { - return ((SwTxtFlyCnt*)this)->_GetFlyFrm( pCurrFrm ); + return (const_cast<SwTxtFlyCnt*>(this))->_GetFlyFrm( pCurrFrm ); } #endif diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx index 85af7e3f1046..d290b16dd710 100644 --- a/sw/inc/txtfld.hxx +++ b/sw/inc/txtfld.hxx @@ -40,20 +40,21 @@ class SwTxtNode; class SwTxtFld : public SwTxtAttr { - mutable String aExpand; - SwTxtNode *pMyTxtNd; + mutable String m_aExpand; + SwTxtNode * m_pTxtNode; + public: - SwTxtFld( const SwFmtFld& rAttr, xub_StrLen nStart ); - ~SwTxtFld(); + SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStart ); + virtual ~SwTxtFld(); void CopyFld( SwTxtFld *pDest ) const; void Expand() const; inline void ExpandAlways(); - // erfrage und setze den TxtNode Pointer - SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + // get and set TxtNode pointer + SwTxtNode* GetpTxtNode() const { return m_pTxtNode; } inline SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } // enable notification that field content has changed and needs reformatting void NotifyContentChange(SwFmtFld& rFmtFld); @@ -68,13 +69,13 @@ public: inline SwTxtNode& SwTxtFld::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtFld:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" ); + return *m_pTxtNode; } inline void SwTxtFld::ExpandAlways() { - aExpand += ' '; + m_aExpand += ' '; Expand(); } diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index c2011babf8a9..6ed95e05ba06 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -41,26 +41,22 @@ class SwDoc; class SW_DLLPUBLIC SwTxtFtn : public SwTxtAttr { - SwNodeIndex *pStartNode; - SwTxtNode* pMyTxtNd; - USHORT nSeqNo; - - // Zuweisung und Copy-Ctor sind nicht erlaubt. - SwTxtFtn& operator=( const SwTxtFtn &rTxtFtn ); - SwTxtFtn( const SwTxtFtn &rTxtFtn ); + SwNodeIndex * m_pStartNode; + SwTxtNode * m_pTxtNode; + USHORT m_nSeqNo; public: - SwTxtFtn( const SwFmtFtn& rAttr, xub_StrLen nStart ); - ~SwTxtFtn(); + SwTxtFtn( SwFmtFtn& rAttr, xub_StrLen nStart ); + virtual ~SwTxtFtn(); - inline SwNodeIndex *GetStartNode() const { return pStartNode; } + inline SwNodeIndex *GetStartNode() const { return m_pStartNode; } void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE ); void SetNumber( const USHORT nNumber, const String* = 0 ); void CopyFtn( SwTxtFtn *pDest ); - // erfrage und setze den TxtNode Pointer + // get and set TxtNode pointer inline const SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } // lege eine neue leere TextSection fuer diese Fussnote an void MakeNewTextSection( SwNodes& rNodes ); @@ -72,16 +68,16 @@ public: // fuer die Querverweise auf Fussnoten USHORT SetSeqRefNo(); - void SetSeqNo( USHORT n ) { nSeqNo = n; } // fuer die Reader - USHORT GetSeqRefNo() const { return nSeqNo; } + void SetSeqNo( USHORT n ) { m_nSeqNo = n; } // for Readers + USHORT GetSeqRefNo() const { return m_nSeqNo; } static void SetUniqueSeqRefNo( SwDoc& rDoc ); }; inline const SwTxtNode& SwTxtFtn::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtFtn:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" ); + return *m_pTxtNode; } #endif diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index ef55bf69d5c9..e37a18a3f823 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -29,54 +29,54 @@ ************************************************************************/ #ifndef _TXTINET_HXX #define _TXTINET_HXX + #include <txatbase.hxx> #include <calbck.hxx> class SwTxtNode; class SwCharFmt; -class Color; // ATT_INETFMT ********************************************* class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrEnd, public SwClient { - SwTxtNode* pMyTxtNd; - BOOL bVisited : 1; // Besuchter Link? - BOOL bValidVis : 1; // Ist das bVisited-Flag gueltig? - BOOL bColor : 1; + SwTxtNode * m_pTxtNode; + bool m_bVisited : 1; // visited link? + bool m_bVisitedValid : 1; // is m_bVisited valid? // forbidden and not implemented. SwTxtINetFmt(); public: - SwTxtINetFmt( const SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtINetFmt(); TYPEINFO(); virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; - // erfrage und setze den TxtNode Pointer - const SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + // get and set TxtNode pointer + const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; } inline const SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } SwCharFmt* GetCharFmt(); const SwCharFmt* GetCharFmt() const - { return ((SwTxtINetFmt*)this)->GetCharFmt(); } + { return const_cast<SwTxtINetFmt*>(this)->GetCharFmt(); } - BOOL IsVisited() const { return bVisited; } - void SetVisited( BOOL bNew ) { bVisited = bNew; } + bool IsVisited() const { return m_bVisited; } + void SetVisited( bool bNew ) { m_bVisited = bNew; } - BOOL IsValidVis() const { return bValidVis; } - void SetValidVis( BOOL bNew ) { bValidVis = bNew; } + bool IsVisitedValid() const { return m_bVisitedValid; } + void SetVisitedValid( bool bNew ) { m_bVisitedValid = bNew; } BOOL IsProtect() const; }; + inline const SwTxtNode& SwTxtINetFmt::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtINetFmt:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtINetFmt: where is my TxtNode?" ); + return *m_pTxtNode; } #endif diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx index 0496e9706e21..73319fd6a209 100644 --- a/sw/inc/txtrfmrk.hxx +++ b/sw/inc/txtrfmrk.hxx @@ -39,23 +39,25 @@ class SwTxtNode; class SwTxtRefMark : public SwTxtAttrEnd { - SwTxtNode* pMyTxtNd; - USHORT* pEnd; // fuer InhaltsReferenz / PositionRef. ohne Ende + SwTxtNode * m_pTxtNode; + xub_StrLen * m_pEnd; // end is optional (point reference) + public: - SwTxtRefMark( const SwFmtRefMark& rAttr, - xub_StrLen nStart, xub_StrLen * pEnd = 0 ); + SwTxtRefMark( SwFmtRefMark& rAttr, + xub_StrLen nStart, xub_StrLen * pEnd = 0 ); - virtual xub_StrLen *GetEnd(); // SwTxtAttr - inline const xub_StrLen* GetEnd() const { return pEnd; } + virtual xub_StrLen * GetEnd(); // SwTxtAttr + inline const xub_StrLen * GetEnd() const { return m_pEnd; } - // erfrage und setze den TxtNode Pointer + // get and set TxtNode pointer inline const SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } }; + inline const SwTxtNode& SwTxtRefMark::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtRefMark:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtRefMark: where is my TxtNode?" ); + return *m_pTxtNode; } #endif diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx index 98096d620c2d..fe9e37775b17 100644 --- a/sw/inc/txttxmrk.hxx +++ b/sw/inc/txttxmrk.hxx @@ -40,28 +40,28 @@ class SwDoc; class SwTxtTOXMark : public SwTxtAttrEnd { - xub_StrLen* pEnd; // wenn AlternativText vom SwTOXMark dann 0 !! - SwTxtNode* pMyTxtNd; + SwTxtNode * m_pTxtNode; + xub_StrLen * m_pEnd; // 0 if SwTOXMark without AlternativeText + public: - SwTxtTOXMark( const SwTOXMark& rAttr, - xub_StrLen nStart, xub_StrLen * pEnd = 0 ); + SwTxtTOXMark( SwTOXMark& rAttr, xub_StrLen nStart, xub_StrLen * pEnd = 0 ); virtual ~SwTxtTOXMark(); - virtual xub_StrLen *GetEnd(); // SwTxtAttr - inline const xub_StrLen* GetEnd() const { return pEnd; } + virtual xub_StrLen *GetEnd(); // SwTxtAttr + inline const xub_StrLen* GetEnd() const { return m_pEnd; } void CopyTOXMark( SwDoc* pDestDoc ); - // erfrage und setze den TxtNode Pointer - inline const SwTxtNode* GetpTxtNd() const { return pMyTxtNd; } + // get and set TxtNode pointer + inline const SwTxtNode* GetpTxtNd() const { return m_pTxtNode; } inline const SwTxtNode& GetTxtNode() const; - void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } }; inline const SwTxtNode& SwTxtTOXMark::GetTxtNode() const { - ASSERT( pMyTxtNd, "SwTxtTOXMark:: wo ist mein TextNode?" ); - return *pMyTxtNd; + ASSERT( m_pTxtNode, "SwTxtTOXMark: where is my TxtNode?" ); + return *m_pTxtNode; } #endif diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 00053210553a..2c7282778053 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -53,6 +53,10 @@ #include <vector> // <-- +#include <boost/shared_ptr.hpp> +#include <memory> + + class SwUndoIter; class SwHistory; class SwIndex; @@ -68,7 +72,7 @@ class SwTable; class SwTableBox; struct SwSortOptions; class SwFrmFmt; -class SwHstryBookmark; +class SwHistoryBookmark; class SwSection; class SwSectionFmt; class SvxTabStopItem; @@ -102,6 +106,10 @@ class SwRedlineSaveData; class SwRedline; struct SwSaveRowSpan; +namespace sfx2 { + class MetadatableUndo; +} + namespace utl { class TransliterationWrapper; } @@ -400,6 +408,8 @@ class SwUndoDelete: public SwUndo, private SwUndRng, private SwUndoSaveCntnt String *pSttStr, *pEndStr; SwRedlineData* pRedlData; SwRedlineSaveDatas* pRedlSaveData; + ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; + ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; String sTableName; @@ -557,14 +567,15 @@ public: class SwUndoAttr : public SwUndo, private SwUndRng { - SfxItemSet aSet; // Attribute fuers Redo - SwHistory* pHistory; // History fuers Undo - SwRedlineData* pRedlData; // Redlining - SwRedlineSaveDatas* pRedlSaveData; - ULONG nNdIdx; // fuers Redlining - Offset - USHORT nInsFlags; // Einfuege Flags + SfxItemSet m_AttrSet; // attributes for Redo + const ::std::auto_ptr<SwHistory> m_pHistory; // History for Undo + ::std::auto_ptr<SwRedlineData> m_pRedlineData; // Redlining + ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData; + ULONG m_nNodeIndex; // Offset: for Redlining + const USHORT m_nInsertFlags; // insert flags void RemoveIdx( SwDoc& rDoc ); + public: SwUndoAttr( const SwPaM&, const SfxItemSet&, USHORT nFlags = 0 ); SwUndoAttr( const SwPaM&, const SfxPoolItem&, USHORT nFlags = 0 ); @@ -572,40 +583,44 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - SwHistory* GetHistory() { return pHistory; } void SaveRedlineData( const SwPaM& rPam, BOOL bInsCntnt ); + SwHistory& GetHistory() { return *m_pHistory; } + OUT_UNDOBJ( InsAttr ) }; -class SwUndoRstAttr : public SwUndo, private SwUndRng +class SwUndoResetAttr : public SwUndo, private SwUndRng { - SwHistory* pHistory; - SvUShortsSort aIds; - USHORT nFmtId; // Format-Id fuer das Redo + const ::std::auto_ptr<SwHistory> m_pHistory; + SvUShortsSort m_Ids; + const USHORT m_nFormatId; // Format-Id for Redo + public: - SwUndoRstAttr( const SwPaM&, USHORT nFmtId ); - SwUndoRstAttr( const SwDoc&, const SwPosition&, USHORT nWhichId ); - virtual ~SwUndoRstAttr(); + SwUndoResetAttr( const SwPaM&, USHORT nFmtId ); + SwUndoResetAttr( const SwPosition&, USHORT nFmtId ); + virtual ~SwUndoResetAttr(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); void SetAttrs( const SvUShortsSort& rArr ); - SwHistory* GetHistory() { return pHistory; } + + SwHistory& GetHistory() { return *m_pHistory; } + OUT_UNDOBJ( ResetAttr ) }; class SwUndoFmtAttr : public SwUndo { friend class SwUndoDefaultAttr; - SwFmt* pFmt; - SfxItemSet* pOldSet; // die alten Attribute - ULONG nNode; - const USHORT nFmtWhich; - const BOOL bSaveDrawPt; - - int IsFmtInDoc( SwDoc* ); // ist das Attribut-Format noch im Doc ? - void SaveFlyAnchor( BOOL bSaveDrawPt = FALSE ); + SwFmt * m_pFmt; + ::std::auto_ptr<SfxItemSet> m_pOldSet; // old attributes + ULONG m_nNodeIndex; + const USHORT m_nFmtWhich; + const bool m_bSaveDrawPt; + + bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc? + void SaveFlyAnchor( bool bSaveDrawPt = false ); // --> OD 2004-10-26 #i35443# - Add return value, type <bool>. // Return value indicates, if anchor attribute is restored. // Notes: - If anchor attribute is restored, all other existing attributes @@ -621,15 +636,15 @@ class SwUndoFmtAttr : public SwUndo // <-- public: - // meldet sich im Format an und sichert sich die alten Attribute + // register at the Format and save old attributes // --> OD 2008-02-27 #refactorlists# - removed <rNewSet> SwUndoFmtAttr( const SfxItemSet& rOldSet, SwFmt& rFmt, - BOOL bSaveDrawPt = TRUE ); + bool bSaveDrawPt = true ); // <-- SwUndoFmtAttr( const SfxPoolItem& rItem, SwFmt& rFmt, - BOOL bSaveDrawPt = TRUE ); + bool bSaveDrawPt = true ); virtual ~SwUndoFmtAttr(); virtual void Undo( SwUndoIter& ); // --> OD 2004-10-26 #i35443# - <Redo(..)> calls <Undo(..)> - nothing else @@ -641,7 +656,7 @@ public: OUT_UNDOBJ( InsFmtAttr ) void PutAttr( const SfxPoolItem& rItem ); - SwFmt* GetFmt( SwDoc& rDoc ); // prueft, ob es noch im Doc ist! + SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc! }; // --> OD 2008-02-12 #newlistlevelattrs# @@ -657,18 +672,19 @@ class SwUndoFmtResetAttr : public SwUndo private: // format at which a certain attribute is reset. - SwFmt* mpChangedFormat; + SwFmt * const m_pChangedFormat; // which ID of the reset attribute - USHORT mnWhichId; + const USHORT m_nWhichId; // old attribute which has been reset - needed for undo. - SfxPoolItem* mpOldItem; + ::std::auto_ptr<SfxPoolItem> m_pOldItem; }; // <-- class SwUndoDontExpandFmt : public SwUndo { - ULONG nNode; - xub_StrLen nCntnt; + const ULONG m_nNodeIndex; + const xub_StrLen m_nContentIndex; + public: SwUndoDontExpandFmt( const SwPosition& rPos ); virtual void Undo( SwUndoIter& ); @@ -676,14 +692,20 @@ public: virtual void Repeat( SwUndoIter& ); }; -// Hilfs-Klasse, um die geaenderten Sets zu "empfangen" -struct _UndoFmtAttr : public SwClient +// helper class to receive changed attribute sets +class SwUndoFmtAttrHelper : public SwClient { - SwUndoFmtAttr* pUndo; - BOOL bSaveDrawPt; + ::std::auto_ptr<SwUndoFmtAttr> m_pUndo; + const bool m_bSaveDrawPt; + +public: + SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true ); - _UndoFmtAttr( SwFmt& rFmt, BOOL bSaveDrawPt = TRUE ); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + + SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); } + // release the undo object (so it is not deleted here), and return it + SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); } }; @@ -735,15 +757,18 @@ public: class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng { - SwHistory* pHistory; - BOOL bModulus; + const ::std::auto_ptr<SwHistory> m_pHistory; + const bool m_bModulus; + public: SwUndoMoveLeftMargin( const SwPaM&, BOOL bRight, BOOL bModulus ); virtual ~SwUndoMoveLeftMargin(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - SwHistory* GetHistory() { return pHistory; } + + SwHistory& GetHistory() { return *m_pHistory; } + OUT_UNDOBJ( MoveLeftMargin ) }; @@ -1081,7 +1106,8 @@ public: class SwUndoBookmark : public SwUndo { - SwHstryBookmark* pHBookmark; + const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark; + protected: SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& ); @@ -1417,10 +1443,11 @@ public: class SwUndoDefaultAttr : public SwUndo { - SfxItemSet* pOldSet; // die alten Attribute - SvxTabStopItem* pTabStop; + ::std::auto_ptr<SfxItemSet> m_pOldSet; // the old attributes + ::std::auto_ptr<SvxTabStopItem> m_pTabStop; + public: - // meldet sich im Format an und sichert sich die alten Attribute + // registers at the format and saves old attributes SwUndoDefaultAttr( const SfxItemSet& rOldSet ); virtual ~SwUndoDefaultAttr(); virtual void Undo( SwUndoIter& ); @@ -1716,31 +1743,32 @@ public: //-------------------------------------------------------------------- -class SwUndoChgFtn : public SwUndo, private SwUndRng +class SwUndoChangeFootNote : public SwUndo, private SwUndRng { - SwHistory* pHistory; - String sTxt; - USHORT nNo; - BOOL bEndNote; + const ::std::auto_ptr<SwHistory> m_pHistory; + const String m_Text; + const USHORT m_nNumber; + const bool m_bEndNote; + public: - SwUndoChgFtn( const SwPaM& rRange, const String& rTxt, - USHORT nNum, BOOL bIsEndNote ); - virtual ~SwUndoChgFtn(); + SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt, + USHORT nNum, bool bIsEndNote ); + virtual ~SwUndoChangeFootNote(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - SwHistory* GetHistory() { return pHistory; } + SwHistory& GetHistory() { return *m_pHistory; } }; -class SwUndoFtnInfo : public SwUndo +class SwUndoFootNoteInfo : public SwUndo { - SwFtnInfo *pFtnInfo; + ::std::auto_ptr<SwFtnInfo> m_pFootNoteInfo; public: - SwUndoFtnInfo( const SwFtnInfo &rInfo ); - virtual ~SwUndoFtnInfo(); + SwUndoFootNoteInfo( const SwFtnInfo &rInfo ); + virtual ~SwUndoFootNoteInfo(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); @@ -1748,7 +1776,7 @@ public: class SwUndoEndNoteInfo : public SwUndo { - SwEndNoteInfo *pEndNoteInfo; + ::std::auto_ptr<SwEndNoteInfo> m_pEndNoteInfo; public: SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo ); @@ -1776,7 +1804,7 @@ public: virtual void Redo( SwUndoIter& rUndoIter ); virtual void Repeat( SwUndoIter& rUndoIter ); - void AddChanges( const SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen, + void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen, ::com::sun::star::uno::Sequence <sal_Int32>& rOffsets ); BOOL HasData() const {return 0 != pData; } }; diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index 99a089f1194e..f728c51293e9 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -518,7 +518,8 @@ SwSimpleIndexAccessBaseClass; class SwXFootnotes : public SwSimpleIndexAccessBaseClass, public SwUnoCollection { - sal_Bool bEndnote; + const bool m_bEndnote; + protected: virtual ~SwXFootnotes(); public: diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx index f3c1bb8ebef9..f58bc92fa3a3 100644 --- a/sw/inc/unocrsr.hxx +++ b/sw/inc/unocrsr.hxx @@ -49,9 +49,14 @@ private: // forbidden and not implemented. //SwUnoCrsr( const SwUnoCrsr& ); SwUnoCrsr & operator= ( const SwUnoCrsr& ); -public: - virtual operator SwUnoCrsr* (); +protected: + + virtual const SwCntntFrm* DoSetBidiLevelLeftRight( + BOOL & io_rbLeft, BOOL bVisualAllowed, BOOL bInsertCrsr); + virtual void DoSetBidiLevelUpDown(); + +public: // virtual SwCursor* Create( SwPaM* pRing = 0 ) const; @@ -62,21 +67,23 @@ public: nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )); + virtual bool IsReadOnlyAvailable() const; + BOOL IsRemainInSection() const { return bRemainInSection; } void SetRemainInSection( BOOL bFlag ) { bRemainInSection = bFlag; } - BOOL IsSkipOverProtectSections() const + virtual BOOL IsSkipOverProtectSections() const { return bSkipOverProtectSections; } void SetSkipOverProtectSections( BOOL bFlag ) { bSkipOverProtectSections = bFlag; } - BOOL IsSkipOverHiddenSections() const + virtual BOOL IsSkipOverHiddenSections() const { return bSkipOverHiddenSections; } void SetSkipOverHiddenSections( BOOL bFlag ) { bSkipOverHiddenSections = bFlag; } // make copy of cursor - SwUnoCrsr * Clone() const; + virtual SwUnoCrsr * Clone() const; DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr ) }; @@ -98,10 +105,6 @@ public: // virtual SwCursor* Create( SwPaM* pRing = 0 ) const; - virtual operator SwUnoCrsr* (); - virtual operator SwUnoTableCrsr* (); - virtual operator SwTableCursor* (); - // gibt es eine Selection vom Content in die Tabelle // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt virtual BOOL IsSelOvr( int eFlags = @@ -109,6 +112,8 @@ public: nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )); + virtual SwUnoTableCrsr * Clone() const; + void MakeBoxSels(); SwCursor& GetSelRing() { return aTblSel; } diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 74a67295d23e..dc0bd7dfafc3 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -90,22 +90,14 @@ #include <tools/link.hxx> #include <IDocumentMarkAccess.hxx> +#include <sfx2/Metadatable.hxx> + class SwUnoCrsr; class SwCursor; class SwFmtFtn; class SwFmtRefMark; class GetCurTxtFmtColl; -/* -----------------------------01.12.00 18:09-------------------------------- - - ---------------------------------------------------------------------------*/ -class SwParaSelection -{ - SwUnoCrsr* pUnoCrsr; -public: - SwParaSelection(SwUnoCrsr* pCrsr); - ~SwParaSelection(); -}; /* -----------------29.04.98 07:35------------------- * @@ -751,14 +743,12 @@ class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 void DeleteAndInsert(const String& rText) throw( ::com::sun::star::uno::RuntimeException ); protected: virtual ~SwXTextRange(); + public: - SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rxParent); - SwXTextRange(SwFrmFmt& rFmt, SwPaM& rPam); - SwXTextRange(SwFrmFmt& rTblFmt, SwTableBox& rTblBox, SwPaM& rPam); - SwXTextRange(SwFrmFmt& rTblFmt, const SwStartNode& rStartNode, SwPaM& rPam); + SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rxParent, enum RangePosition eRange = RANGE_IN_TEXT); + // only for RANGE_IS_TABLE SwXTextRange(SwFrmFmt& rTblFmt); - TYPEINFO(); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); @@ -822,6 +812,8 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( SwDoc* pDoc, const SwPosition& rPos, const SwPosition* pMark); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, + const SwPosition& rPos); }; /* -----------------15.05.98 08:29------------------- @@ -1146,8 +1138,9 @@ public: /*-----------------07.04.98 08:15------------------- --------------------------------------------------*/ -class SwXParagraph : public cppu::WeakImplHelper10 +class SwXParagraph : public cppu::ImplInheritanceHelper10 < + ::sfx2::MetadatableMixin, ::com::sun::star::beans::XTolerantMultiPropertySet, ::com::sun::star::beans::XMultiPropertySet, ::com::sun::star::text::XTextRange, @@ -1181,8 +1174,9 @@ protected: virtual ~SwXParagraph(); public: SwXParagraph(); - SwXParagraph(SwXText* pParent, SwUnoCrsr* pCrsr, sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); + SwXParagraph(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const & i_xParent, SwTxtNode * i_pTxtNode, sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); + TYPEINFO(); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); @@ -1249,12 +1243,18 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + //MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); + //SwClient virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); BOOL IsDescriptor() const {return m_bIsDescriptor;} - SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} + const SwTxtNode * GetTxtNode() const; + SwTxtNode * GetTxtNode(); static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, const rtl::OUString& rPropertyName, USHORT nWID = 0); @@ -1283,8 +1283,10 @@ class SwXParaFrameEnumeration : public cppu::WeakImplHelper2 SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} BOOL CreateNextObject(); void FillFrame(SwUnoCrsr& rUnoCrsr); + public: - SwXParaFrameEnumeration(const SwUnoCrsr& rUnoCrsr, sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); + SwXParaFrameEnumeration(const SwPaM& rPaM, + sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); ~SwXParaFrameEnumeration(); //XEnumeration diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx index ed29a995dfe3..889442d47a21 100644 --- a/sw/inc/unoport.hxx +++ b/sw/inc/unoport.hxx @@ -141,8 +141,8 @@ protected: virtual ~SwXTextPortion(); public: - SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, SwTextPortionType eType ); - SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, SwFrmFmt& rFmt ); + SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType ); + SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt ); //XTextRange @@ -237,7 +237,7 @@ class SwXRubyPortion : public SwXTextPortion public: SwXRubyPortion(const SwUnoCrsr* pPortionCrsr, SwTxtRuby& rAttr, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rParent, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, sal_Bool bEnd ); ~SwXRubyPortion(); }; diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index 3f898a7a1718..a240e166d197 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -29,9 +29,8 @@ ************************************************************************/ #ifndef _VISCRS_HXX #define _VISCRS_HXX -#ifndef _CURSOR_HXX //autogen + #include <vcl/cursor.hxx> -#endif #include "swcrsr.hxx" #include "swrect.hxx" #include "swregion.hxx" @@ -145,8 +144,6 @@ public: SwShellCrsr( SwShellCrsr& ); virtual ~SwShellCrsr(); - virtual operator SwShellCrsr* (); - void Show(); // Update und zeige alle Selektionen an void Hide(); // verstecke alle Selektionen void Invalidate( const SwRect& rRect ); @@ -181,6 +178,8 @@ public: nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )); #endif + virtual bool IsReadOnlyAvailable() const; + DECL_FIXEDMEMPOOL_NEWDEL( SwShellCrsr ) }; @@ -200,8 +199,6 @@ public: const SwPosition &rPtPos, const Point& rPtPt ); virtual ~SwShellTableCrsr(); - virtual operator SwShellTableCrsr* (); - virtual void FillRects(); // fuer Table- und normalen Crsr // Pruefe, ob sich der SPoint innerhalb der Tabellen-SSelection befindet @@ -209,8 +206,7 @@ public: virtual void SetMark(); virtual SwCursor* Create( SwPaM* pRing = 0 ) const; - virtual operator SwShellCrsr* (); - virtual operator SwTableCursor* (); + virtual short MaxReplaceArived(); //returns RET_YES/RET_CANCEL/RET_NO virtual void SaveTblBoxCntnt( const SwPosition* pPos = 0 ); |