diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-21 15:40:02 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-21 15:40:02 +0000 |
commit | df6d312ca537402463e4eb0530f22b956600fc02 (patch) | |
tree | 7fa6773aa4f8b51d28bac23492138813bc6cb74f /sw/inc | |
parent | 24ee9419887e47b6717b1ab3969ace6b65235baa (diff) |
CWS-TOOLING: integrate CWS swrefactormarks2
2009-04-09 12:51:41 +0200 b_michaelsen r270689 : #i94949# cleaned up assertions after rebasing
2009-04-08 17:37:08 +0200 b_michaelsen r270658 : fixing sw/source/ui/utlui/makefile.mk
2009-04-07 17:56:54 +0200 b_michaelsen r270606 : added bookctrl.cxx to EXCEPTIONFILES, because this is needed for stl on unxsols4
2009-04-07 17:05:20 +0200 b_michaelsen r270603 : added crbm.cxx to EXCEPTIONFILES, because this is needed for stl on unxsols4
2009-04-02 23:44:38 +0200 b_michaelsen r270436 : CWS-TOOLING: rebase CWS swrefactormarks2 to trunk@270033 (milestone: DEV300:m45)
2009-02-27 16:25:31 +0100 b_michaelsen r268606 : #i94949# fixed Windows buildbreaker
2009-02-25 18:01:13 +0100 b_michaelsen r268464 : #i94949# Bookmarktest document filter roundtrips
2009-02-24 18:23:55 +0100 b_michaelsen r268404 : #i94949# Bookmark unittests
2009-02-23 19:47:44 +0100 b_michaelsen r268370 : #i94949# added unittest for bookmarks
2009-02-23 12:22:07 +0100 b_michaelsen r268348 : #i94949# fixing CheckCrossReferences testcase
2009-02-20 18:12:50 +0100 b_michaelsen r268335 : #i94949# fixing SwXTextRange
2009-02-18 18:32:57 +0100 b_michaelsen r268252 : #i94949# deregistering DdeBookmarks on delete
2009-02-18 18:29:08 +0100 b_michaelsen r268251 : fixing dbgoutsw.cxx for debug builds
2009-02-16 18:42:43 +0100 b_michaelsen r267834 : CWS-TOOLING: rebase CWS swrefactormarks2 to trunk@267171 (milestone: DEV300:m41)
2009-02-12 15:32:02 +0100 b_michaelsen r267667 : #i94949 fixed crossrefbookmark naming
2009-02-11 18:30:08 +0100 b_michaelsen r267624 : #94949# fixing bookmark navigation
2009-02-11 13:55:26 +0100 b_michaelsen r267599 : #i94949# fixed bookmark naming
2009-02-10 17:53:05 +0100 b_michaelsen r267571 : #i94949# renamed HasOtherMarkPos to IsExpanded
2009-02-10 17:23:01 +0100 b_michaelsen r267564 : #i94949# renamed ::sw::bookmark namespace to more fitting ::sw::mark
2009-02-10 16:16:32 +0100 b_michaelsen r267553 : #i94949# creating only CrossRefBookmark per Txtnode
2009-02-10 12:14:05 +0100 b_michaelsen r267547 : #i94949# fixed bookmark count in navigator
2009-02-09 19:12:18 +0100 b_michaelsen r267532 : #i94949# lcl_CopyBookmarks(..) - handle marks on boundaries correctly
2009-02-09 17:32:45 +0100 b_michaelsen r267524 : #i94949# setting the refobject of the DdeBookmark in Sin SwServerObject::SetDdeBookmark(..)
2009-02-09 17:22:15 +0100 b_michaelsen r267523 : #i94949# trying to harden SwServerObject
2009-02-09 16:47:32 +0100 b_michaelsen r267521 : #i94949# lcl_CopyBookmarks(..): try to get the source mark name, if possible
2009-02-09 16:05:42 +0100 b_michaelsen r267519 : #i94949# clearing the OtherMarkPos if PaM has no mark in repositionMark(..), swapping inverted bookmarks without hissing an assertion
2009-02-09 15:55:38 +0100 b_michaelsen r267518 : #i94949# checking for out-of-bounds in SwView::ExecuteStatusLine(..)
2009-02-09 15:23:47 +0100 b_michaelsen r267517 : #i94949# using an UNO_BOOKMARK in ui/dbui/dbinsdlg.cxx
2009-02-09 14:14:47 +0100 b_michaelsen r267514 : #i94949# IDocumentMarkAccess::GetType(..) asserts on unknown type
2009-02-09 14:04:25 +0100 b_michaelsen r267513 : #i94949# using rtl strings instead of tools-strings in CrossRefBookmarks
2009-02-09 13:55:01 +0100 b_michaelsen r267510 : #i94949# using empty string for UnoMark construction
2009-02-09 13:46:46 +0100 b_michaelsen r267509 : #i94949# removed superfluous #includes, removed superfluous member DdeBookmark::bGenerateName, initialized DdeBookmark::m_aRefObj removed superfluous local _FindItem::ClearObj
2009-02-06 14:38:37 +0100 b_michaelsen r267462 : #i94949# fixing FN_STAT_BOOKMARK dispatches
2009-02-05 18:05:07 +0100 b_michaelsen r267436 : #i94949# removing superfluous #includes
2009-02-04 15:51:31 +0100 b_michaelsen r267391 : fixing resync merge error
2009-02-02 19:39:55 +0100 b_michaelsen r267294 : #i94949# bookmark performance
2009-01-30 19:30:51 +0100 b_michaelsen r267229 : #i94949# throwing IllegalArgumentException, if appropriate
2009-01-30 19:29:56 +0100 b_michaelsen r267228 : #i94949# refactored lcl_FillBookmarkArray, comments, constness
2009-01-30 19:23:49 +0100 b_michaelsen r267227 : #i94949# refactored lcl_FillBookmarkArray, comments, constness
2009-01-30 19:16:06 +0100 b_michaelsen r267226 : #i94949# refactored lcl_FillBookmarkArray
2009-01-30 17:59:27 +0100 b_michaelsen r267222 : #i94949# removed superficial #include
2009-01-30 17:50:02 +0100 b_michaelsen r267220 : #i94949# SwXTextRange remembers its UNO bookmark
2009-01-29 20:19:58 +0100 b_michaelsen r267168 : #i94949# implemented IDocumentMarkAccess::findBookmark
2009-01-29 17:22:17 +0100 b_michaelsen r267162 : #i94949# implemented renameMark in Markmanager
2009-01-29 14:17:10 +0100 b_michaelsen r267134 : #i94949# cleanup in SwXBookmark, whitespace
2009-01-29 13:21:54 +0100 b_michaelsen r267125 : #i94949# cleanup in SwXBookmark, whitespace
2009-01-29 13:06:10 +0100 b_michaelsen r267120 : #i94949# cleanup in SwXBookmark, whitespace
2009-01-29 13:00:09 +0100 b_michaelsen r267118 : #i94949# cleanup in SwXBookmark, whitespace
2009-01-29 10:35:10 +0100 b_michaelsen r267101 : #i94949# renamed SetCrsrToBkmk to SetCrsrToMark, moving to start/end of doc if no more bookmarks can be found
2009-01-28 17:05:36 +0100 b_michaelsen r267070 : #i94949# fixed order in aProvNamesId in unocoll.cxx
2009-01-28 15:46:13 +0100 b_michaelsen r267063 : #i94949# documentation
2009-01-28 15:36:59 +0100 b_michaelsen r267062 : #i94949# removing superficial #include
2009-01-28 15:30:36 +0100 b_michaelsen r267061 : #i94949# basic code conventions
2009-01-28 11:14:30 +0100 b_michaelsen r267039 : #i94949# comparing to the actual name of the new mark
2009-01-26 15:22:25 +0100 b_michaelsen r266927 : #i94949# performance fixes
2009-01-14 21:16:56 +0100 b_michaelsen r266332 : #i94949# fixing linux x86-64 compiler warnings
2009-01-14 19:52:06 +0100 b_michaelsen r266331 : #i94949# fixing some compiler warnings
2008-12-15 13:04:49 +0100 b_michaelsen r265474 : #i94949# fixed microsoft compiler warnings
2008-12-12 18:26:02 +0100 b_michaelsen r265434 : #i94949# fixed pro platform buildbreakers
2008-12-11 17:51:24 +0100 b_michaelsen r265342 : CWS-TOOLING: rebase CWS swrefactormarks2 to trunk@264807 (milestone: DEV300:m37)
2008-12-09 18:30:59 +0100 b_michaelsen r265134 : #i94949# fixed IDocumentMarkAccess::GetType for new mark inheritance tree
2008-12-09 16:56:26 +0100 b_michaelsen r265118 : #i94949# fixed deleteMark optimization
2008-12-09 14:55:58 +0100 b_michaelsen r265092 : #i94949# DdeLink and DdeBookmark
2008-12-05 18:28:05 +0100 b_michaelsen r264914 : #i94949# fixed InitDoc in bookmarks
2008-12-02 02:23:51 +0100 b_michaelsen r264649 : #i94949# removed obsolete naming proposal code in SwXTextRange, fixed navigator reminders to forget the oldest reminder when the pool is empty
2008-12-02 02:05:19 +0100 b_michaelsen r264648 : #i94949# using bisect search for delete
2008-12-02 01:58:16 +0100 b_michaelsen r264647 : #i94949# using bisect search for delete
2008-12-02 01:37:33 +0100 b_michaelsen r264646 : #i94949# using bisect search for delete
2008-12-02 01:03:29 +0100 b_michaelsen r264645 : #i94949# fixed deleteMark crash
2008-12-01 20:55:00 +0100 b_michaelsen r264638 : #i94949# removed crossrefs from ui enumerations
2008-12-01 15:48:12 +0100 b_michaelsen r264613 : #i94949# removed superfluous local functions
2008-12-01 15:01:19 +0100 b_michaelsen r264608 : #i94949# optimized insertion of new marks
2008-12-01 14:33:21 +0100 b_michaelsen r264603 : #i94949# simplified code finding Fieldmark for a position
2008-12-01 14:05:55 +0100 b_michaelsen r264598 : #i94949# fixed reverse travelling through marks, removed obsolete getUniqueMarkName()
2008-11-27 18:48:15 +0100 b_michaelsen r264515 : #i94949# fixed _SaveCntntIdx and friends
2008-11-27 15:59:49 +0100 b_michaelsen r264500 : #i94949# fix Mark position only in ctor
2008-11-27 15:52:28 +0100 b_michaelsen r264497 : #i94949# fixed Bug in SwXBookmark, was using pDoc too early
2008-11-26 14:54:22 +0100 b_michaelsen r264396 : #i94949# fixed documentation, simplified navigator reminder code
2008-11-24 20:45:51 +0100 b_michaelsen r264266 : #i94949# removed last obsolete getUniqueMarkName calls
2008-11-24 20:21:35 +0100 b_michaelsen r264265 : #i94949# fixed typo in IDocumentMarkAccess, removed obsolete getUniqueMarkName calls
2008-11-24 18:34:32 +0100 b_michaelsen r264264 : #i94949# repositioning of Marks, removed possibility to delete marks by name in the core, refactoring of navigator reminder generation
2008-11-21 14:08:49 +0100 b_michaelsen r264137 : #i94949# simplified makeMark
2008-11-21 12:07:09 +0100 b_michaelsen r264120 : #i94949# moved ShortName and KeyCode from IMark to IBookmark
2008-11-19 12:50:49 +0100 b_michaelsen r263981 : #i94949# starting refactoring of bookmark naming
2008-11-19 11:31:08 +0100 b_michaelsen r263972 : #i94949# getting rid of obsolete dynamic casts
2008-11-18 19:06:09 +0100 b_michaelsen r263795 : #i94949# getting rid of index based mark access, IDocumentMarkAccess already provides iterators
2008-11-18 17:50:18 +0100 b_michaelsen r263792 : #i94949# getting rid of index based mark access, IDocumentMarkAccess already provides iterators
2008-11-18 16:48:20 +0100 b_michaelsen r263783 : #i94949# removed methods from crsrsh which are already available directly via IDocumentMarkAccess
2008-11-18 11:31:35 +0100 b_michaelsen r263753 : #i94949# cleaning up mark code in crsrsh
2008-11-17 10:15:25 +0100 b_michaelsen r263705 : #i94949# removed possible integer overflow
2008-11-14 18:48:45 +0100 b_michaelsen r263695 : #i94949# management of mark names in MarkManager
2008-11-14 18:23:40 +0100 b_michaelsen r263693 : #i94949# using polymorphism to do mark-specific setup in SwDoc
2008-11-14 16:27:09 +0100 b_michaelsen r263684 : #i94949# got rid of makeCrossRefBookmark
2008-11-14 13:03:32 +0100 b_michaelsen r263674 : #i94949# refactored Correction methods
2008-11-13 12:27:55 +0100 b_michaelsen r263631 : #i94949# got rid of old-style tools assertions in new code
2008-11-12 16:58:16 +0100 b_michaelsen r263608 : #i94949# added assertion for unique names
2008-11-12 16:55:18 +0100 b_michaelsen r263607 : #i94949# maked XFormField deprecated
2008-11-12 13:04:29 +0100 b_michaelsen r263587 : #i94949# replaced IDocumentMarkAccess::GetType with simple dynamic_cast where possible
2008-11-11 18:45:53 +0100 b_michaelsen r263572 : #i94949# cleaned up SwHstryBookmark
2008-11-11 13:48:18 +0100 b_michaelsen r263557 : #i94949# removed dynamic_casts to SwModify by inheriting IMark from it
2008-11-11 11:26:28 +0100 b_michaelsen r263548 : #i94949# fixed SwXBookmark
2008-11-10 17:01:19 +0100 b_michaelsen r263529 : #i94949# fixed DdeBookmarks in clipboard
2008-11-10 16:44:52 +0100 b_michaelsen r263527 : #i94949# formatting
2008-11-10 16:29:16 +0100 b_michaelsen r263526 : #i94949# fixing unoobj.cxx
2008-11-10 16:23:50 +0100 b_michaelsen r263525 : #i94949# cleaning up crossrefbookmark.cxx/.hxx
2008-11-10 16:02:08 +0100 b_michaelsen r263524 : #i94949# Pdf Export should only generate 'real' bookmarks
2008-11-10 15:33:58 +0100 b_michaelsen r263521 : #i94949# removed const_casts
2008-11-10 15:12:06 +0100 b_michaelsen r263520 : #i94949# moved _DelBookmarks into MarksManager
2008-11-07 18:48:38 +0100 b_michaelsen r263480 : #i94949# using iterator interface
2008-11-07 18:41:46 +0100 b_michaelsen r263478 : #i94949# using iterator interface
2008-11-07 18:07:41 +0100 b_michaelsen r263477 : #i94949# using iterator interface
2008-11-07 17:54:41 +0100 b_michaelsen r263476 : #i94949# using iterator interface
2008-11-07 17:44:41 +0100 b_michaelsen r263475 : #i94949# moved correction methods into MarkManager
2008-11-06 18:47:28 +0100 b_michaelsen r263404 : #i94949# getting rid of superfluous const_casts
2008-11-06 17:58:01 +0100 b_michaelsen r263403 : #i94949# no more setting of mark positions outside of the core
2008-11-06 17:08:37 +0100 b_michaelsen r263401 : #i94949# removed setters from IMark
2008-11-06 13:55:25 +0100 b_michaelsen r263383 : #i94949 SwDoc does not implement IDocumentMarkAccess anymore
2008-11-04 18:17:03 +0100 b_michaelsen r263333 : #i94949# began removing IDocumentMarkAccess from SwDoc
2008-11-04 16:48:34 +0100 b_michaelsen r263330 : removing dead code (SwBitArray) found by mst
2008-11-04 16:29:32 +0100 b_michaelsen r263329 : removing dead code (SwBitArray) found by mst
2008-11-04 14:57:48 +0100 b_michaelsen r263326 : removing dead code (SwBitArray) found by mst
2008-11-04 14:50:18 +0100 b_michaelsen r263325 : #i94949# stricter typing in IDocumentMarkAccess
2008-10-24 15:16:27 +0200 b_michaelsen r262647 : #i94949# renamed ::sw::bookmark::SimpleMark to NavigatorReminder to fit the IDocumentMarkAccess enum
2008-10-24 15:10:10 +0200 b_michaelsen r262646 : #i94949# only 'real' bookmark implement IBookmark, Marks also get removed from m_vFieldmarks on delete/clear
2008-10-24 13:06:23 +0200 b_michaelsen r262636 : #i94949# Fieldmark tabnavigation
2008-10-23 12:16:36 +0200 b_michaelsen r262619 : #i94949# Fieldmark classes and filters
2008-10-22 13:17:18 +0200 b_michaelsen r262597 : #i94949# writer import fixes
2008-10-21 11:30:38 +0200 b_michaelsen r262565 : #i94949# renamed methods containing Bookmark in the generic IMark interface
2008-10-20 14:09:02 +0200 b_michaelsen r262318 : #i94949# fixed SwDoc::CorrRel
2008-10-16 22:45:13 +0200 b_michaelsen r262273 : #i94949 simplified Before/After methods
2008-10-16 21:40:57 +0200 b_michaelsen r262271 : #i94949 renamed SimpleMark to NavigatorReminder
2008-10-16 21:15:23 +0200 b_michaelsen r262270 : #i94949 using shared_ptr only in MarkManager
2008-10-16 17:46:37 +0200 b_michaelsen r262269 : #i94949# getFieldmarkBefore and getFieldmarkAfter
2008-10-16 17:12:13 +0200 b_michaelsen r262265 : #i94949# cleanup in crbm.cxx
2008-10-16 12:49:01 +0200 b_michaelsen r262257 : #i94949# fixed usage of invalid iterator, fixed invalid cast
2008-10-15 15:34:20 +0200 b_michaelsen r262239 : #i94949# added moved files
2008-10-15 15:26:45 +0200 b_michaelsen r262237 : #i94949# initial reimplementation of Bookmarks
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/IDocumentBookmarkAccess.hxx | 282 | ||||
-rw-r--r-- | sw/inc/IDocumentMarkAccess.hxx | 247 | ||||
-rw-r--r-- | sw/inc/IMark.hxx | 115 | ||||
-rw-r--r-- | sw/inc/SwBitArray.hxx | 185 | ||||
-rw-r--r-- | sw/inc/bookmrk.hxx | 218 | ||||
-rw-r--r-- | sw/inc/crossrefbookmark.hxx | 72 | ||||
-rw-r--r-- | sw/inc/crsrsh.hxx | 42 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 39 | ||||
-rw-r--r-- | sw/inc/docary.hxx | 5 | ||||
-rw-r--r-- | sw/inc/node.hxx | 4 | ||||
-rw-r--r-- | sw/inc/rolbck.hxx | 40 | ||||
-rw-r--r-- | sw/inc/shellio.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swserv.hxx | 13 | ||||
-rw-r--r-- | sw/inc/undobj.hxx | 9 | ||||
-rw-r--r-- | sw/inc/unocoll.hxx | 40 | ||||
-rw-r--r-- | sw/inc/unoobj.hxx | 185 | ||||
-rw-r--r-- | sw/inc/viewsh.hxx | 6 |
17 files changed, 545 insertions, 959 deletions
diff --git a/sw/inc/IDocumentBookmarkAccess.hxx b/sw/inc/IDocumentBookmarkAccess.hxx deleted file mode 100644 index 539fb594852b..000000000000 --- a/sw/inc/IDocumentBookmarkAccess.hxx +++ /dev/null @@ -1,282 +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: IDocumentBookmarkAccess.hxx,v $ - * $Revision: 1.6 $ - * - * 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. - * - ************************************************************************/ - -#ifndef IDOCUMENTBOOKMARKACCESS_HXX_INCLUDED -#define IDOCUMENTBOOKMARKACCESS_HXX_INCLUDED - -#include <sal/types.h> - -class SwBookmark; -class SwFieldBookmark; -class SwBookmarks; -class SwPaM; -class KeyCode; -class String; -struct SwPosition; -class SwTxtNode; - -/** Provides access to the bookmarks of a document. -*/ -class IDocumentBookmarkAccess -{ -public: - enum BookmarkType - { - BOOKMARK, - MARK, - DDE_BOOKMARK, - UNO_BOOKMARK, - // --> OD 2007-10-11 #i81002# - bookmark type for cross-references - CROSSREF_BOOKMARK, - // <-- - // FIELDMARK, // for future use... - FORM_FIELDMARK_TEXT, - FORM_FIELDMARK_NO_TEXT - }; - - // --> OD 2007-11-16 #i83479# - enum CrossReferenceBookmarkSubType - { - HEADING, - NUMITEM - }; - // <-- - -public: - /** Returns all bookmarks set at the document. - - @returns - the bookmarks set at the document. - */ - virtual const SwBookmarks& getBookmarks() const = 0; - - /** Generates a new bookmark in the document. - - @param rPaM - [in] the location of the new bookmark. - - @param rKC - [in] ??? - - @param rName - [in] the name of the new bookmark. - - @param rShortName - [in] the short name of the new bookmark. - - @param eMark - [in] the type of the new bookmark. - - @returns - a pointer to the new bookmark. - */ - virtual SwBookmark* makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCode& rKC, - /*[in]*/const String& rName, /*[in]*/const String& rShortName, - /*[in]*/BookmarkType eMark ) = 0; - - /** Deletes a bookmark. - - @param nPos - [in] the position of the bookmark to be deleted. - */ - virtual void deleteBookmark( /*[in]*/sal_uInt16 nPos ) = 0; - - /** Deletes a bookmark. - - @param rName - [in] the name of the bookmark to be deleted. - */ - virtual void deleteBookmark( /*[in]*/const String& rName ) = 0; - - /** Checks, if the given name fits to the cross-reference bookmark - name schema - - OD 2007-10-24 #i81002# - - @author OD - - @param rName - [in] the name to be checked. - - @returns - boolean indicating , if the name fits or not - */ - virtual bool isCrossRefBookmarkName( /*[in]*/const String& rName ) = 0; - - /** Find a bookmark. - - @param rName - [in] the name of the bookmark to be found. - - @returns - the position of the bookmark in the bookmark container. - */ - virtual sal_uInt16 findBookmark( /*[in]*/const String& rName ) = 0; - - /** Generates a unique bookmark name. The name has to be passed to the - function, a number will be added to the name if the name is already - used. - - @param rName - [in/out] the name of the bookmark. - */ - virtual void makeUniqueBookmarkName( /*[in/out]*/String& rName ) = 0; - - /** Get the number of ::com::sun::star::text::Bookmarks. - - @param bBkmrk - [in] if set, only "real" bookmarks are considered. - - @returns - the number of bookmarks. - */ - virtual sal_uInt16 getBookmarkCount( /*[in]*/bool bBkmrk) const = 0; - - /** Get a bookmark. - - @param nPos - [in] the position of the bookmark in the bookmark container. - - @param bBkmrk - [in] if set, only "real" bookmarks are considered. - - @returns - the bookmark. - */ - virtual SwBookmark& getBookmark( /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk) = 0; - - /** Get cross-reference bookmark name for certain text node - - OD 2007-11-16 #i83479# - - @author OD - - @param rTxtNode - [in] reference to text node, whose cross-reference bookmark name has to be returned. - - @param nCrossRefType - [in] sub type of cross-reference bookmark, whose name has to be returned. - - @returns - name of cross-reference bookmark of given cross-reference sub type, - if such a cross-reference bookmark exists at given textnode. - otherwise, empty string - */ - virtual String getCrossRefBookmarkName( - /*[in]*/const SwTxtNode& rTxtNode, - /*[in]*/const CrossReferenceBookmarkSubType nCrossRefType ) const = 0; - - /** Generates new cross-reference bookmark for given text node of given sub type - - OD 2007-11-16 #i83479# - - @author OD - - @param rTxtNode - [in] reference to text node, at which the cross-reference bookmark has to be generated. - - @param nCrossRefType - [in] sub type of cross-reference bookmark. - - @returns - name of generated cross-reference bookmark. - If empty, cross-reference bookmark is not generated. - */ - virtual String makeCrossRefBookmark( - /*[in]*/const SwTxtNode& rTxtNode, - /*[in]*/const CrossReferenceBookmarkSubType nCrossRefType ) = 0; - - virtual SwBookmark* getFieldBookmarkFor(const SwPosition &pos) const = 0; - virtual SwFieldBookmark* getFormFieldBookmarkFor(const SwPosition &pos) const = 0; - virtual SwBookmark* getNextFieldBookmarkFor(const SwPosition &pos) const = 0; - virtual SwBookmark* getPrevFieldBookmarkFor(const SwPosition &pos) const = 0; - -protected: - virtual ~IDocumentBookmarkAccess() {}; -}; - -namespace bookmarkfunc -{ - /** return the prefix used for cross-reference bookmark for headings - - OD 2007-11-16 #i83479# - - @author OD - */ - const String getHeadingCrossRefBookmarkNamePrefix(); - - /** return the prefix used for cross-reference bookmark for numbered items - - OD 2007-11-16 #i83479# - - @author OD - */ - const String getNumItemCrossRefBookmarkNamePrefix(); - - /** Checks, if the given name fits to the heading cross-reference bookmark - name schema - - OD 2007-11-09 #i81002# - - @author OD - - @param rName - [in] the name to be checked. - - @returns - boolean indicating , if the name fits or not - */ - bool isHeadingCrossRefBookmarkName( /*[in]*/const String& rName ); - - /** Checks, if the given name fits to the numbered item cross-reference - bookmark name schema - - OD 2007-11-09 #i81002# - - @author OD - - @param rName - [in] the name to be checked. - - @returns - boolean indicating , if the name fits or not - */ - bool isNumItemCrossRefBookmarkName( /*[in]*/const String& rName ); - - /** generate new name for a cross-reference bookmark of given sub type - - OD 2007-11-16 #i83479# - - @author OD - */ - String generateNewCrossRefBookmarkName( - /*[in]*/const IDocumentBookmarkAccess::CrossReferenceBookmarkSubType nSubType ); -} -#endif // IDOCUMENTBOOKMARKACCESS_HXX_INCLUDED diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx new file mode 100644 index 000000000000..56a6050c09c6 --- /dev/null +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * 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: IDocumentMarkAccess.hxx,v $ + * $Revision: 1.4.42.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. + * + ************************************************************************/ + +#ifndef IDOCUMENTMARKACCESS_HXX_INCLUDED +#define IDOCUMENTMARKACCESS_HXX_INCLUDED + +#include <sal/types.h> +#include <IMark.hxx> +#include <boost/shared_ptr.hpp> + +class SwPaM; +class KeyCode; +class String; +struct SwPosition; +class SwTxtNode; + +namespace sw { namespace mark { + class SaveBookmark; // FIXME: Ugly: SaveBookmark is a core-internal class, and should not be used in the interface +}} + +/** Provides access to the marks of a document. +*/ +class IDocumentMarkAccess +{ + public: + enum MarkType + { + UNO_BOOKMARK, + DDE_BOOKMARK, + BOOKMARK, + CROSSREF_HEADING_BOOKMARK, + CROSSREF_NUMITEM_BOOKMARK, + TEXT_FIELDMARK, + CHECKBOX_FIELDMARK, + NAVIGATOR_REMINDER + }; + + typedef ::boost::shared_ptr< ::sw::mark::IMark> pMark_t; + typedef ::std::vector< pMark_t > container_t; + typedef container_t::iterator iterator_t; + typedef container_t::const_iterator const_iterator_t; + typedef container_t::const_reverse_iterator const_reverse_iterator_t; + + /** Generates a new mark in the document for a certain selection. + + @param rPaM + [in] the selection being marked. + + @param rProposedName + [in] the proposed name of the new mark. + + @param eMark + [in] the type of the new mark. + + @returns + a pointer to the new mark (name might have changed). + */ + virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM, + const ::rtl::OUString& rProposedName, + MarkType eMark) =0; + + /** Returns a mark in the document for a paragraph. + If there is none, a mark will be created. + + @param rTxtNode + [in] the paragraph being marked (a selection over the paragraph is marked) + + @param eMark + [in] the type of the new mark. + + @returns + a pointer to the new mark (name might have changed). + */ + virtual ::sw::mark::IMark* getMarkForTxtNode(const SwTxtNode& rTxtNode, + MarkType eMark) =0; + + /** Moves an existing mark to a new selection and performs needed updates. + @param io_pMark + [in/out] the mark to be moved + + @param rPaM + [in] new selection to be marked + */ + + virtual void repositionMark(::sw::mark::IMark* io_pMark, + const SwPaM& rPaM) =0; + + /** Renames an existing Mark, if possible. + @param io_pMark + [in/out] the mark to be renamed + + @param rNewName + [in] new name for the mark + + @returns false, if renaming failed (because the name is already in use) + */ + virtual bool renameMark(::sw::mark::IMark* io_pMark, + const ::rtl::OUString& rNewName) =0; + + /** Corrects marks (absolute) + This method ignores the previous position of the mark in the paragraph + + @param rOldNode + [in] the node from which nodes should be moved + + @param rNewPos + [in] new position to which marks will be moved, if nOffset == 0 + + @param nOffset + [in] the offset by which the mark gets positioned of rNewPos + */ + virtual void correctMarksAbsolute(const SwNodeIndex& rOldNode, + const SwPosition& rNewPos, + const xub_StrLen nOffset) =0; + + /** Corrects marks (relative) + This method uses the previous position of the mark in the paragraph as offset + + @param rOldNode + [in] the node from which nodes should be moved + + @param rNewPos + [in] new position to which marks from the start of the paragraph will be + moved, if nOffset == 0 + + @param nOffset + [in] the offset by which the mark gets positioned of rNewPos in addition to + its old position in the paragraph + */ + virtual void correctMarksRelative(const SwNodeIndex& rOldNode, + const SwPosition& rNewPos, + const xub_StrLen nOffset) =0; + + /** Deletes marks in a range + */ + virtual void deleteMarks( + const SwNodeIndex& rStt, + const SwNodeIndex& rEnd, + ::std::vector< ::sw::mark::SaveBookmark>* pSaveBkmk, // Ugly: SaveBookmark is core-internal + const SwIndex* pSttIdx, + const SwIndex* pEndIdx) =0; + + /** Deletes a mark. + + @param ppMark + [in] an iterator pointing to the Mark to be deleted. + */ + virtual void deleteMark(const IDocumentMarkAccess::const_iterator_t ppMark) =0; + + /** Deletes a mark. + + @param ppMark + [in] the name of the mark to be deleted. + */ + virtual void deleteMark(const ::sw::mark::IMark* const pMark) =0; + + /** Clear (deletes) all marks. + */ + virtual void clearAllMarks() =0; + + /** returns a STL-like random access iterator to the begin of the sequence of marks. + */ + virtual const_iterator_t getMarksBegin() const =0; + + /** returns a STL-like random access iterator to the end of the sequence of marks. + */ + virtual const_iterator_t getMarksEnd() const =0; + + /** returns the number of marks. + */ + virtual sal_Int32 getMarksCount() const =0; + + /** Finds a mark by name. + + @param rName + [in] the name of the mark to find. + + @returns + an iterator pointing to the mark, or pointing to getMarksEnd() if nothing was found. + */ + virtual const_iterator_t findMark(const ::rtl::OUString& rMark) const =0; + + + // interface IBookmarks (BOOKMARK, CROSSREF_NUMITEM_BOOKMARK, CROSSREF_HEADING_BOOKMARK) + + /** returns a STL-like random access iterator to the begin of the sequence the IBookmarks. + */ + virtual const_iterator_t getBookmarksBegin() const =0; + + /** returns a STL-like random access iterator to the end of the sequence of IBookmarks. + */ + virtual const_iterator_t getBookmarksEnd() const =0; + + /** returns the number of IBookmarks. + */ + virtual sal_Int32 getBookmarksCount() const =0; + + /** Finds a bookmark by name. + + @param rName + [in] the name of the bookmark to find. + + @returns + an iterator pointing to the bookmark, or getBookmarksEnd() if nothing was found. + */ + virtual const_iterator_t findBookmark(const ::rtl::OUString& rMark) const =0; + + + // Fieldmarks + virtual ::sw::mark::IFieldmark* getFieldmarkFor(const SwPosition& pos) const =0; + virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& pos) const =0; + virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& pos) const =0; + + // Returns the MarkType used to create the mark + static MarkType SAL_DLLPUBLIC_EXPORT GetType(const ::sw::mark::IMark& rMark); + protected: + virtual ~IDocumentMarkAccess() {}; +}; + +#endif // IDOCUMENTBOOKMARKACCESS_HXX_INCLUDED diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx new file mode 100644 index 000000000000..81317d69a369 --- /dev/null +++ b/sw/inc/IMark.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * 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: bookmrk.hxx,v $ + * $Revision: 1.11 $ + * + * 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. + * + ************************************************************************/ +#ifndef _IMARK_HXX +#define _IMARK_HXX + +#include <vcl/keycod.hxx> +#include <calbck.hxx> +#include <pam.hxx> +#include <boost/operators.hpp> + +#ifndef SW_DECL_SWSERVEROBJECT_DEFINED +#define SW_DECL_SWSERVEROBJECT_DEFINED +SV_DECL_REF( SwServerObject ) +#endif + + +struct SwPosition; + +namespace sw { namespace mark +{ + class IMark + : virtual public SwModify // inherited as interface + , public ::boost::totally_ordered<IMark> + { + public: + //getters + virtual const SwPosition& GetMarkPos() const =0; + // GetOtherMarkPos() is only guaranteed to return a valid + // reference if IsExpanded() returned true + virtual const SwPosition& GetOtherMarkPos() const =0; + virtual const SwPosition& GetMarkStart() const =0; + virtual const SwPosition& GetMarkEnd() const =0; + virtual const ::rtl::OUString& GetName() const =0; + virtual bool IsExpanded() const =0; + virtual bool IsCoveringPosition(const SwPosition& rPos) const =0; + + //setters + // not available in IMark + // inside core, you can cast to MarkBase and use its setters, + // make sure to update the sortings in Markmanager in this case + + //operators and comparisons (non-virtual) + bool operator<(const IMark& rOther) const + { return GetMarkStart() < rOther.GetMarkStart(); } + bool operator==(const IMark& rOther) const + { return GetMarkStart() == rOther.GetMarkStart(); } + bool StartsBefore(const SwPosition& rPos) const + { return GetMarkStart() < rPos; } + bool StartsAfter(const SwPosition& rPos) const + { return GetMarkStart() > rPos; } + bool EndsBefore(const SwPosition& rPos) const + { return GetMarkEnd() < rPos; } + bool EndsAfter(const SwPosition& rPos) const + { return GetMarkEnd() > rPos; } + }; + + class IBookmark + : virtual public IMark + { + public: + virtual const ::rtl::OUString& GetShortName() const =0; + virtual const KeyCode& GetKeyCode() const =0; + virtual void SetShortName(const ::rtl::OUString&) =0; + virtual void SetKeyCode(const KeyCode&) =0; + }; + + class IFieldmark + : virtual public IMark + { + public: + //getters + virtual ::rtl::OUString GetFieldname() const =0; + virtual ::rtl::OUString GetFieldHelptext() const =0; + + //setters + virtual void SetFieldname(const ::rtl::OUString& rFieldname) =0; + virtual void SetFieldHelptext(const ::rtl::OUString& rFieldHelptext) =0; + }; + + class ICheckboxFieldmark + : virtual public IFieldmark + { + public: + virtual bool IsChecked() const =0; + virtual void SetChecked(bool checked) =0; + }; +}} +#endif diff --git a/sw/inc/SwBitArray.hxx b/sw/inc/SwBitArray.hxx deleted file mode 100644 index f5647019ec61..000000000000 --- a/sw/inc/SwBitArray.hxx +++ /dev/null @@ -1,185 +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: SwBitArray.hxx,v $ - * $Revision: 1.6 $ - * - * 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. - * - ************************************************************************/ -#ifndef _SW_BIT_ARRAY_HXX -#define _SW_BIT_ARRAY_HXX - -#include <swtypes.hxx> -#if OSL_DEBUG_LEVEL > 1 -#include <iostream> -#endif - -/** - a bit array -*/ -class SwBitArray -{ - /** - size of a group of bits - */ - static const size_t mGroupSize = sizeof(sal_uInt32); - - /** - Returns number of groups. - - @return number of groups - */ - size_t calcSize() const { return (nSize - 1)/ mGroupSize + 1; } - - /** - array of group of bits - */ - sal_uInt32 * mArray; - - /** - number of groups - */ - sal_uInt32 nSize; - - /** - Returns group of bits according to an index. - - @param n index to search for - - @return group of bits according to given index - */ - sal_uInt32 * GetGroup(sal_uInt32 n) const { return &mArray[n/mGroupSize]; } - -public: - SwBitArray(sal_uInt32 _nSize); - SwBitArray(const SwBitArray & rArray); - ~SwBitArray(); - - /** - Returns if an index is valid. - - @retval TRUE the index is valid - @retval FALSE else - */ - BOOL IsValid(sal_uInt32 n) const; - - /** - Returns the number of bits stored in the array. - - @return number of bits in the array - */ - sal_uInt32 Size() const { return nSize; } - - /** - Sets/unsets a bit. - - @param n index of bit to set/unset - @param nValue -TRUE set the bit - -FALSE unset the bit - */ - void Set(sal_uInt32 n, BOOL nValue); - - /** - Unsets all bits of the array. - */ - void Reset(); - - /** - Returns if a certain bit in the array is set. - - @param n index of the bit in question - - @retval TRUE the bit is set - @retval FALSE else - */ - BOOL Get(sal_uInt32 n) const; - - /** - Assigns a bit array to this bit array. - - @param rArray array to assign - - rArray must have the same size as this array. Otherwise this - array will not be altered. - */ - SwBitArray & operator = (const SwBitArray & rArray); - - /** - Returns the bitwise AND of two bit arrays. - - @param rA - @param rB the arrays to combine - - @return bitwise AND of rA and rB - */ - friend SwBitArray operator & (const SwBitArray & rA, - const SwBitArray & rB); - - /** - Returns the bitwise OR of two bit arrays. - - @param rA - @param rB the arrays to combine - - @return bitwise OR of rA and rB - */ - friend SwBitArray operator | (const SwBitArray & rA, - const SwBitArray & rB); - - /** - Returns the bitwise XOR of two bit arrays. - - @param rA - @param rB the arrays to combine - - @return bitwise XOR of rA and rB - */ - friend SwBitArray operator ^ (const SwBitArray & rA, - const SwBitArray & rB); - - /** - Returns the bitwise NOT of an arrays. - - @param rA the array to negate - - @return bitwise NOT of rA - */ - friend SwBitArray operator ~ (const SwBitArray & rA); - -#if OSL_DEBUG_LEVEL > 1 - /** - output operator - - @param o output stream - @param rBitArray bit array to output - - @return o after the output - */ - friend std::ostream & operator << - (std::ostream & o, const SwBitArray & rBitArray); -#endif -}; - - -#endif // _SW_BIT_ARRAY_HXX diff --git a/sw/inc/bookmrk.hxx b/sw/inc/bookmrk.hxx deleted file mode 100644 index 3b459f61c081..000000000000 --- a/sw/inc/bookmrk.hxx +++ /dev/null @@ -1,218 +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: bookmrk.hxx,v $ - * $Revision: 1.11 $ - * - * 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. - * - ************************************************************************/ -#ifndef _BOOKMRK_HXX -#define _BOOKMRK_HXX - -#include "hintids.hxx" //die Ids der Attribute, vor macitem damit die - //die Attribut richtig angezogen werden. -#include <svtools/macitem.hxx> - -#ifndef _KEYCOD_HXX //autogen -#include <vcl/keycod.hxx> -#endif -#ifndef _TOOLS_REF_HXX -#include <tools/ref.hxx> -#endif -#include <IDocumentBookmarkAccess.hxx> -#include <calbck.hxx> -#include <pam.hxx> - -#ifndef SW_DECL_SWSERVEROBJECT_DEFINED -#define SW_DECL_SWSERVEROBJECT_DEFINED -SV_DECL_REF( SwServerObject ) -#endif - - -struct SwPosition; // fwd Decl. wg. UI - -class SwBookmark : public SwModify -{ - SwPosition *pPos1, *pPos2; // wird im CTOR gesetzt, im DTOR geloescht - // pPos1 is always != 0, pPos2 may be 0 - SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt - -protected: - String aName; - String aShortName; - KeyCode aCode; - IDocumentBookmarkAccess::BookmarkType eMarkType; - - SwBookmark( const SwPosition& aPos, - const KeyCode& rCode, - const String& rName, const String& rShortName); - -public: - TYPEINFO(); - - SwBookmark( const SwPosition& aPos ); - // --> OD 2007-09-26 #i81002# - SwBookmark( const SwPaM& aPaM, - const KeyCode& rCode, - const String& rName, const String& rShortName); - // <-- - - // Beim Loeschen von Text werden Bookmarks mitgeloescht! - virtual ~SwBookmark(); - - // --> OD 2007-10-10 #i81002# - // made virtual and thus no longer inline - virtual const SwPosition& GetBookmarkPos() const; - virtual const SwPosition* GetOtherBookmarkPos() const; - // <-- - - // nicht undofaehig - const String& GetName() const { return aName; } - // nicht undofaehig - const String& GetShortName() const { return aShortName; } - // nicht undofaehig - const KeyCode& GetKeyCode() const { return aCode; } - - // Vergleiche auf Basis der Dokumentposition - BOOL operator < (const SwBookmark &) const; - BOOL operator ==(const SwBookmark &) const; - // falls man wirklich auf gleiche Position abfragen will. - BOOL IsEqualPos( const SwBookmark &rBM ) const; - - BOOL IsFormFieldMark() const { return IDocumentBookmarkAccess::FORM_FIELDMARK_TEXT == eMarkType || IDocumentBookmarkAccess::FORM_FIELDMARK_NO_TEXT == eMarkType; } - BOOL IsBookMark() const { return IDocumentBookmarkAccess::BOOKMARK == eMarkType || IDocumentBookmarkAccess::FORM_FIELDMARK_TEXT == eMarkType || IDocumentBookmarkAccess::FORM_FIELDMARK_NO_TEXT == eMarkType; } -// // --> OD 2007-10-17 #TESTING# -// BOOL IsBookMark() const -// { -// return IDocumentBookmarkAccess::BOOKMARK == eMarkType || -// IsCrossRefMark(); -// } -// // <-- - BOOL IsMark() const { return IDocumentBookmarkAccess::MARK == eMarkType; } - BOOL IsUNOMark() const { return IDocumentBookmarkAccess::UNO_BOOKMARK == eMarkType; } - // --> OD 2007-10-11 #i81002# - bookmark type for cross-references - BOOL IsCrossRefMark() const { return IDocumentBookmarkAccess::CROSSREF_BOOKMARK == eMarkType; } - // <-- - void SetType( IDocumentBookmarkAccess::BookmarkType eNewType ) { eMarkType = eNewType; } - IDocumentBookmarkAccess::BookmarkType GetType() const { return eMarkType; } - - // Daten Server-Methoden - void SetRefObject( SwServerObject* pObj ); - const SwServerObject* GetObject() const { return &refObj; } - SwServerObject* GetObject() { return &refObj; } - BOOL IsServer() const { return refObj.Is(); } - - // --> OD 2007-10-10 #i81002# - // made virtual and thus no longer inline - // to access start and end of a bookmark. - // start and end may be the same - virtual const SwPosition* BookmarkStart() const; - virtual const SwPosition* BookmarkEnd() const; - // <-- - - // --> OD 2007-09-26 #i81002# - virtual void SetBookmarkPos( const SwPosition* pNewPos1 ); - virtual void SetOtherBookmarkPos( const SwPosition* pNewPos2 ); - // <-- - -private: - // fuer METWARE: - // es wird (vorerst) nicht kopiert und nicht zugewiesen - SwBookmark(const SwBookmark &); - SwBookmark &operator=(const SwBookmark &); -}; - -class SwMark: public SwBookmark -{ -public: - SwMark( const SwPosition& aPos, - const KeyCode& rCode, - const String& rName, const String& rShortName); -}; - -class SW_DLLPUBLIC SwFieldBookmark : public SwBookmark -{ -private: - int fftype; // Type: 0 = Text, 1 = Check Box, 2 = List - int ffres; - bool ffprot; - bool ffsize; // 0 = Auto, 1=Exact (see ffhps) - int fftypetxt; // Type of text field: 0 = Regular text, 1 = Number, 2 = Date, 3 = Current date, 4 = Current time, 5 = Calculation - bool ffrecalc; - int ffmaxlen; // Number of characters for text field. Zero means unlimited. - int ffhps; // Check box size (half-point sizes). - - String ffname; - String ffhelptext; - -public: - SwFieldBookmark(const SwPosition& aPos, - const KeyCode& rCode, - const String& rName, const String& rShortName, - IDocumentBookmarkAccess::BookmarkType eMark); - - void SetFieldType(int fftype); - int GetFieldType(); - - void SetChecked(bool checked); - bool IsChecked(); - - void SetFFName(String aNewName) { - this->ffname=aNewName; - } - - String GetFFName() - { - return ffname; - } - - int GetFFRes() { - return ffres; - } - - void SetFFRes(int nNew) { - this->ffres=nNew; - } - - void SetFFHelpText(String newffhelptext) { - this->ffhelptext=newffhelptext; - } - - String GetFFHelpText() { - return ffhelptext; - } -}; - -class SwUNOMark: public SwBookmark -{ -public: - // --> OD 2007-09-26 #i81002# - SwUNOMark( const SwPaM& aPaM, - const KeyCode& rCode, - const String& rName, const String& rShortName); - // <-- -}; - - -#endif diff --git a/sw/inc/crossrefbookmark.hxx b/sw/inc/crossrefbookmark.hxx deleted file mode 100644 index a8b1f78923b4..000000000000 --- a/sw/inc/crossrefbookmark.hxx +++ /dev/null @@ -1,72 +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: crossrefbookmark.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. - * - ************************************************************************/ -#ifndef _CROSSREFBOOKMRK_HXX -#define _CROSSREFBOOKMRK_HXX - -#include <bookmrk.hxx> - -/** Bookmark for cross-references - - OD 2007-10-11 #i81002# - Bookmark, which bookmarks a complete text node (heading or numbered paragraph) - for cross-referencing. - <GetBookmarkPos()> is always at the beginning of this text node and - <GetOtherBookmarkPos()> is always NULL. - - @author OD -*/ -class SwCrossRefBookmark : public SwBookmark -{ -public: - TYPEINFO(); - - SwCrossRefBookmark( const SwPosition& aPos, - const KeyCode& rCode, - const String& rName, - const String& rShortName ); - - virtual ~SwCrossRefBookmark(); - - virtual const SwPosition* GetOtherBookmarkPos() const; - - virtual void SetBookmarkPos( const SwPosition* pNewPos1 ); - virtual void SetOtherBookmarkPos( const SwPosition* /*pNewPos2*/ ); - - IDocumentBookmarkAccess::CrossReferenceBookmarkSubType GetSubType() const; -private: - // --> OD 2007-11-16 #i83479# - IDocumentBookmarkAccess::CrossReferenceBookmarkSubType mnSubType; - // <-- - - // no copy-constructor and no assignment-operator - SwCrossRefBookmark(const SwCrossRefBookmark &); - SwCrossRefBookmark &operator=(const SwCrossRefBookmark &); -}; -#endif diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 2a66b9a63ca0..4fae1ca69a6b 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -44,7 +44,7 @@ #include <viscrs.hxx> #include <node.hxx> #include <tblsel.hxx> -#include <IDocumentBookmarkAccess.hxx> +#include <IDocumentMarkAccess.hxx> // einige Forward Deklarationen @@ -52,8 +52,6 @@ class KeyCode; class SfxItemSet; class SfxPoolItem; -class SwBookmark; -class SwFieldBookmark; class SwCntntFrm; class SwCrsrShell; class SwCursor; @@ -583,28 +581,22 @@ public: // gehe zur vorherigen Selection BOOL GoPrevCrsr(); - // am CurCrsr.SPoint - BOOL SetBookmark( const KeyCode&, const String& rName, - const String& rShortName, IDocumentBookmarkAccess::BookmarkType eMark = IDocumentBookmarkAccess::BOOKMARK); - BOOL GotoBookmark( USHORT ); // setzt CurCrsr.SPoint - BOOL GotoBookmark( USHORT nPos, BOOL bAtStart ); // - BOOL GoNextBookmark(); // TRUE, wenn's noch eine gab - BOOL GoPrevBookmark(); - USHORT GetBookmarkCnt(BOOL bBkmrk = FALSE) const; - SwBookmark& GetBookmark( USHORT, BOOL bBkmrk = FALSE ); - void DelBookmark( USHORT ); - void DelBookmark( const String& rName ); - USHORT FindBookmark( const String& rName ); - // erzeugt einen eindeutigen Namen. Der Name selbst muss vorgegeben - // werden, es wird dann bei gleichen Namen nur durchnumeriert. - void MakeUniqueBookmarkName( String& rNm ); - - bool IsFormProtected(); - SwBookmark* IsInFieldBookmark(); - SwFieldBookmark* IsInFormFieldBookmark(); - SwBookmark* GetNextFieldBookmark(); - SwBookmark* GetPrevFieldBookmark(); - bool GotoFieldBookmark(SwBookmark *pBkmk); + // at CurCrsr.SPoint + ::sw::mark::IMark* SetBookmark( + const KeyCode&, + const ::rtl::OUString& rName, + const ::rtl::OUString& rShortName, + IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::BOOKMARK); + bool GotoMark( const ::sw::mark::IMark* const pMark ); // sets CurCrsr.SPoint + bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart ); + bool GoNextBookmark(); // true, if there was one + bool GoPrevBookmark(); + + bool IsFormProtected(); + ::sw::mark::IFieldmark* GetCurrentFieldmark(); + ::sw::mark::IFieldmark* GetFieldmarkAfter(); + ::sw::mark::IFieldmark* GetFieldmarkBefore(); + bool GotoFieldmark( const ::sw::mark::IFieldmark* const pMark ); // aktualisiere den Crsrs, d.H. setze ihn wieder in den Content. // Das sollte nur aufgerufen werden, wenn der Cursor z.B. beim diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 8fe60d0fb8c7..96d1ce621441 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -39,7 +39,7 @@ #ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> #endif -#include <IDocumentBookmarkAccess.hxx> +#include <IDocumentMarkAccess.hxx> #ifndef IREDLINEACCESS_HXX_INCLUDED #include <IDocumentRedlineAccess.hxx> #endif @@ -114,6 +114,8 @@ class SwList; #include <svtools/embedhlp.hxx> #include <vector> +#include <boost/scoped_ptr.hpp> + class SfxObjectShell; class SfxObjectShellRef; class SvxForbiddenCharactersTable; @@ -142,8 +144,6 @@ class SvxMacroTableDtor; class SvxBorderLine; class SwAutoCompleteWord; class SwAutoCorrExceptWord; -class SwBookmark; -class SwBookmarks; class SwCalc; class SwCellFrm; class SwCharFmt; @@ -240,6 +240,9 @@ class SwChartDataProvider; class SwChartLockController_Helper; class IGrammarContact; +namespace sw { namespace mark { + class MarkManager; +}} namespace com { namespace sun { namespace star { namespace i18n { @@ -272,7 +275,6 @@ class SW_DLLPUBLIC SwDoc : public IDocumentSettingAccess, public IDocumentDeviceAccess, public IDocumentRedlineAccess, - public IDocumentBookmarkAccess, public IDocumentUndoRedo, public IDocumentLinksAdministration, public IDocumentFieldsAccess, @@ -319,6 +321,8 @@ class SW_DLLPUBLIC SwDoc : xXForms; // container with XForms models mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator; + const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager; + // ------------------------------------------------------------------- // die Pointer //Defaultformate @@ -337,8 +341,6 @@ class SW_DLLPUBLIC SwDoc : SwTxtFmtColls *pTxtFmtCollTbl; // FormatCollections SwGrfFmtColls *pGrfFmtCollTbl; - SwBookmarks *pBookmarkTbl; //Bookmarks - SwTOXTypes *pTOXTypes; // Verzeichnisse SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's @@ -755,10 +757,6 @@ public: virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags eMode ); virtual SwCharCompressType getCharacterCompressionType() const; virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType ); - SwBookmark* getFieldBookmarkFor(const SwPosition &pos) const; - SwBookmark* getNextFieldBookmarkFor(const SwPosition &pos) const; - SwBookmark* getPrevFieldBookmarkFor(const SwPosition &pos) const; - SwFieldBookmark* getFormFieldBookmarkFor(const SwPosition &pos) const; /** IDocumentDeviceAccess */ @@ -773,25 +771,10 @@ public: virtual SwPrintData* getPrintData() const; virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData); - /** IDocumentBookmarkAccess + /** IDocumentMarkAccess */ - virtual const SwBookmarks& getBookmarks() const; - virtual SwBookmark* makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCode& rKC, - /*[in]*/ const String& rName, /*[in]*/const String& rShortName, - /*[in]*/BookmarkType eMark ); - virtual void deleteBookmark( /*[in]*/sal_uInt16 nPos ); - virtual void deleteBookmark( /*[in]*/const String& rName ); - virtual bool isCrossRefBookmarkName( /*[in]*/const String& rName ); - virtual sal_uInt16 findBookmark( /*[in]*/const String& rName ); - virtual void makeUniqueBookmarkName( /*[in/out]*/String& rName ); - virtual sal_uInt16 getBookmarkCount( /*[in]*/ bool bBkmrk ) const; - virtual SwBookmark& getBookmark( /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk ); - virtual String getCrossRefBookmarkName( - /*[in]*/const SwTxtNode& rTxtNode, - /*[in]*/const CrossReferenceBookmarkSubType nCrossRefType ) const; - virtual String makeCrossRefBookmark( - /*[in]*/const SwTxtNode& rTxtNode, - /*[in]*/const CrossReferenceBookmarkSubType nCrossRefType ); + IDocumentMarkAccess* getIDocumentMarkAccess(); + const IDocumentMarkAccess* getIDocumentMarkAccess() const; /** IDocumentRedlineAccess */ diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 649d7b4e650d..c8ffcba549ab 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -35,7 +35,6 @@ class SwFieldType; class SwFrmFmt; class SwCharFmt; -class SwBookmark; class SwTOXType; class SwUndo; class SwSectionFmt; @@ -72,10 +71,6 @@ SV_DECL_PTRARR_DEL(SwCharFmts,SwCharFmtPtr,4,4) SV_DECL_PTRARR_DEL( SwFldTypes, SwFldTypePtr, INIT_FLDTYPES, GROW_FLDTYPES ) -//Bookmarks (nach Dokumentpositionen sortiertes Array) -typedef SwBookmark* SwBookmarkPtr; -SV_DECL_PTRARR_SORT(SwBookmarks, SwBookmarkPtr,0,1) - typedef SwTOXType* SwTOXTypePtr; SV_DECL_PTRARR_DEL( SwTOXTypes, SwTOXTypePtr, 0, 1 ) diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 6bbce692d4ec..5aa259b68c06 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -71,7 +71,7 @@ struct SwPosition; class IStyleAccess; class IDocumentSettingAccess; class IDocumentDeviceAccess; -class IDocumentBookmarkAccess; +class IDocumentMarkAccess; class IDocumentRedlineAccess; class IDocumentStylePoolAccess; class IDocumentLineNumberAccess; @@ -223,7 +223,7 @@ public: /** Provides access to the document bookmark interface */ - const IDocumentBookmarkAccess* getIDocumentBookmarkAccess() const; + const IDocumentMarkAccess* getIDocumentMarkAccess() const; /** Provides access to the document redline interface */ diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index 84d89d4e6161..f137b8b73e6c 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -44,7 +44,6 @@ class SwDoc; class SwFmt; class SwFmtColl; class SwHstryHint; -class SwBookmark; class SwTxtAttr; class SfxPoolItem; class SwTxtNode; @@ -70,7 +69,7 @@ class SwCharFmt; #include <SwNumberTreeTypes.hxx> // --> OD 2007-10-17 #i81002# -#include <IDocumentBookmarkAccess.hxx> +#include <IDocumentMarkAccess.hxx> // <-- #ifndef PRODUCT @@ -256,22 +255,25 @@ public: class SwHstryBookmark : public SwHstryHint { - String aName, aShortName; - ULONG nNode1, nNode2; - xub_StrLen nCntnt1, nCntnt2; - USHORT nKeyCode; - BYTE nTyp; - // --> OD 2007-10-17 #i81002# - const IDocumentBookmarkAccess::BookmarkType eBkmkType; - // <-- -public: - enum { BKMK_POS = 1, BKMK_OTHERPOS = 2 }; - SwHstryBookmark( const SwBookmark&, BYTE nTyp ); - virtual void SetInDoc( SwDoc* pDoc, BOOL bTmpSet ); - OUT_HSTR_HINT(Bookmark) - - BOOL IsEqualBookmark( const SwBookmark& ); - const String & GetName() const; + public: + SwHstryBookmark(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOtherPos); + virtual void SetInDoc(SwDoc * pDoc, BOOL); + OUT_HSTR_HINT(Bookmark) + + BOOL IsEqualBookmark(const ::sw::mark::IMark& rBkmk); + const ::rtl::OUString& GetName() const; + private: + const ::rtl::OUString m_aName; + ::rtl::OUString m_aShortName; + KeyCode m_aKeycode; + const ULONG m_nNode; + const ULONG m_nOtherNode; + const xub_StrLen m_nCntnt; + const xub_StrLen m_nOtherCntnt; + const bool m_bSavePos; + const bool m_bSaveOtherPos; + const bool m_bHadOtherPos; + const IDocumentMarkAccess::MarkType m_eBkmkType; }; class SwHstrySetAttrSet : public SwHstryHint @@ -371,7 +373,7 @@ public: void Add( const SwTxtAttr* pTxtHt, ULONG nNodeIdx, BOOL bNewAttr = TRUE ); void Add( const SwFmtColl*, ULONG nNodeIdx, BYTE nWhichNd ); - void Add( const SwBookmark&, BYTE ); + void Add( const ::sw::mark::IMark&, bool bSavePos, bool bSaveOtherPos ); void Add( const SwFrmFmt& rFmt ); void Add( const SwFlyFrmFmt&, USHORT& rSetPos ); void Add( const SwTxtFtn& ); diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index bc1453b561df..497426e83b4d 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -504,7 +504,7 @@ public: const String& GetBaseURL() const { return sBaseURL;} // suche die naechste Bookmark-Position aus der Bookmark-Tabelle - USHORT FindPos_Bkmk( const SwPosition& rPos ) const; + sal_Int32 FindPos_Bkmk( const SwPosition& rPos ) const; // build a bookmark table, which is sort by the node position. The // OtherPos of the bookmarks also inserted. void CreateBookmarkTbl(); diff --git a/sw/inc/swserv.hxx b/sw/inc/swserv.hxx index 2f410ac391d5..b421bee29af9 100644 --- a/sw/inc/swserv.hxx +++ b/sw/inc/swserv.hxx @@ -31,8 +31,8 @@ #define _SWSERV_HXX #include <sfx2/linksrc.hxx> +#include <IMark.hxx> -class SwBookmark; class SwSectionNode; class SwBaseLink; class SwTableNode; @@ -46,7 +46,7 @@ class SwServerObject : public ::sfx2::SvLinkSource protected: enum ServerModes { BOOKMARK_SERVER, TABLE_SERVER, SECTION_SERVER, NONE_SERVER } eType; union { - SwBookmark* pBkmk; + ::sw::mark::IMark* pBkmk; SwTableNode* pTblNd; SwSectionNode* pSectNd; } CNTNT_TYPE; @@ -54,7 +54,7 @@ protected: SwServerObject(); public: - SwServerObject( SwBookmark& rBookmark ) + SwServerObject( ::sw::mark::IMark& rBookmark ) : eType( BOOKMARK_SERVER ) { CNTNT_TYPE.pBkmk = &rBookmark; @@ -72,8 +72,8 @@ public: virtual ~SwServerObject(); virtual BOOL GetData( ::com::sun::star::uno::Any & rData, - const String & rMimeType, - BOOL bSynchron = FALSE ); + const String & rMimeType, + BOOL bSynchron = FALSE ); BOOL SetData( const String & rMimeType, const ::com::sun::star::uno::Any& rData ); @@ -83,7 +83,8 @@ public: BOOL IsLinkInServer( const SwBaseLink* ) const; - void SetNoServer() { CNTNT_TYPE.pBkmk = 0, eType = NONE_SERVER; } + void SetNoServer(); + void SetDdeBookmark( ::sw::mark::IMark& rBookmark); }; #ifndef SW_DECL_SWSERVEROBJECT_DEFINED diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index f1490eeb6d5d..00053210553a 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -48,7 +48,7 @@ #include <swundo.hxx> - +#include <IMark.hxx> // --> OD 2006-11-01 #130889# #include <vector> // <-- @@ -63,7 +63,6 @@ class SwFmt; class SwFmtColl; class SwTxtFmtColl; class SwTxtNode; -class SwBookmark; class SwTableNode; class SwTable; class SwTableBox; @@ -1084,7 +1083,7 @@ class SwUndoBookmark : public SwUndo { SwHstryBookmark* pHBookmark; protected: - SwUndoBookmark( SwUndoId nUndoId, const SwBookmark& ); + SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& ); void SetInDoc( SwDoc* ); void ResetInDoc( SwDoc* ); @@ -1112,7 +1111,7 @@ public: class SwUndoDelBookmark : public SwUndoBookmark { public: - SwUndoDelBookmark( const SwBookmark& ); + SwUndoDelBookmark( const ::sw::mark::IMark& ); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); OUT_UNDOBJ( DelBookmark ) @@ -1121,7 +1120,7 @@ public: class SwUndoInsBookmark : public SwUndoBookmark { public: - SwUndoInsBookmark( const SwBookmark& ); + SwUndoInsBookmark( const ::sw::mark::IMark& ); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); OUT_UNDOBJ( InsBookmark ) diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index 596b8e682838..8363dcdbc847 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -40,6 +40,7 @@ #include <cppuhelper/implbase2.hxx> // helper for implementations #include <cppuhelper/implbase3.hxx> // helper for implementations #include <cppuhelper/implbase4.hxx> // helper for implementations +#include <IMark.hxx> /*************************************************** *************************************************** * @@ -58,7 +59,6 @@ class SwFmtFtn; class XBookmark; class SwXReferenceMark; class SwSectionFmt; -class SwBookmark; class SwFmtRefMark; class SwXReferenceMark; class SwXBookmark; @@ -444,31 +444,31 @@ public: class SwXBookmarks : public SwCollectionBaseClass, public SwUnoCollection { -protected: - virtual ~SwXBookmarks(); -public: - SwXBookmarks(SwDoc* pDoc); + protected: + virtual ~SwXBookmarks(); + public: + SwXBookmarks(SwDoc* pDoc); - //XIndexAccess - virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - //XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + //XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + //XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + //XServiceInfo + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - static SwXBookmark* GetObject( SwBookmark& rBkm, SwDoc* pDoc ); + static SwXBookmark* GetObject( ::sw::mark::IMark& rBkm, SwDoc* pDoc); }; class SwXNumberingRulesCollection : public cppu::WeakImplHelper1 diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 7893d198309c..fa3455950071 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -91,11 +91,10 @@ #include <unomid.h> #include <tools/link.hxx> -#include <IDocumentBookmarkAccess.hxx> +#include <IDocumentMarkAccess.hxx> class SwUnoCrsr; class SwCursor; -class SwBookmark; class SwFmtFtn; class SwFmtRefMark; class GetCurTxtFmtColl; @@ -568,11 +567,7 @@ public: }; */ -/*-----------------20.02.98 08:45------------------- - ---------------------------------------------------*/ -typedef -cppu::WeakImplHelper5 +typedef cppu::WeakImplHelper5 < ::com::sun::star::text::XTextContent, ::com::sun::star::beans::XPropertySet, @@ -580,84 +575,98 @@ cppu::WeakImplHelper5 ::com::sun::star::container::XNamed, ::com::sun::star::lang::XUnoTunnel > -SwRefBookmarkBaseClass; -class SwXBookmark : public SwRefBookmarkBaseClass, - public SwClient +SwRefMarkBaseClass; + +class SwXBookmark + : public SwRefMarkBaseClass + , private SwClient { -protected: - SwEventListenerContainer aLstnrCntnr; - SwDoc* pDoc; - String m_aName; - BOOL bIsDescriptor; -protected: - virtual ~SwXBookmark(); -public: - SwXBookmark(SwBookmark* pBkm = 0, SwDoc* pDoc = 0); + private: + SwEventListenerContainer m_aLstnrCntnr; + SwDoc* m_pDoc; + String m_aName; + ::sw::mark::IMark* m_pRegisteredBookmark; + + void registerInMark(::sw::mark::IMark* const pBkmk) + { + if(pBkmk) + pBkmk->Add(this); + else if(m_pRegisteredBookmark) + { + m_aName = m_pRegisteredBookmark->GetName(); + m_pRegisteredBookmark->Remove(this); + } + m_pRegisteredBookmark = pBkmk; + } + + protected: + virtual ~SwXBookmark(); + public: + SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); - TYPEINFO(); + TYPEINFO(); - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); + //XTextContent + virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + //XComponent + virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - //XNamed - virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); + //XNamed + virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setName(const rtl::OUString& rName) throw( ::com::sun::star::uno::RuntimeException ); - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + //XServiceInfo + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + //XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - void attachToRangeEx(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange, IDocumentBookmarkAccess::BookmarkType eMark)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + void attachToRangeEx(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange, IDocumentMarkAccess::MarkType eType) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + //SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - SwBookmark* GetBookmark() const { return (SwBookmark*)GetRegisteredIn(); } - SwDoc* GetDoc(){return pDoc;} + const ::sw::mark::IMark* GetBookmark() const + { return m_pRegisteredBookmark; } + SwDoc* GetDoc() + { return m_pDoc; } }; typedef cppu::ImplInheritanceHelper1< SwXBookmark, ::com::sun::star::text::XFormField > SwXFieldmark_BASE; class SwXFieldmark : public SwXFieldmark_BASE { -private: - bool isReplacementObject; -public: - SwXFieldmark(bool isReplacementObject, SwBookmark* pBkm = 0, SwDoc* pDoc = 0); - - virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getDescription(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::sal_Int16 SAL_CALL getType( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getRes( ) throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL setType( ::sal_Int16 fieldType ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setRes( ::sal_Int16 res ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setDescription( const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException); + private: + bool isReplacementObject; + public: + SwXFieldmark(bool isReplacementObject, ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0); -// virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException); + virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual ::rtl::OUString SAL_CALL getDescription(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::sal_Int16 SAL_CALL getType( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getRes( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setType( ::sal_Int16 fieldType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRes( ::sal_Int16 res ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDescription( const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException); }; /*-----------------23.02.98 10:45------------------- @@ -707,9 +716,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); }; -/*-----------------23.02.98 12:05------------------- ---------------------------------------------------*/ class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 < ::com::sun::star::text::XTextRange, @@ -720,7 +727,7 @@ class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 ::com::sun::star::beans::XPropertyState, ::com::sun::star::container::XEnumerationAccess, ::com::sun::star::text::XRedline ->, public SwClient +>, private SwClient { friend class SwXText; enum RangePosition @@ -732,14 +739,14 @@ class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 RANGE_INVALID // von NewInstance erzeugt } eRangePosition; - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden - SfxItemPropertySet aPropSet; + SwDoc* pDoc; + SwTableBox* pBox; + const SwStartNode* pBoxStartNode; + SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden + SfxItemPropertySet aPropSet; //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + ::sw::mark::IMark* pMark; void _CreateNewBookmark(SwPaM& rPam); //TODO: new exception type for protected content @@ -803,18 +810,20 @@ public: virtual void SAL_CALL makeRedline( const ::rtl::OUString& RedlineType, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - BOOL GetPositions(SwPaM& rToFill) const; - const SwDoc* GetDoc()const {return pDoc;} - SwDoc* GetDoc(){return pDoc;} - - SwBookmark* GetBookmark() const { return (SwBookmark*)GetRegisteredIn(); } - - static BOOL XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, - const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition(SwDoc* pDoc, - const SwPosition& rPos, const SwPosition* pMark); + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + BOOL GetPositions(SwPaM& rToFill) const; + const SwDoc* GetDoc() const + { return pDoc; } + SwDoc* GetDoc() + { return pDoc; } + const ::sw::mark::IMark * const GetBookmark() const + { return pMark; } + + static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, + const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( + SwDoc* pDoc, + const SwPosition& rPos, const SwPosition* pMark); }; /* -----------------15.05.98 08:29------------------- @@ -1428,7 +1437,7 @@ public: /* -----------------27.08.98 15:11------------------- * * --------------------------------------------------*/ -class SwXReferenceMark : public SwRefBookmarkBaseClass, +class SwXReferenceMark : public SwRefMarkBaseClass, public SwClient { SwEventListenerContainer aLstnrCntnr; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index d73db5d79e0b..7a8d0eb0c273 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -47,7 +47,7 @@ class SfxObjectShellRef; class SwDoc; class IDocumentSettingAccess; class IDocumentDeviceAccess; -class IDocumentBookmarkAccess; +class IDocumentMarkAccess; class IDocumentDrawModelAccess; class IDocumentRedlineAccess; class IDocumentLayoutAccess; @@ -305,8 +305,8 @@ public: /** Provides access to the document bookmark interface */ - const IDocumentBookmarkAccess* getIDocumentBookmarkAccess() const; - IDocumentBookmarkAccess* getIDocumentBookmarkAccess(); + const IDocumentMarkAccess* getIDocumentMarkAccess() const; + IDocumentMarkAccess* getIDocumentMarkAccess(); /** Provides access to the document draw model interface */ |