From 313505000dd5252b55a106733df5eecb53c3a548 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Fri, 3 Apr 2009 14:47:31 +0000 Subject: #i92516# preparations for new print UI --- sw/inc/globals.hrc | 1 + sw/inc/unotxdoc.hxx | 3 +++ 2 files changed, 4 insertions(+) (limited to 'sw/inc') diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index 0dc7f4e06be0..390b243cde03 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -54,6 +54,7 @@ #define STR_DOC_STAT (RC_GLOBALS_BEGIN + 10) #define STR_PAGE (RC_GLOBALS_BEGIN + 14) +#define STR_PRINTOPTUI (RC_GLOBALS_BEGIN + 15) //EventStrings diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 7c0f8af1b072..a5d840c1ac2b 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -123,6 +123,7 @@ class SwXDrawPage; class SwUnoCrsr; class SwXDocumentPropertyHelper; class SfxViewFrame; +class SwPrintUIOptions; typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) @@ -216,6 +217,8 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xPropertyHelper; SwXDocumentPropertyHelper* pPropertyHelper; + SwPrintUIOptions* m_pPrintUIOptions; + void GetBodyText(); void GetNumberFormatter(); -- cgit From fa4ca9fdb46b8436d50ae6a6de91cfc0fc0f6c8c Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Mon, 20 Apr 2009 16:57:13 +0000 Subject: CWS-TOOLING: rebase CWS printerpullpages to trunk@270723 (milestone: DEV300:m46) --- sw/inc/fmtcol.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 7dcb6720d593..d06a64cf9bfd 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -116,7 +116,7 @@ public: void SetAttrOutlineLevel( int ); int GetAttrOutlineLevel() const; int GetAssignedOutlineStyleLevel() const; - inline const bool IsAssignedToListLevelOfOutlineStyle() const + inline bool IsAssignedToListLevelOfOutlineStyle() const { return mbAssignedToOutlineStyle; } -- cgit From 5322b2a0c94772961310dc646a237df18cd20e6e Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 4 Jun 2009 08:23:53 +0000 Subject: #i101242# new print dialog UI --- sw/inc/unotxdoc.hxx | 2 +- sw/inc/viewsh.hxx | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index a5d840c1ac2b..77369c7a4840 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -224,7 +224,7 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, // used for XRenderable implementation SfxViewShell * GuessViewShell(); - SwDoc * GetRenderDoc( SfxViewShell *&rpView, const ::com::sun::star::uno::Any& rSelection ); + SwDoc * GetRenderDoc( SfxViewShell *&rpView, const ::com::sun::star::uno::Any& rSelection, bool bIsPDFExport ); rtl::OUString maBuildId; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index d73db5d79e0b..e531485bd6ad 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -39,6 +39,7 @@ #include #include #include +#include namespace com { namespace sun { namespace star { namespace accessibility { class XAccessible; } } } } @@ -210,7 +211,7 @@ public: //Nach Druckerwechsel, vom Doc //pPDFOut != NULL is used for PDF export. - void InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL ); + void InitPrt( /*TLPDF Printer * ,*/ OutputDevice *pOutDev /* = NULL */ ); //Klammerung von zusammengehoerenden Aktionen. inline void StartAction(); @@ -362,16 +363,16 @@ public: void ChgAllPageSize( Size &rSz ); //Druckauftrag abwickeln. - // pPDFOut != Null is: do PDF Export (no printing!) - sal_Bool Prt( SwPrtOptions& rOptions, SfxProgress* pProgress, - OutputDevice* pPDFOut = NULL ); + // bIsPDFExport == true is: do PDF Export (no printing!) + sal_Bool Prt( OutputDevice* pOutDev, SwPrtOptions& rOptions, SfxProgress* pProgress, + bool bIsPDFExport = false ); //"Drucken" fuer OLE 2.0 static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, OutputDevice* pOleOut, const Rectangle& rRect ); // creates temporary doc with selected text for PDF export - SwDoc * CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef& ); + SwDoc * CreatePrtDoc( /*Printer* pPrt,*/ SfxObjectShellRef& ); SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt ); //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. -- cgit From 2d2f137008a6f2599acd43f59f8b169075fa6f11 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 16 Jun 2009 10:00:34 +0000 Subject: #i101242# build problems fixed; XUNoTunnel added to SwXTextView --- sw/inc/dbgoutsw.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx index 329c81b7fb38..26dc49d1fa27 100644 --- a/sw/inc/dbgoutsw.hxx +++ b/sw/inc/dbgoutsw.hxx @@ -118,7 +118,7 @@ const char * dbg_out(const std::hash_map & rMap) { return dbg_out(lcl_dbg_out(rMap)); } -const char * dbg_out(const SwFormToken & rToken); -const char * dbg_out(const SwFormTokens & rTokens); +SW_DLLPUBLIC const char * dbg_out(const SwFormToken & rToken); +SW_DLLPUBLIC const char * dbg_out(const SwFormTokens & rTokens); #endif // DEBUG #endif // __DBGOUTSW_HXX -- cgit From 3c7537520ff5fb728e357a6f6cb7b1a343cd54fe Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 16 Jul 2009 14:39:49 +0000 Subject: #i101242# new print UI dialog; PageRange now basically functional --- sw/inc/doc.hxx | 9 +++++++++ sw/inc/swprtopt.hxx | 40 ++++++++++++++++++++++++++++++++++++++++ sw/inc/viewsh.hxx | 6 ++++-- 3 files changed, 53 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index a82ea0235359..87252e9119ee 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -113,6 +113,8 @@ class SwList; #include #include +#include +#include #include @@ -239,6 +241,8 @@ class SwMsgPoolItem; class SwChartDataProvider; class SwChartLockController_Helper; class IGrammarContact; +class SwPrintUIOptions; +class SwPageFrm; namespace sw { namespace mark { class MarkManager; @@ -1350,6 +1354,11 @@ public: sal_Bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, SwPaM& rPaM, SwCrsrShell* pShell = 0); + // get the set of printable pages for the XRenderable API by + // evaluating the respective settings (see implementation) + void GetValidPagesForPrinting( SwPrintUIOptions &rPrintUIOptions, + sal_Int32 nDocPageCount ); + sal_uInt16 GetPageCount() const; const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const; diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 38250fe7f28d..d2b45b37d234 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -31,14 +31,24 @@ #ifndef _SWPRTOPT_HXX #define _SWPRTOPT_HXX +#include #include #include +#include +#include +#include + #define POSTITS_NONE 0 #define POSTITS_ONLY 1 #define POSTITS_ENDDOC 2 #define POSTITS_ENDPAGE 3 + +class SwPageFrm; + +//////////////////////////////////////////////////////////// + class SwPrtOptions : public SwPrintData { USHORT nJobNo; @@ -83,6 +93,36 @@ public: }; +//////////////////////////////////////////////////////////// + +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ + OutputDevice* mpLast; + + // pages valid for printing (accoridng to the current settings) + // and their respective start frames (see getRendererCount in unotxdoc.cxx) + std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages + + // vector of pages and their order to be printed (duplicates and any order allowed!) + // (see 'render' in unotxdoc.cxx) + std::vector< sal_Int32 > aPagesToPrint; + +public: + SwPrintUIOptions( BOOL bWeb ); + + bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; + + std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } + ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } + const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } + const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } +}; + + #endif //_SWPRTOPT_HXX diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 5a249db26337..dbbeec0e7d8e 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -71,6 +71,7 @@ class SfxViewShell; class SwViewOption; class SwViewImp; class SwPrtOptions; +class SwPrintUIOptions; class SwPagePreViewPrtData; class Window; class OutputDevice; @@ -364,8 +365,9 @@ public: //Druckauftrag abwickeln. // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool Prt( OutputDevice* pOutDev, SwPrtOptions& rOptions, SfxProgress* pProgress, - bool bIsPDFExport = false ); + sal_Bool Prt( OutputDevice* pOutDev, SwPrtOptions& rOptions, + const SwPrintUIOptions &rPrintUIOptions, sal_Int32 nRenderer /* offset in vector of pages to print */, + SfxProgress* pProgress, bool bIsPDFExport = false ); //"Drucken" fuer OLE 2.0 static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, -- cgit From e7200b2b026e535228b1fa27d4ab450b8125f2fd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 28 Jul 2009 09:43:30 +0000 Subject: #i101242# fixed crashwhen printing the page preview with new print UI --- sw/inc/unotxdoc.hxx | 441 ++++++++++++++++++++++++++-------------------------- 1 file changed, 222 insertions(+), 219 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 50851a31e945..7b81a0ce191b 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +116,8 @@ public Ifc31 __DEF_IMPLHELPER_EX( 31 ) +namespace css = ::com::sun::star; + class SwDoc; class SwDocShell; class UnoActionContext; @@ -135,37 +138,37 @@ SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) typedef cppu::WeakImplHelper31 < - ::com::sun::star::text::XTextDocument, - ::com::sun::star::text::XLineNumberingProperties, - ::com::sun::star::text::XChapterNumberingSupplier, - ::com::sun::star::text::XNumberingRulesSupplier, - ::com::sun::star::text::XFootnotesSupplier, - ::com::sun::star::text::XEndnotesSupplier, - ::com::sun::star::util::XReplaceable, - ::com::sun::star::text::XPagePrintable, - ::com::sun::star::text::XReferenceMarksSupplier, - ::com::sun::star::text::XTextTablesSupplier, - ::com::sun::star::text::XTextFramesSupplier, - ::com::sun::star::text::XBookmarksSupplier, - ::com::sun::star::text::XTextSectionsSupplier, - ::com::sun::star::text::XTextGraphicObjectsSupplier, - ::com::sun::star::text::XTextEmbeddedObjectsSupplier, - ::com::sun::star::text::XTextFieldsSupplier, - ::com::sun::star::style::XStyleFamiliesSupplier, - ::com::sun::star::style::XAutoStylesSupplier, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::drawing::XDrawPageSupplier, - ::com::sun::star::text::XDocumentIndexesSupplier, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::document::XLinkTargetSupplier, - ::com::sun::star::document::XRedlinesSupplier, - ::com::sun::star::util::XRefreshable, - ::com::sun::star::util::XLinkUpdate, - ::com::sun::star::view::XRenderable, - ::com::sun::star::xforms::XFormsSupplier, - ::com::sun::star::text::XFlatParagraphIteratorProvider, - ::com::sun::star::document::XDocumentLanguages + css::text::XTextDocument, + css::text::XLineNumberingProperties, + css::text::XChapterNumberingSupplier, + css::text::XNumberingRulesSupplier, + css::text::XFootnotesSupplier, + css::text::XEndnotesSupplier, + css::util::XReplaceable, + css::text::XPagePrintable, + css::text::XReferenceMarksSupplier, + css::text::XTextTablesSupplier, + css::text::XTextFramesSupplier, + css::text::XBookmarksSupplier, + css::text::XTextSectionsSupplier, + css::text::XTextGraphicObjectsSupplier, + css::text::XTextEmbeddedObjectsSupplier, + css::text::XTextFieldsSupplier, + css::style::XStyleFamiliesSupplier, + css::style::XAutoStylesSupplier, + css::lang::XServiceInfo, + css::drawing::XDrawPageSupplier, + css::text::XDocumentIndexesSupplier, + css::beans::XPropertySet, + css::beans::XPropertyState, + css::document::XLinkTargetSupplier, + css::document::XRedlinesSupplier, + css::util::XRefreshable, + css::util::XLinkUpdate, + css::view::XRenderable, + css::xforms::XFormsSupplier, + css::text::XFlatParagraphIteratorProvider, + css::document::XDocumentLanguages > SwXTextDocumentBaseClass; @@ -182,39 +185,39 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, sal_Bool bObjectValid; SwXDrawPage* pDrawPage; - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > * pxXDrawPage; + css::uno::Reference< css::drawing::XDrawPage > * pxXDrawPage; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xBodyText; + css::uno::Reference< css::text::XText > xBodyText; SwXBodyText* pBodyText; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > xNumFmtAgg; - - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXNumberingRules; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXFootnotes; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXFootnoteSettings; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXEndnotes; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXEndnoteSettings; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXReferenceMarks; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > * pxXTextFieldTypes; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFieldMasters; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextSections; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXBookmarks; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextTables; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXTextFrames; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXGraphicObjects; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXEmbeddedObjects; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxXStyleFamilies; - mutable ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyles > * pxXAutoStyles; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > * pxXChapterNumbering; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > * pxXDocumentIndexes; - - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > * pxXLineNumberingProperties; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > * pxLinkTargetSupplier; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >* pxXRedlines; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer> xXFormsContainer; + css::uno::Reference< css::uno::XAggregation > xNumFmtAgg; + + css::uno::Reference< css::container::XIndexAccess > * pxXNumberingRules; + css::uno::Reference< css::container::XIndexAccess > * pxXFootnotes; + css::uno::Reference< css::beans::XPropertySet > * pxXFootnoteSettings; + css::uno::Reference< css::container::XIndexAccess > * pxXEndnotes; + css::uno::Reference< css::beans::XPropertySet > * pxXEndnoteSettings; + css::uno::Reference< css::container::XNameAccess > * pxXReferenceMarks; + css::uno::Reference< css::container::XEnumerationAccess > * pxXTextFieldTypes; + css::uno::Reference< css::container::XNameAccess > * pxXTextFieldMasters; + css::uno::Reference< css::container::XNameAccess > * pxXTextSections; + css::uno::Reference< css::container::XNameAccess > * pxXBookmarks; + css::uno::Reference< css::container::XNameAccess > * pxXTextTables; + css::uno::Reference< css::container::XNameAccess > * pxXTextFrames; + css::uno::Reference< css::container::XNameAccess > * pxXGraphicObjects; + css::uno::Reference< css::container::XNameAccess > * pxXEmbeddedObjects; + css::uno::Reference< css::container::XNameAccess > * pxXStyleFamilies; + mutable css::uno::Reference< css::style::XAutoStyles > * pxXAutoStyles; + css::uno::Reference< css::container::XIndexReplace > * pxXChapterNumbering; + css::uno::Reference< css::container::XIndexAccess > * pxXDocumentIndexes; + + css::uno::Reference< css::beans::XPropertySet > * pxXLineNumberingProperties; + css::uno::Reference< css::container::XNameAccess > * pxLinkTargetSupplier; + css::uno::Reference< css::container::XEnumerationAccess >* pxXRedlines; + css::uno::Reference< css::container::XNameContainer> xXFormsContainer; //temporary frame to enable PDF export if no valid view is available SfxViewFrame* m_pHiddenViewFrame; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xPropertyHelper; + css::uno::Reference< css::uno::XInterface> xPropertyHelper; SwXDocumentPropertyHelper* pPropertyHelper; SwPrintUIOptions* m_pPrintUIOptions; @@ -223,8 +226,8 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, void GetNumberFormatter(); // used for XRenderable implementation - SfxViewShell * GuessViewShell(); - SwDoc * GetRenderDoc( SfxViewShell *&rpView, const ::com::sun::star::uno::Any& rSelection, bool bIsPDFExport ); + SfxViewShell * GuessViewShell( const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() ); + SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport ); rtl::OUString maBuildId; @@ -237,173 +240,173 @@ public: SwXTextDocument(SwDocShell* pShell); inline void notifyRefreshListeners() { aRefreshCont.Refreshed(); } - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException); virtual void SAL_CALL acquire( ) throw(); virtual void SAL_CALL release( ) throw(); //XWeak - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAdapter > SAL_CALL queryAdapter( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter( ) throw(css::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException); - SW_DLLPUBLIC static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + SW_DLLPUBLIC static const css::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); + virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException); //XTextDocument - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL reformat(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::text::XText > SAL_CALL getText(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL reformat(void) throw( css::uno::RuntimeException ); //XModel - virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw(::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL lockControllers( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL unlockControllers( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) throw(css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getURL( ) throw(css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException); + virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException); + virtual void SAL_CALL lockControllers( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL unlockControllers( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasControllersLocked( ) throw(css::uno::RuntimeException); + virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::container::NoSuchElementException, css::uno::RuntimeException); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection( ) throw(css::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 ); + virtual void SAL_CALL dispose(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException ); //XCloseable - virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException); //XLineNumberingProperties - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( css::uno::RuntimeException ); //XChapterNumberingSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SAL_CALL getChapterNumberingRules(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexReplace > SAL_CALL getChapterNumberingRules(void) throw( css::uno::RuntimeException ); //XNumberingRulesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getNumberingRules() throw (::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getNumberingRules() throw (css::uno::RuntimeException); //XFootnotesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getFootnotes(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getFootnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getFootnotes(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getFootnoteSettings(void) throw( css::uno::RuntimeException ); //XEndnotesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getEndnotes(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getEndnoteSettings(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getEndnotes(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getEndnoteSettings(void) throw( css::uno::RuntimeException ); //XReplaceable - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Int32 SAL_CALL replaceAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor(void) throw( css::uno::RuntimeException ); + virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); //XSearchable - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > SAL_CALL createSearchDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL findAll(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findFirst(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL findNext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xStartAt, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::util::XSearchDescriptor > SAL_CALL createSearchDescriptor(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findNext(const css::uno::Reference< css::uno::XInterface > & xStartAt, const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException ); //XPagePrintable - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setPagePrintSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aSettings) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL printPages(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL setPagePrintSettings(const css::uno::Sequence< css::beans::PropertyValue >& aSettings) throw( css::uno::RuntimeException ); + virtual void SAL_CALL printPages(const css::uno::Sequence< css::beans::PropertyValue >& xOptions) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); //XReferenceMarksSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getReferenceMarks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getReferenceMarks(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextFieldsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getTextFields(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFieldMasters(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextFieldsSupplier + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getTextFields(void) throw( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFieldMasters(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextEmbeddedObjectsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getEmbeddedObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextEmbeddedObjectsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getEmbeddedObjects(void) throw( css::uno::RuntimeException ); -// // ::com::sun::star::text::XTextShapesSupplier -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > getShapes(void) throw( ::com::sun::star::uno::RuntimeException ); +// // css::text::XTextShapesSupplier +// virtual css::uno::Reference< css::container::XIndexAccess > getShapes(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XBookmarksSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getBookmarks(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XBookmarksSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getBookmarks(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextSectionsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextSections(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextSectionsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextSections(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextTablesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextTables(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextTablesSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextTables(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextGraphicObjectsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGraphicObjects(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextGraphicObjectsSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGraphicObjects(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XTextFramesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTextFrames(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XTextFramesSupplier + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFrames(void) throw( css::uno::RuntimeException ); //XStyleFamiliesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getStyleFamilies(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getStyleFamilies(void) throw( css::uno::RuntimeException ); //XAutoStylesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyles > SAL_CALL getAutoStyles( ) throw (::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::style::XAutoStyles > SAL_CALL getAutoStyles( ) throw (css::uno::RuntimeException); //XMultiServiceFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier) - throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) - throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) - throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier) + throw( css::uno::Exception, css::uno::RuntimeException ); + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier, + const css::uno::Sequence< css::uno::Any >& Arguments) + throw( css::uno::Exception, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) + throw( css::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 ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::drawing::XDrawPageSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SAL_CALL getDrawPage(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::drawing::XDrawPageSupplier + virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage(void) throw( css::uno::RuntimeException ); - // ::com::sun::star::text::XDocumentIndexesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getDocumentIndexes(void) throw( ::com::sun::star::uno::RuntimeException ); + // css::text::XDocumentIndexesSupplier + virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDocumentIndexes(void) throw( css::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); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual css::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XLinkTargetSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks(void) throw( css::uno::RuntimeException ); //XRedlinesSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL getRedlines( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getRedlines( ) throw(css::uno::RuntimeException); - // ::com::sun::star::util::XRefreshable - virtual void SAL_CALL refresh(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener > & l) throw( ::com::sun::star::uno::RuntimeException ); + // css::util::XRefreshable + virtual void SAL_CALL refresh(void) throw( css::uno::RuntimeException ); + virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException ); + virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException ); - // ::com::sun::star::util::XLinkUpdate, - virtual void SAL_CALL updateLinks( ) throw(::com::sun::star::uno::RuntimeException); + // css::util::XLinkUpdate, + virtual void SAL_CALL updateLinks( ) throw(css::uno::RuntimeException); - // ::com::sun::star::view::XRenderable - virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& aSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // css::view::XRenderable + virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - // ::com::sun::star::xforms::XFormsSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getXForms( ) throw (::com::sun::star::uno::RuntimeException); + // css::xforms::XFormsSupplier + virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getXForms( ) throw (css::uno::RuntimeException); - // ::com::sun::star::document::XDocumentLanguages - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + // css::document::XDocumentLanguages + virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - // ::com::sun::star::text::XFlatParagraphIteratorProvider: - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (::com::sun::star::uno::RuntimeException); + // css::text::XFlatParagraphIteratorProvider: + virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (css::uno::RuntimeException); // void Invalidate(); @@ -413,11 +416,11 @@ public: void InitNewDoc(); - SwUnoCrsr* CreateCursorForSearch(::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr); - SwUnoCrsr* FindAny(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & xDesc, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & xCrsr, sal_Bool bAll, + SwUnoCrsr* CreateCursorForSearch(css::uno::Reference< css::text::XTextCursor > & xCrsr); + SwUnoCrsr* FindAny(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc, + css::uno::Reference< css::text::XTextCursor > & xCrsr, sal_Bool bAll, sal_Int32& nResult, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xLastResult); + css::uno::Reference< css::uno::XInterface > xLastResult); SwXDrawPage* GetDrawPage(); SwDocShell* GetDocShell() {return pDocShell;} @@ -431,8 +434,8 @@ public: --------------------------------------------------*/ class SwXLinkTargetSupplier : public cppu::WeakImplHelper2 < - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XServiceInfo + css::container::XNameAccess, + css::lang::XServiceInfo > { SwXTextDocument* pxDoc; @@ -449,18 +452,18 @@ public: ~SwXLinkTargetSupplier(); //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 ); + virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::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); + virtual css::uno::Type SAL_CALL getElementType( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(css::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 ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); // void Invalidate() {pxDoc = 0;} @@ -470,52 +473,52 @@ public: --------------------------------------------------*/ class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4 < - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XLinkTargetSupplier + css::beans::XPropertySet, + css::container::XNameAccess, + css::lang::XServiceInfo, + css::document::XLinkTargetSupplier > { - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xRealAccess; + css::uno::Reference< css::container::XNameAccess > xRealAccess; const SfxItemPropertySet* pPropSet; const String sLinkSuffix; const String sLinkDisplayName; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xDoc; + css::uno::Reference< css::text::XTextDocument > xDoc; SwXTextDocument* pxDoc; public: - SwXLinkNameAccessWrapper(::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xAccess, + SwXLinkNameAccessWrapper(css::uno::Reference< css::container::XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix); SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, const String& rLinkDisplayName, String sSuffix); ~SwXLinkNameAccessWrapper(); //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 ); + virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::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); + virtual css::uno::Type SAL_CALL getElementType( ) throw(css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements( ) throw(css::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); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); //XLinkTargetSupplier - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getLinks(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLinks(void) throw( css::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 ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); }; /* -----------------26.10.99 15:46------------------- @@ -523,8 +526,8 @@ public: --------------------------------------------------*/ class SwXOutlineTarget : public cppu::WeakImplHelper2 < - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo + css::beans::XPropertySet, + css::lang::XServiceInfo > { const SfxItemPropertySet* pPropSet; @@ -535,36 +538,36 @@ public: ~SwXOutlineTarget(); //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); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::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 ); + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException ); }; #endif class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable { - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xDashTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xGradientTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xHatchTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xBitmapTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xTransGradientTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xMarkerTable; - com::sun::star::uno::Reference < com::sun::star::uno::XInterface > xDrawDefaults; + css::uno::Reference < css::uno::XInterface > xDashTable; + css::uno::Reference < css::uno::XInterface > xGradientTable; + css::uno::Reference < css::uno::XInterface > xHatchTable; + css::uno::Reference < css::uno::XInterface > xBitmapTable; + css::uno::Reference < css::uno::XInterface > xTransGradientTable; + css::uno::Reference < css::uno::XInterface > xMarkerTable; + css::uno::Reference < css::uno::XInterface > xDrawDefaults; SwDoc* m_pDoc; public: SwXDocumentPropertyHelper(SwDoc& rDoc); ~SwXDocumentPropertyHelper(); - com::sun::star::uno::Reference GetDrawTable(short nWhich); + css::uno::Reference GetDrawTable(short nWhich); void Invalidate(); virtual void onChange(); -- cgit From bbca31dd7f98e9e1c7f79be366191f7d39430877 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Tue, 28 Jul 2009 19:03:24 +0000 Subject: #i92518# adapt UI spec --- sw/inc/swprtopt.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sw/inc') diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index d2b45b37d234..b8a48d678f1a 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -120,6 +120,8 @@ public: const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } + bool isPrintLeftPages() const; + bool isPrintRightPages() const; }; -- cgit From 3c93e8d423b0f7c3f448fd1e7ccf06fce0b307cd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 29 Jul 2009 09:01:57 +0000 Subject: #i101242# print-preview toolbar changes --- sw/inc/cmdid.h | 1 - 1 file changed, 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 1fab6f1d15d4..8d56735d17a9 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -324,7 +324,6 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_GLOBAL_OPEN (FN_VIEW + 47) /* oeffnen */ #define FN_GLOBAL_SAVE_CONTENT (FN_VIEW + 48) /* Inhalt der Verknuepfung mitspeichern */ #define FN_CREATE_NAVIGATION (FN_VIEW + 49) /* Navigations-Controller erzeugen */ -#define FN_PREVIEW_PRINT_OPTIONS (FN_VIEW + 50) /* Optionsdialog Preview drucken */ #define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* der Tabellencontroller fuer den Zoom */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Zahlenerkennung in Tabellen */ -- cgit From 89b70cad0e882861714d7a158c21a1fceca921a1 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 4 Aug 2009 09:27:27 +0000 Subject: #i103991# fixed crash --- sw/inc/rolbck.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index 6dd6a90ad640..63bd174830af 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -160,8 +160,11 @@ public: class SwHistorySetTxtFld : public SwHistoryHint { - const ::std::auto_ptr m_pFld; + //!! beware of the order for the declation of thje auto_ptrs. + //!! If they get destroyed in the wrong order sw may crash (namely mail-merge as well) ::std::auto_ptr m_pFldType; + const ::std::auto_ptr m_pFld; + ULONG m_nNodeIndex; xub_StrLen m_nPos; USHORT m_nFldWhich; -- cgit From c195e304f8df070971e77038a17ea3e09f1fbd36 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 4 Aug 2009 12:13:41 +0000 Subject: #i101242# new print UI --- sw/inc/dbfld.hxx | 1 + sw/inc/doc.hxx | 2 +- sw/inc/swprtopt.hxx | 21 ++++----------------- 3 files changed, 6 insertions(+), 18 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx index 9b61f001ed12..9adb2eb688a5 100644 --- a/sw/inc/dbfld.hxx +++ b/sw/inc/dbfld.hxx @@ -52,6 +52,7 @@ class SW_DLLPUBLIC SwDBFieldType : public SwValueFieldType public: SwDBFieldType(SwDoc* pDocPtr, const String& rColumnName, const SwDBData& rDBData); + ~SwDBFieldType(); virtual const String& GetName() const; virtual SwFieldType* Copy() const; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 98aabe79c01a..d0d18f1043b7 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1335,7 +1335,7 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void GetValidPagesForPrinting( SwPrintUIOptions &rPrintUIOptions, + void GetValidPagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rPrintUIOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index b8a48d678f1a..741e2d7618f8 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -115,9 +115,10 @@ public: typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; - std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } - ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } - const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } + const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } + ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } + const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } bool isPrintLeftPages() const; @@ -127,17 +128,3 @@ public: #endif //_SWPRTOPT_HXX - - - - - - - - - - - - - - -- cgit From 063c55820f1f7b21f2999d9a5f8a0e18078c3f32 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 6 Aug 2009 12:40:39 +0000 Subject: #i92516# Fix mail merge with new printing function. Don't set SID_ASYNCHRON to true for normal mail merge operations --- sw/inc/dbmgr.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 0c359bd05cdb..9e13058e90e6 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -184,7 +184,7 @@ struct SwMergeDescriptor rDescriptor(rDesc), bSendAsHTML( sal_True ), bSendAsAttachment( sal_False ), - bPrintAsync( sal_True ), + bPrintAsync( sal_False ), bCreateSingleFile( sal_False ), pMailMergeConfigItem(0) {} -- cgit From 278729a448d7e56c426229325a960f08c38fafbc Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 7 Aug 2009 14:42:45 +0000 Subject: #i103991# prospect printing --- sw/inc/doc.hxx | 4 +++- sw/inc/swprtopt.hxx | 22 ++++++++++++++++++---- sw/inc/viewsh.hxx | 15 +++++++++------ 3 files changed, 30 insertions(+), 11 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d0d18f1043b7..2b1937f2912e 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1335,7 +1335,9 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void GetValidPagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rPrintUIOptions, + void CalculatePagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rPrintUIOptions, + sal_Int32 nDocPageCount ); + void CalculatePagePairsForProspectPrinting( SwPrintUIOptions &rPrintUIOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 741e2d7618f8..53b00bff4f07 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -38,6 +38,7 @@ #include #include #include +#include #define POSTITS_NONE 0 #define POSTITS_ONLY 1 @@ -99,8 +100,9 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper { OutputDevice* mpLast; - // pages valid for printing (accoridng to the current settings) + // pages valid for printing (according to the current settings) // and their respective start frames (see getRendererCount in unotxdoc.cxx) + // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages @@ -108,21 +110,33 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper // (see 'render' in unotxdoc.cxx) std::vector< sal_Int32 > aPagesToPrint; + // for prospect printing: the pairs of pages to be printed together on a single prospect page. + // -1 indicates a half page to be left empty. + std::vector< std::pair< sal_Int32, sal_Int32 > > aPagePairs; + public: SwPrintUIOptions( BOOL bWeb ); bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); - typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; + typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + + // used for 'normal' printing std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } - bool isPrintLeftPages() const; - bool isPrintRightPages() const; + + // used for prospect printing only + PagePairsVec_t & GetPagePairsForProspectPrinting() { return aPagePairs; } + const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return aPagePairs; } + + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; }; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index dbbeec0e7d8e..007fc7c05ed3 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -365,9 +365,15 @@ public: //Druckauftrag abwickeln. // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool Prt( OutputDevice* pOutDev, SwPrtOptions& rOptions, - const SwPrintUIOptions &rPrintUIOptions, sal_Int32 nRenderer /* offset in vector of pages to print */, - SfxProgress* pProgress, bool bIsPDFExport = false ); + sal_Bool PrintOrPDFExport( OutputDevice* pOutDev, SwPrtOptions& rOptions, + const SwPrintUIOptions &rPrintUIOptions, + sal_Int32 nRenderer, /* offset in vector of pages to print */ + bool bIsPDFExport = sal_False ); + + // Prospekt-Format drucken + void PrintProspect( OutputDevice* pOutDev, SwPrtOptions& rOptions, + const SwPrintUIOptions &rPrintUIOptions, + sal_Int32 nRenderer /* offset in vector of page pairs for prospect */ ); //"Drucken" fuer OLE 2.0 static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, @@ -483,9 +489,6 @@ public: SfxProgress& rProgress, const SwPagePreViewPrtData* = 0 ); - // Prospekt-Format drucken - void PrintProspect( SwPrtOptions&, SfxProgress& , BOOL bRTL); - sal_Bool IsViewLocked() const { return bViewLocked; } void LockView( sal_Bool b ) { bViewLocked = b; } -- cgit From a6e4f39c82a75fb2684d3563b9c2a7af3518d2bc Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 14 Aug 2009 13:56:56 +0000 Subject: #i101242# new print UI --- sw/inc/IDocumentDeviceAccess.hxx | 2 +- sw/inc/doc.hxx | 9 +++-- sw/inc/printdata.hxx | 79 +++++++++++++++++++++++++++++++++++++++- sw/inc/swprtopt.hxx | 48 +----------------------- sw/inc/unomod.hxx | 2 +- sw/inc/unotxdoc.hxx | 9 +++-- sw/inc/viewsh.hxx | 36 ++++++++++++------ 7 files changed, 116 insertions(+), 69 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/IDocumentDeviceAccess.hxx b/sw/inc/IDocumentDeviceAccess.hxx index 30e698e74d70..fbfdd82d001b 100755 --- a/sw/inc/IDocumentDeviceAccess.hxx +++ b/sw/inc/IDocumentDeviceAccess.hxx @@ -33,7 +33,7 @@ class SfxPrinter; class JobSetup; - struct SwPrintData; + class SwPrintData; class VirtualDevice; class OutputDevice; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 2b1937f2912e..d2ec00c8ad0c 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -208,7 +208,8 @@ struct SwDocStat; struct SwHash; struct SwSortOptions; struct SwDefTOXBase_Impl; -struct SwPrintData; +class SwPrintData; +class SwPrintUIOptions; class SdrPageView; struct SwConversionArgs; class SwRewriter; @@ -216,7 +217,7 @@ class SwMsgPoolItem; class SwChartDataProvider; class SwChartLockController_Helper; class IGrammarContact; -class SwPrintUIOptions; +class SwPrintData; class SwPageFrm; namespace sw { namespace mark { @@ -1335,9 +1336,9 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void CalculatePagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rPrintUIOptions, + void CalculatePagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); - void CalculatePagePairsForProspectPrinting( SwPrintUIOptions &rPrintUIOptions, + void CalculatePagePairsForProspectPrinting( SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 1a6547ab540e..3ff07102733a 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -33,9 +33,75 @@ #include #include +#include -struct SwPrintData +#include +#include +#include +#include + +class SwPageFrm; + +//////////////////////////////////////////////////////////// + +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ + OutputDevice* m_pLast; + + // pages valid for printing (according to the current settings) + // and their respective start frames (see getRendererCount in unotxdoc.cxx) + // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! + std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages + + // vector of pages and their order to be printed (duplicates and any order allowed!) + // (see 'render' in unotxdoc.cxx) + std::vector< sal_Int32 > aPagesToPrint; + + // for prospect printing: the pairs of pages to be printed together on a single prospect page. + // -1 indicates a half page to be left empty. + std::vector< std::pair< sal_Int32, sal_Int32 > > aPagePairs; + +public: + SwPrintUIOptions( BOOL bWeb = FALSE ); + ~SwPrintUIOptions(); + + bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; + typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; + + std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } + const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } + ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } + const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + + // used for 'normal' printing + std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } + const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } + + // used for prospect printing only + PagePairsVec_t & GetPagePairsForProspectPrinting() { return aPagePairs; } + const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return aPagePairs; } + + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; +}; + + +//////////////////////////////////////////////////////////// + + +class SwPrintData { + const SwPrintUIOptions * m_pPrintUIOptions; + +public: + sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground, bPrintBlackFont, //#i81434# - printing of hidden text @@ -55,6 +121,8 @@ struct SwPrintData SwPrintData() { + m_pPrintUIOptions = NULL; + bPrintGraphic = bPrintTable = bPrintDraw = @@ -103,6 +171,12 @@ struct SwPrintData bPrintHiddenText == rData.bPrintHiddenText && bPrintTextPlaceholder == rData.bPrintTextPlaceholder; } + + // Note: int the conntext where this class ist used the pointer should always be valid + // during the lifetime of this object + const SwPrintUIOptions & GetPrintUIOptions() const { return *m_pPrintUIOptions; } + void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } + sal_Bool IsPrintGraphic() const { return bPrintGraphic; } sal_Bool IsPrintTable() const { return bPrintTable; } sal_Bool IsPrintDraw() const { return bPrintDraw; } @@ -139,8 +213,11 @@ struct SwPrintData void SetFaxName(const rtl::OUString& rSet){sFaxName = rSet;} void SetPrintHiddenText(sal_Bool b){ doSetModified(); bPrintHiddenText = b;} void SetPrintTextPlaceholder(sal_Bool b){ doSetModified(); bPrintTextPlaceholder = b;} + virtual void doSetModified () { bModified = sal_True;} }; +//////////////////////////////////////////////////////////// + #endif //_SW_PRINTDATA_HXX diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 53b00bff4f07..86bcefa5d455 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -31,7 +31,6 @@ #ifndef _SWPRTOPT_HXX #define _SWPRTOPT_HXX -#include #include #include @@ -46,10 +45,9 @@ #define POSTITS_ENDPAGE 3 -class SwPageFrm; - //////////////////////////////////////////////////////////// + class SwPrtOptions : public SwPrintData { USHORT nJobNo; @@ -96,49 +94,5 @@ public: //////////////////////////////////////////////////////////// -class SwPrintUIOptions : public vcl::PrinterOptionsHelper -{ - OutputDevice* mpLast; - - // pages valid for printing (according to the current settings) - // and their respective start frames (see getRendererCount in unotxdoc.cxx) - // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! - std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) - std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages - - // vector of pages and their order to be printed (duplicates and any order allowed!) - // (see 'render' in unotxdoc.cxx) - std::vector< sal_Int32 > aPagesToPrint; - - // for prospect printing: the pairs of pages to be printed together on a single prospect page. - // -1 indicates a half page to be left empty. - std::vector< std::pair< sal_Int32, sal_Int32 > > aPagePairs; - -public: - SwPrintUIOptions( BOOL bWeb ); - - bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); - - typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; - typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; - - std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } - const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } - ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } - const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } - - // used for 'normal' printing - std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } - const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } - - // used for prospect printing only - PagePairsVec_t & GetPagePairsForProspectPrinting() { return aPagePairs; } - const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return aPagePairs; } - - bool IsPrintLeftPages() const; - bool IsPrintRightPages() const; -}; - - #endif //_SWPRTOPT_HXX diff --git a/sw/inc/unomod.hxx b/sw/inc/unomod.hxx index dcb2f9cfcbda..0f46a92f323e 100644 --- a/sw/inc/unomod.hxx +++ b/sw/inc/unomod.hxx @@ -45,7 +45,7 @@ class SwView; class SwViewOption; -struct SwPrintData; +class SwPrintData; class SwDoc; /****************************************************************************** diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 7b81a0ce191b..7292ce74fcff 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -127,6 +127,7 @@ class SwUnoCrsr; class SwXDocumentPropertyHelper; class SfxViewFrame; class SwPrintUIOptions; +class SwPrintData; typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) @@ -216,11 +217,11 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, css::uno::Reference< css::container::XNameContainer> xXFormsContainer; //temporary frame to enable PDF export if no valid view is available - SfxViewFrame* m_pHiddenViewFrame; - css::uno::Reference< css::uno::XInterface> xPropertyHelper; - SwXDocumentPropertyHelper* pPropertyHelper; + SfxViewFrame* m_pHiddenViewFrame; + css::uno::Reference< css::uno::XInterface> xPropertyHelper; + SwXDocumentPropertyHelper* pPropertyHelper; - SwPrintUIOptions* m_pPrintUIOptions; + SwPrintUIOptions* m_pPrintUIOprions; void GetBodyText(); void GetNumberFormatter(); diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 007fc7c05ed3..9e4f89fb1134 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -71,7 +71,7 @@ class SfxViewShell; class SwViewOption; class SwViewImp; class SwPrtOptions; -class SwPrintUIOptions; +class SwPrintData; class SwPagePreViewPrtData; class Window; class OutputDevice; @@ -94,12 +94,19 @@ class SwPostItMgr; // #i74769# class SdrPaintWindow; +namespace vcl +{ + class PrinterController; +}; + + //JP 19.07.98: - Bug 52312 // define fuer Flags, die im CTOR oder den darunter liegenden Schichten // benoetigt werden. // Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt #define VSHELLFLAG_ISPREVIEW ((long)0x1) + class SW_DLLPUBLIC ViewShell : public Ring { friend void SetOutDev( ViewShell *pSh, OutputDevice *pOut ); @@ -188,7 +195,7 @@ class SW_DLLPUBLIC ViewShell : public Ring SW_DLLPRIVATE void Scroll(); //Scrollen wenn sich aus der LayAction Scrollmoeglichkeiten //ergaben. - SW_DLLPRIVATE void PrepareForPrint( const SwPrtOptions &rOptions ); + SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions ); SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt ); @@ -363,20 +370,27 @@ public: void ChgAllPageOrientation( sal_uInt16 eOri ); void ChgAllPageSize( Size &rSz ); - //Druckauftrag abwickeln. + // printing of one page. // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool PrintOrPDFExport( OutputDevice* pOutDev, SwPrtOptions& rOptions, - const SwPrintUIOptions &rPrintUIOptions, + sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, sal_Int32 nRenderer, /* offset in vector of pages to print */ bool bIsPDFExport = sal_False ); - // Prospekt-Format drucken - void PrintProspect( OutputDevice* pOutDev, SwPrtOptions& rOptions, - const SwPrintUIOptions &rPrintUIOptions, - sal_Int32 nRenderer /* offset in vector of page pairs for prospect */ ); + // printing of one brochure page + void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, + sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ ); + + // printing of a complete document for mail merge + // bIsPDFExport == true is: do PDF Export (no printing!) + sal_Bool PrintOrPDFExportMM( const boost::shared_ptr< vcl::PrinterController > & rpPrinterController, + const SwPrtOptions &rPrintData, bool bIsPDFExport = sal_False ); + + // printing of a complete brochure for mail merge + void PrintProspectMM( const boost::shared_ptr< vcl::PrinterController > & rpPrinterController, + const SwPrintData &rPrintData, bool bProspectRTL ); - //"Drucken" fuer OLE 2.0 - static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, SwPrtOptions& rOptions, + // printing for OLE 2.0 + static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions, OutputDevice* pOleOut, const Rectangle& rRect ); // creates temporary doc with selected text for PDF export -- cgit From 31c68b3b56ce4ffc1649fe83dd3f1dca97eb7551 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 14 Aug 2009 14:00:36 +0000 Subject: #i101242# new print UI --- sw/inc/viewsh.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 9e4f89fb1134..350a095b6a69 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -97,7 +97,7 @@ class SdrPaintWindow; namespace vcl { class PrinterController; -}; +} //JP 19.07.98: - Bug 52312 -- cgit From 41de88368a73475ba75c0fd47974f5fefdff2aaf Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Sat, 15 Aug 2009 16:55:10 +0000 Subject: #i92516# move solar.hrc to vcl --- sw/inc/helpid.h | 2 +- sw/inc/pch/precompiled_sw.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index f709c95038f0..dca700fbb8b6 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -28,7 +28,7 @@ * ************************************************************************/ #ifndef _SOLAR_HRC -#include +#include #endif #define HID_BASE HID_APP_START diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index fc62291e85c7..a95604e32b0f 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -679,7 +679,7 @@ #include "svtools/slstitm.hxx" #include "svtools/smplhint.hxx" #include "svtools/soerr.hxx" -#include "svtools/solar.hrc" +#include "vcl/solar.hrc" #include "svtools/sourceviewconfig.hxx" #include "svtools/stdctrl.hxx" #include "svtools/stritem.hxx" -- cgit From 84d95bba0af714d81a889c6eb194d3e4ed21fa21 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 17 Aug 2009 09:18:18 +0000 Subject: #i101242# new print UI --- sw/inc/unotxdoc.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 7292ce74fcff..216516d0d879 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -221,7 +221,7 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, css::uno::Reference< css::uno::XInterface> xPropertyHelper; SwXDocumentPropertyHelper* pPropertyHelper; - SwPrintUIOptions* m_pPrintUIOprions; + SwPrintUIOptions* m_pPrintUIOptions; void GetBodyText(); void GetNumberFormatter(); -- cgit From 00eb1cf049970426333503731f6102909555b484 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 19 Aug 2009 07:32:06 +0000 Subject: #i101242# new print UI --- sw/inc/viewsh.hxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 350a095b6a69..1e09bbde33de 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -96,7 +96,7 @@ class SdrPaintWindow; namespace vcl { - class PrinterController; + class OldStylePrintAdaptor; } @@ -382,11 +382,13 @@ public: // printing of a complete document for mail merge // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool PrintOrPDFExportMM( const boost::shared_ptr< vcl::PrinterController > & rpPrinterController, + sal_Bool PrintOrPDFExportMM( vcl::OldStylePrintAdaptor &rAdaptor, + const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &rOptions, const SwPrtOptions &rPrintData, bool bIsPDFExport = sal_False ); // printing of a complete brochure for mail merge - void PrintProspectMM( const boost::shared_ptr< vcl::PrinterController > & rpPrinterController, + void PrintProspectMM( vcl::OldStylePrintAdaptor &rAdaptor, + const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &rOptions, const SwPrintData &rPrintData, bool bProspectRTL ); // printing for OLE 2.0 -- cgit From 9e095aec061c14b180f88bd5d7b2ea6bef19d4f9 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 21 Aug 2009 06:14:34 +0000 Subject: #i101242# new print UI in sw --- sw/inc/doc.hxx | 7 +++-- sw/inc/printdata.hxx | 73 +++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 20 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d2ec00c8ad0c..b9726a08ee4b 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -219,6 +219,7 @@ class SwChartLockController_Helper; class IGrammarContact; class SwPrintData; class SwPageFrm; +class SwViewOption; namespace sw { namespace mark { class MarkManager; @@ -1336,9 +1337,11 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void CalculatePagesForPrinting( bool bIsPDFExport, SwPrintUIOptions &rOptions, + void CalculatePagesForPrinting( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); - void CalculatePagePairsForProspectPrinting( SwPrintUIOptions &rOptions, + void UpdatePagesForPrintingWithPostItData( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, + sal_Int32 nDocPageCount ); + void CalculatePagePairsForProspectPrinting( /* out */ SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 3ff07102733a..ed463a6cb28c 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -41,6 +41,12 @@ #include class SwPageFrm; +class SwDoc; +class ViewShell; +class _SetGetExpFlds; +class SwViewOption; +class OutputDevice; + //////////////////////////////////////////////////////////// @@ -51,16 +57,28 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper // pages valid for printing (according to the current settings) // and their respective start frames (see getRendererCount in unotxdoc.cxx) // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! - std::set< sal_Int32 > aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) - std::map< sal_Int32, const SwPageFrm * > aValidStartFrms; // the map of start frames for those pages + std::set< sal_Int32 > m_aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > m_aValidStartFrms; // the map of start frames for those pages // vector of pages and their order to be printed (duplicates and any order allowed!) // (see 'render' in unotxdoc.cxx) - std::vector< sal_Int32 > aPagesToPrint; + std::vector< sal_Int32 > m_aPagesToPrint; + + std::vector< const SwPageFrm * > m_aPostItStartFrame; // for prospect printing: the pairs of pages to be printed together on a single prospect page. // -1 indicates a half page to be left empty. - std::vector< std::pair< sal_Int32, sal_Int32 > > aPagePairs; + std::vector< std::pair< sal_Int32, sal_Int32 > > m_aPagePairs; + + rtl::OUString m_PageRange; + +public: + + // PostIt relevant data + _SetGetExpFlds * m_pPostItFields; + SwDoc * m_pPostItDoc; + ViewShell * m_pPostItShell; + public: SwPrintUIOptions( BOOL bWeb = FALSE ); @@ -68,28 +86,47 @@ public: bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; + + bool HasPostItData() const { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; } + void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); + void DeletePostItData(); + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; - std::set< sal_Int32 > & GetValidPagesSet() { return aValidPages; } - const std::set< sal_Int32 > & GetValidPagesSet() const { return aValidPages; } - ValidStartFramesMap_t & GetValidStartFrms() { return aValidStartFrms; } - const ValidStartFramesMap_t & GetValidStartFrms() const { return aValidStartFrms; } + std::set< sal_Int32 > & GetValidPagesSet() { return m_aValidPages; } + const std::set< sal_Int32 > & GetValidPagesSet() const { return m_aValidPages; } + ValidStartFramesMap_t & GetValidStartFrms() { return m_aValidStartFrms; } + const ValidStartFramesMap_t & GetValidStartFrms() const { return m_aValidStartFrms; } // used for 'normal' printing - std::vector< sal_Int32 > & GetPagesToPrint() { return aPagesToPrint; } - const std::vector< sal_Int32 > & GetPagesToPrint() const { return aPagesToPrint; } + // A page value of 0 as entry indicates that this page is not from the document but + // from the post-it document. (See also GetPostItStartFrame below) + std::vector< sal_Int32 > & GetPagesToPrint() { return m_aPagesToPrint; } + const std::vector< sal_Int32 > & GetPagesToPrint() const { return m_aPagesToPrint; } + + // used for 'normal' printing with post-its + // - if the vector entry will be NULL then the respective page to be printed is from + // the document. In that case use the value from GetPagesToPrint at the same index to + // get the phys. page number to be printed, and then retrieve the start frame to use + // from GetValidStartFrms. + // - If the entry is not NULL it is the start frame of the page from the post-it document + // that is to be printed + std::vector< const SwPageFrm * > & GetPostItStartFrame() { return m_aPostItStartFrame; } + const std::vector< const SwPageFrm * > & GetPostItStartFrame() const { return m_aPostItStartFrame; } // used for prospect printing only - PagePairsVec_t & GetPagePairsForProspectPrinting() { return aPagePairs; } - const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return aPagePairs; } + PagePairsVec_t & GetPagePairsForProspectPrinting() { return m_aPagePairs; } + const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return m_aPagePairs; } - bool IsPrintLeftPages() const; - bool IsPrintRightPages() const; - bool IsPrintEmptyPages( bool bIsPDFExport ) const; - bool IsPrintTables() const; - bool IsPrintGraphics() const; - bool IsPrintDrawings() const; + rtl::OUString GetPageRange() const { return m_PageRange; } + void SetPageRange( const rtl::OUString &rRange ) { m_PageRange = rRange; } }; -- cgit From 88f90d83a9a285e7739e29ecaf28f1937e3abcbf Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 21 Aug 2009 11:30:53 +0000 Subject: #i101242# new print UI in sw --- sw/inc/printdata.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index ed463a6cb28c..d9be041ded8c 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -75,7 +75,7 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper public: // PostIt relevant data - _SetGetExpFlds * m_pPostItFields; + _SetGetExpFlds * m_pPostItFields; // an array of "_SetGetExpFld *" sorted by page and line numbers SwDoc * m_pPostItDoc; ViewShell * m_pPostItShell; -- cgit From ff0c53640ac0a74134b625791fb48b29d90f4fcb Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Fri, 21 Aug 2009 15:30:14 +0000 Subject: resolve conflicts --- sw/inc/unotxdoc.hxx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 216516d0d879..67270d15d392 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -69,9 +69,8 @@ #include #include #include -#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTLANGUAGES_HPP #include -#endif +#include #include #include #include @@ -80,22 +79,22 @@ #include // helper for implementations #include -#define __IFC31 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \ -Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31 +#define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \ +Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32 -#define __CLASS_IFC31 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \ +#define __CLASS_IFC32 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \ class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12, class Ifc13, class Ifc14, class Ifc15, class Ifc16, \ class Ifc17, class Ifc18, class Ifc19, class Ifc20, class Ifc21, class Ifc22, class Ifc23, class Ifc24,\ -class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31 +class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31 , class Ifc32 -#define __PUBLIC_IFC31 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \ +#define __PUBLIC_IFC32 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \ public Ifc13, public Ifc14, public Ifc15, public Ifc16, public Ifc17, public Ifc18, \ public Ifc19, public Ifc20, public Ifc21, public Ifc22, public Ifc23, public Ifc24, \ public Ifc25, public Ifc26, public Ifc27, public Ifc28, public Ifc29, public Ifc30, \ -public Ifc31 +public Ifc31, public Ifc32 #include #include -#define __IFC_EX_TYPE_INIT31( class_cast ) \ +#define __IFC_EX_TYPE_INIT32( class_cast ) \ __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \ __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \ __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \ @@ -111,12 +110,12 @@ public Ifc31 __IFC_EX_TYPE_INIT( class_cast, 25 ), __IFC_EX_TYPE_INIT( class_cast, 26 ), \ __IFC_EX_TYPE_INIT( class_cast, 27 ), __IFC_EX_TYPE_INIT( class_cast, 28 ), \ __IFC_EX_TYPE_INIT( class_cast, 29 ), __IFC_EX_TYPE_INIT( class_cast, 30 ), \ - __IFC_EX_TYPE_INIT( class_cast, 31) + __IFC_EX_TYPE_INIT( class_cast, 31 ), __IFC_EX_TYPE_INIT( class_cast, 32) #include -__DEF_IMPLHELPER_EX( 31 ) +__DEF_IMPLHELPER_EX( 32 ) -namespace css = ::com::sun::star; +namespace css = ::com::sun::star; class SwDoc; class SwDocShell; @@ -137,7 +136,7 @@ SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) ******************************************************************************/ -typedef cppu::WeakImplHelper31 +typedef cppu::WeakImplHelper32 < css::text::XTextDocument, css::text::XLineNumberingProperties, @@ -170,6 +169,7 @@ typedef cppu::WeakImplHelper31 css::xforms::XFormsSupplier, css::text::XFlatParagraphIteratorProvider, css::document::XDocumentLanguages + css::util::XCloneable > SwXTextDocumentBaseClass; @@ -409,6 +409,10 @@ public: // css::text::XFlatParagraphIteratorProvider: virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (css::uno::RuntimeException); + // ::com::sun::star::util::XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); + + // void Invalidate(); void Reactivate(SwDocShell* pNewDocShell); -- cgit From 8e24d60a844f03e6ff664a5c5ceddfbd95cd75d7 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Sat, 22 Aug 2009 10:11:49 +0000 Subject: make compile --- sw/inc/unotxdoc.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 67270d15d392..19b32df6c255 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -168,7 +168,7 @@ typedef cppu::WeakImplHelper32 css::view::XRenderable, css::xforms::XFormsSupplier, css::text::XFlatParagraphIteratorProvider, - css::document::XDocumentLanguages + css::document::XDocumentLanguages, css::util::XCloneable > SwXTextDocumentBaseClass; -- cgit From f8775840347067a54bd90c906b31e5fb258293d6 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 25 Aug 2009 13:10:30 +0000 Subject: #i101242# changes for printing of notes --- sw/inc/printdata.hxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index d9be041ded8c..e00ef66c977d 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -57,14 +57,14 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper // pages valid for printing (according to the current settings) // and their respective start frames (see getRendererCount in unotxdoc.cxx) // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! - std::set< sal_Int32 > m_aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) - std::map< sal_Int32, const SwPageFrm * > m_aValidStartFrms; // the map of start frames for those pages + std::set< sal_Int32 > m_aValidPages; // the set of possible pages (see StringRangeEnumerator::getRangesFromString ) + std::map< sal_Int32, const SwPageFrm * > m_aValidStartFrames; // the map of start frames for those pages // vector of pages and their order to be printed (duplicates and any order allowed!) // (see 'render' in unotxdoc.cxx) - std::vector< sal_Int32 > m_aPagesToPrint; + std::vector< sal_Int32 > m_aPagesToPrint; - std::vector< const SwPageFrm * > m_aPostItStartFrame; + std::vector< const SwPageFrm * > m_aPostItStartFrames; // for prospect printing: the pairs of pages to be printed together on a single prospect page. // -1 indicates a half page to be left empty. @@ -102,8 +102,8 @@ public: std::set< sal_Int32 > & GetValidPagesSet() { return m_aValidPages; } const std::set< sal_Int32 > & GetValidPagesSet() const { return m_aValidPages; } - ValidStartFramesMap_t & GetValidStartFrms() { return m_aValidStartFrms; } - const ValidStartFramesMap_t & GetValidStartFrms() const { return m_aValidStartFrms; } + ValidStartFramesMap_t & GetValidStartFrames() { return m_aValidStartFrames; } + const ValidStartFramesMap_t & GetValidStartFrames() const { return m_aValidStartFrames; } // used for 'normal' printing // A page value of 0 as entry indicates that this page is not from the document but @@ -112,14 +112,14 @@ public: const std::vector< sal_Int32 > & GetPagesToPrint() const { return m_aPagesToPrint; } // used for 'normal' printing with post-its - // - if the vector entry will be NULL then the respective page to be printed is from + // - if the map entry will be NULL then the respective page to be printed is from // the document. In that case use the value from GetPagesToPrint at the same index to // get the phys. page number to be printed, and then retrieve the start frame to use // from GetValidStartFrms. // - If the entry is not NULL it is the start frame of the page from the post-it document // that is to be printed - std::vector< const SwPageFrm * > & GetPostItStartFrame() { return m_aPostItStartFrame; } - const std::vector< const SwPageFrm * > & GetPostItStartFrame() const { return m_aPostItStartFrame; } + std::vector< const SwPageFrm * > & GetPostItStartFrames() { return m_aPostItStartFrames; } + const std::vector< const SwPageFrm * > & GetPostItStartFrames() const { return m_aPostItStartFrames; } // used for prospect printing only PagePairsVec_t & GetPagePairsForProspectPrinting() { return m_aPagePairs; } -- cgit From bc18988ff86ca83d850fba993a669ff6b8253b5a Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 27 Aug 2009 12:29:52 +0000 Subject: #101242# SwRenderData introduced; minor name changes --- sw/inc/doc.hxx | 7 +++-- sw/inc/printdata.hxx | 78 ++++++++++++++++++++++++++++++++-------------------- sw/inc/unotxdoc.hxx | 4 ++- 3 files changed, 55 insertions(+), 34 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 3f5ef569376b..52898ad0d1ad 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -218,6 +218,7 @@ class SwChartDataProvider; class SwChartLockController_Helper; class IGrammarContact; class SwPrintData; +class SwRenderData; class SwPageFrm; class SwViewOption; @@ -1339,11 +1340,11 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void CalculatePagesForPrinting( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, + void CalculatePagesForPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); - void UpdatePagesForPrintingWithPostItData( /* out */ SwPrintUIOptions &rOptions, bool bIsPDFExport, + void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); - void CalculatePagePairsForProspectPrinting( /* out */ SwPrintUIOptions &rOptions, + void CalculatePagePairsForProspectPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); sal_uInt16 GetPageCount() const; diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index e00ef66c977d..085121060c8e 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -50,10 +50,11 @@ class OutputDevice; //////////////////////////////////////////////////////////// -class SwPrintUIOptions : public vcl::PrinterOptionsHelper +// A class that stores temporary data that is needed for rendering the document. +// Usually this data is created when 'getRendererCount' is called and +// and it is used in the 'render' function of that same interface +class SwRenderData { - OutputDevice* m_pLast; - // pages valid for printing (according to the current settings) // and their respective start frames (see getRendererCount in unotxdoc.cxx) // This set of pages does NOT depend on the 'PageRange' that is used as a printing option! @@ -79,19 +80,10 @@ public: SwDoc * m_pPostItDoc; ViewShell * m_pPostItShell; - public: - SwPrintUIOptions( BOOL bWeb = FALSE ); - ~SwPrintUIOptions(); - - bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + SwRenderData(); + ~SwRenderData(); - bool IsPrintLeftPages() const; - bool IsPrintRightPages() const; - bool IsPrintEmptyPages( bool bIsPDFExport ) const; - bool IsPrintTables() const; - bool IsPrintGraphics() const; - bool IsPrintDrawings() const; bool HasPostItData() const { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; } void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); @@ -133,9 +125,32 @@ public: //////////////////////////////////////////////////////////// +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ + OutputDevice* m_pLast; + +public: + SwPrintUIOptions( BOOL bWeb = FALSE ); + ~SwPrintUIOptions(); + + bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; +}; + + +//////////////////////////////////////////////////////////// + + class SwPrintData { - const SwPrintUIOptions * m_pPrintUIOptions; + const SwPrintUIOptions * m_pPrintUIOptions; // not owner + const SwRenderData * m_pRenderData; // not owner public: @@ -143,8 +158,8 @@ public: bPrintBlackFont, //#i81434# - printing of hidden text bPrintHiddenText, bPrintTextPlaceholder, - bPrintLeftPage, bPrintRightPage, bPrintReverse, bPrintProspect, - bPrintProspect_RTL, + bPrintLeftPages, bPrintRightPages, bPrintReverse, bPrintProspect, + bPrintProspectRTL, bPrintSingleJobs, bPaperFromSetup, // --> FME 2005-12-13 #b6354161# Print empty pages bPrintEmptyPages, @@ -159,13 +174,14 @@ public: SwPrintData() { m_pPrintUIOptions = NULL; + m_pRenderData = NULL; bPrintGraphic = bPrintTable = bPrintDraw = bPrintControl = - bPrintLeftPage = - bPrintRightPage = + bPrintLeftPages = + bPrintRightPages = bPrintPageBackground = bPrintEmptyPages = bUpdateFieldsInPrinting = sal_True; @@ -173,7 +189,7 @@ public: bPaperFromSetup = bPrintReverse = bPrintProspect = - bPrintProspect_RTL = + bPrintProspectRTL = bPrintSingleJobs = bModified = bPrintBlackFont = @@ -194,11 +210,11 @@ public: bPrintControl == rData.bPrintControl && bPrintPageBackground== rData.bPrintPageBackground&& bPrintBlackFont == rData.bPrintBlackFont && - bPrintLeftPage == rData.bPrintLeftPage && - bPrintRightPage == rData.bPrintRightPage && + bPrintLeftPages == rData.bPrintLeftPages && + bPrintRightPages == rData.bPrintRightPages && bPrintReverse == rData.bPrintReverse && bPrintProspect == rData.bPrintProspect && - bPrintProspect_RTL == rData.bPrintProspect_RTL && + bPrintProspectRTL == rData.bPrintProspectRTL && bPrintSingleJobs == rData.bPrintSingleJobs && bPaperFromSetup == rData.bPaperFromSetup && bPrintEmptyPages == rData.bPrintEmptyPages && @@ -209,22 +225,24 @@ public: bPrintTextPlaceholder == rData.bPrintTextPlaceholder; } - // Note: int the conntext where this class ist used the pointer should always be valid + // Note: in the context where this class ist used the pointers should always be valid // during the lifetime of this object const SwPrintUIOptions & GetPrintUIOptions() const { return *m_pPrintUIOptions; } - void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } + void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } + const SwRenderData & GetRenderData() const { return *m_pRenderData; } + void SetRenderData( const SwRenderData *pData ) { m_pRenderData = pData; } sal_Bool IsPrintGraphic() const { return bPrintGraphic; } sal_Bool IsPrintTable() const { return bPrintTable; } sal_Bool IsPrintDraw() const { return bPrintDraw; } sal_Bool IsPrintControl() const { return bPrintControl; } - sal_Bool IsPrintLeftPage() const { return bPrintLeftPage; } - sal_Bool IsPrintRightPage() const { return bPrintRightPage; } + sal_Bool IsPrintLeftPage() const { return bPrintLeftPages; } + sal_Bool IsPrintRightPage() const { return bPrintRightPages; } sal_Bool IsPrintReverse() const { return bPrintReverse; } sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } sal_Bool IsPrintEmptyPages() const{ return bPrintEmptyPages; } sal_Bool IsPrintProspect() const { return bPrintProspect; } - sal_Bool IsPrintProspect_RTL() const { return bPrintProspect_RTL; } + sal_Bool IsPrintProspectRTL() const { return bPrintProspectRTL; } sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } sal_Bool IsPrintBlackFont() const { return bPrintBlackFont;} sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs;} @@ -237,8 +255,8 @@ public: void SetPrintTable ( sal_Bool b ) { doSetModified(); bPrintTable = b;} void SetPrintDraw ( sal_Bool b ) { doSetModified(); bPrintDraw = b;} void SetPrintControl ( sal_Bool b ) { doSetModified(); bPrintControl = b; } - void SetPrintLeftPage ( sal_Bool b ) { doSetModified(); bPrintLeftPage = b;} - void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPage = b;} + void SetPrintLeftPage ( sal_Bool b ) { doSetModified(); bPrintLeftPages = b;} + void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPages = b;} void SetPrintReverse ( sal_Bool b ) { doSetModified(); bPrintReverse = b;} void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b;} void SetPrintEmptyPages(sal_Bool b ) { doSetModified(); bPrintEmptyPages = b;} diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 19b32df6c255..f2ec7fc21d01 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -127,6 +127,7 @@ class SwXDocumentPropertyHelper; class SfxViewFrame; class SwPrintUIOptions; class SwPrintData; +class SwRenderData; typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) @@ -221,7 +222,8 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, css::uno::Reference< css::uno::XInterface> xPropertyHelper; SwXDocumentPropertyHelper* pPropertyHelper; - SwPrintUIOptions* m_pPrintUIOptions; + SwPrintUIOptions * m_pPrintUIOptions; + SwRenderData * m_pRenderData; void GetBodyText(); void GetNumberFormatter(); -- cgit From 8b9588e75bd53b64fa3d1cd0a006a14e74578f96 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 1 Sep 2009 15:16:12 +0000 Subject: #i101242# applying view options and formatting doc now only done in getRendererCount --- sw/inc/printdata.hxx | 72 ++++++++++++++++++++++++++++++++++------------------ sw/inc/swprtopt.hxx | 18 +++++++++---- sw/inc/unotxdoc.hxx | 31 ++++++++++++++++++++++ sw/inc/viewsh.hxx | 14 +--------- 4 files changed, 92 insertions(+), 43 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 085121060c8e..14303ad40d5d 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -42,10 +42,36 @@ class SwPageFrm; class SwDoc; +class SwDocShell; class ViewShell; class _SetGetExpFlds; class SwViewOption; class OutputDevice; +class SwViewOptionAdjust_Impl; +class SwPrtOptions; +class SwWrtShell; + + +//////////////////////////////////////////////////////////// + + +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ + OutputDevice* m_pLast; + +public: + SwPrintUIOptions( BOOL bWeb = FALSE ); + ~SwPrintUIOptions(); + + bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + + bool IsPrintLeftPages() const; + bool IsPrintRightPages() const; + bool IsPrintEmptyPages( bool bIsPDFExport ) const; + bool IsPrintTables() const; + bool IsPrintGraphics() const; + bool IsPrintDrawings() const; +}; //////////////////////////////////////////////////////////// @@ -71,7 +97,12 @@ class SwRenderData // -1 indicates a half page to be left empty. std::vector< std::pair< sal_Int32, sal_Int32 > > m_aPagePairs; - rtl::OUString m_PageRange; + rtl::OUString m_aPageRange; + + // the view options to be applied for printing + SwViewOptionAdjust_Impl * m_pViewOptionAdjust; + + SwPrtOptions * m_pPrtOptions; public: @@ -89,6 +120,19 @@ public: void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); void DeletePostItData(); + bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } + void ViewOptionAdjustStart( SwWrtShell& rSh ); + void ViewOptionAdjustStop(); + + bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } + void SetSwPrtOptions( SwPrtOptions * pOpt ) { m_pPrtOptions = pOpt; } + const SwPrtOptions * GetSwPrtOptions() const { return m_pPrtOptions; } + SwPrtOptions & GetSwPrtOptionsRef() { return *m_pPrtOptions; } + void MakeSwPrtOptions( SwPrtOptions &rOptions, const SwDocShell *pDocShell, + const SwPrintUIOptions *pOpt, const SwRenderData *pData, + bool bIsSkipEmptyPages, bool bIsPDFExport ); + + typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; typedef std::vector< std::pair< sal_Int32, sal_Int32 > > PagePairsVec_t; @@ -117,30 +161,8 @@ public: PagePairsVec_t & GetPagePairsForProspectPrinting() { return m_aPagePairs; } const PagePairsVec_t & GetPagePairsForProspectPrinting() const { return m_aPagePairs; } - rtl::OUString GetPageRange() const { return m_PageRange; } - void SetPageRange( const rtl::OUString &rRange ) { m_PageRange = rRange; } -}; - - -//////////////////////////////////////////////////////////// - - -class SwPrintUIOptions : public vcl::PrinterOptionsHelper -{ - OutputDevice* m_pLast; - -public: - SwPrintUIOptions( BOOL bWeb = FALSE ); - ~SwPrintUIOptions(); - - bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); - - bool IsPrintLeftPages() const; - bool IsPrintRightPages() const; - bool IsPrintEmptyPages( bool bIsPDFExport ) const; - bool IsPrintTables() const; - bool IsPrintGraphics() const; - bool IsPrintDrawings() const; + rtl::OUString GetPageRange() const { return m_aPageRange; } + void SetPageRange( const rtl::OUString &rRange ) { m_aPageRange = rRange; } }; diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 86bcefa5d455..76930675eb6c 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -45,6 +45,10 @@ #define POSTITS_ENDPAGE 3 +class PrintDialog; +class SfxPrinter; + + //////////////////////////////////////////////////////////// @@ -84,11 +88,15 @@ public: #endif - SwPrtOptions& operator=(const SwPrintData& rData) - { - SwPrintData::operator=(rData); - return *this; - } + SwPrtOptions& operator=(const SwPrintData& rData) + { + SwPrintData::operator=(rData); + return *this; + } + + // get print options + void MakeOptions( PrintDialog* pDlg, + BOOL* pPrtProspect, BOOL* pPrtProspect_RTL, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData ); }; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index f2ec7fc21d01..e0fa90de0ac7 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -128,10 +128,15 @@ class SfxViewFrame; class SwPrintUIOptions; class SwPrintData; class SwRenderData; +class SwPrtOptions; +class SwViewOption; +class SwWrtShell; + typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) + /****************************************************************************** * ******************************************************************************/ @@ -231,6 +236,7 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, // used for XRenderable implementation SfxViewShell * GuessViewShell( const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() ); SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport ); + SfxViewShell * GetRenderView( const SwPrintUIOptions &rOpt, bool bIsPDFExport ); rtl::OUString maBuildId; @@ -432,6 +438,7 @@ public: SwXDrawPage* GetDrawPage(); SwDocShell* GetDocShell() {return pDocShell;} + void * SAL_CALL operator new( size_t ) throw(); void SAL_CALL operator delete( void * ) throw(); @@ -579,3 +586,27 @@ public: virtual void onChange(); }; + + +/*-- 06.01.2004 15:08:34--------------------------------------------------- + The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of + the current ViewShell so that fields are not printed as commands and + hidden text and hidden characters are always invisible. + After printing the view options are restored + -----------------------------------------------------------------------*/ +class SwViewOptionAdjust_Impl +{ + bool m_bSwitchOff_IsFldName; + bool m_bSwitchOff_PlaceHolderView; + bool m_bSwitchOff_HiddenChar; + bool m_bSwitchOff_HiddenParagraphs; + bool m_bSwitchOff_IsShowHiddenField; + + SwViewOption* m_pViewOption; + SwWrtShell& m_rShell; +public: + SwViewOptionAdjust_Impl(SwWrtShell& rSh); + ~SwViewOptionAdjust_Impl(); +}; + + diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 1e09bbde33de..636608279dbb 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -218,8 +218,7 @@ public: const SwNodes& GetNodes() const; //Nach Druckerwechsel, vom Doc - //pPDFOut != NULL is used for PDF export. - void InitPrt( /*TLPDF Printer * ,*/ OutputDevice *pOutDev /* = NULL */ ); + void InitPrt( OutputDevice *pOutDev ); //Klammerung von zusammengehoerenden Aktionen. inline void StartAction(); @@ -380,17 +379,6 @@ public: void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ ); - // printing of a complete document for mail merge - // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool PrintOrPDFExportMM( vcl::OldStylePrintAdaptor &rAdaptor, - const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &rOptions, - const SwPrtOptions &rPrintData, bool bIsPDFExport = sal_False ); - - // printing of a complete brochure for mail merge - void PrintProspectMM( vcl::OldStylePrintAdaptor &rAdaptor, - const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &rOptions, - const SwPrintData &rPrintData, bool bProspectRTL ); - // printing for OLE 2.0 static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions, OutputDevice* pOleOut, const Rectangle& rRect ); -- cgit From 4c0bd776257fb1ad287e34b4e1bcf4bb6cd2f822 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 3 Sep 2009 15:12:37 +0000 Subject: #i101242# printing from HTML source view --- sw/inc/dbmgr.hxx | 3 --- sw/inc/printdata.hxx | 2 +- sw/inc/unotxdoc.hxx | 4 ++-- sw/inc/viewsh.hxx | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 9e13058e90e6..51242f33f224 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -252,9 +252,6 @@ public: // Mischen von Datensaetzen in Felder BOOL MergeNew( const SwMergeDescriptor& rMergeDesc ); BOOL Merge(SwWrtShell* pSh); - // Mischen von Datensaetzen in Felder, dann drucken - BOOL MergePrint( SwView& rView, - SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ); // printing parts of a merge result document BOOL MergePrintDocuments( SwView& rView, SwPrtOptions& rOpt, SfxProgress& rProgress, BOOL bIsAPI ); diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 14303ad40d5d..345546deabec 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -60,7 +60,7 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper OutputDevice* m_pLast; public: - SwPrintUIOptions( BOOL bWeb = FALSE ); + SwPrintUIOptions( bool bWeb, bool bSwSrcView ); ~SwPrintUIOptions(); bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index e0fa90de0ac7..8e56039cd53e 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -234,9 +234,9 @@ class SwXTextDocument : public SwXTextDocumentBaseClass, void GetNumberFormatter(); // used for XRenderable implementation - SfxViewShell * GuessViewShell( const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() ); + SfxViewShell * GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() ); SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport ); - SfxViewShell * GetRenderView( const SwPrintUIOptions &rOpt, bool bIsPDFExport ); + SfxViewShell * GetRenderView( bool &rbIsSwSrcView, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions, bool bIsPDFExport ); rtl::OUString maBuildId; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 636608279dbb..36da231f1832 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -388,8 +388,7 @@ public: SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt ); //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. - void CalcPagesForPrint( sal_uInt16 nMax, SfxProgress* pProgress = 0, - const String* pStr = NULL, ULONG nMergeAct = 0, ULONG nMergeCnt = 0 ); + void CalcPagesForPrint( sal_uInt16 nMax, SfxProgress* pProgress = 0 ); //All about fields. void UpdateFlds(sal_Bool bCloseDB = sal_False); -- cgit From 4f2690960ace7b79ef45b07f3fb81a208d97636a Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 4 Sep 2009 14:41:56 +0000 Subject: #i101242# clean-up --- sw/inc/printdata.hxx | 46 +++++++++++++++++++++++----------------------- sw/inc/swprtopt.hxx | 3 +-- sw/inc/viewsh.hxx | 10 ++-------- 3 files changed, 26 insertions(+), 33 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 345546deabec..17b9e3cefc9a 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -211,11 +211,11 @@ public: bPaperFromSetup = bPrintReverse = bPrintProspect = - bPrintProspectRTL = + bPrintProspectRTL = bPrintSingleJobs = bModified = bPrintBlackFont = - bPrintHiddenText = + bPrintHiddenText = bPrintTextPlaceholder = sal_False; nPrintPostIts = 0; @@ -226,24 +226,24 @@ public: sal_Bool operator==(const SwPrintData& rData)const { return - bPrintGraphic == rData.bPrintGraphic && - bPrintTable == rData.bPrintTable && - bPrintDraw == rData.bPrintDraw && - bPrintControl == rData.bPrintControl && - bPrintPageBackground== rData.bPrintPageBackground&& - bPrintBlackFont == rData.bPrintBlackFont && - bPrintLeftPages == rData.bPrintLeftPages && - bPrintRightPages == rData.bPrintRightPages && - bPrintReverse == rData.bPrintReverse && - bPrintProspect == rData.bPrintProspect && - bPrintProspectRTL == rData.bPrintProspectRTL && - bPrintSingleJobs == rData.bPrintSingleJobs && - bPaperFromSetup == rData.bPaperFromSetup && - bPrintEmptyPages == rData.bPrintEmptyPages && + bPrintGraphic == rData.bPrintGraphic && + bPrintTable == rData.bPrintTable && + bPrintDraw == rData.bPrintDraw && + bPrintControl == rData.bPrintControl && + bPrintPageBackground== rData.bPrintPageBackground && + bPrintBlackFont == rData.bPrintBlackFont && + bPrintLeftPages == rData.bPrintLeftPages && + bPrintRightPages == rData.bPrintRightPages && + bPrintReverse == rData.bPrintReverse && + bPrintProspect == rData.bPrintProspect && + bPrintProspectRTL == rData.bPrintProspectRTL && + bPrintSingleJobs == rData.bPrintSingleJobs && + bPaperFromSetup == rData.bPaperFromSetup && + bPrintEmptyPages == rData.bPrintEmptyPages && bUpdateFieldsInPrinting == rData.bUpdateFieldsInPrinting && - nPrintPostIts == rData.nPrintPostIts && - sFaxName == rData.sFaxName && - bPrintHiddenText == rData.bPrintHiddenText && + nPrintPostIts == rData.nPrintPostIts && + sFaxName == rData.sFaxName && + bPrintHiddenText == rData.bPrintHiddenText && bPrintTextPlaceholder == rData.bPrintTextPlaceholder; } @@ -266,12 +266,12 @@ public: sal_Bool IsPrintProspect() const { return bPrintProspect; } sal_Bool IsPrintProspectRTL() const { return bPrintProspectRTL; } sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } - sal_Bool IsPrintBlackFont() const { return bPrintBlackFont;} - sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs;} + sal_Bool IsPrintBlackFont() const { return bPrintBlackFont; } + sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs; } sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } - const rtl::OUString GetFaxName() const{return sFaxName;} + const rtl::OUString GetFaxName() const{return sFaxName; } sal_Bool IsPrintHiddenText() const {return bPrintHiddenText;} - sal_Bool IsPrintTextPlaceholder() const {return bPrintTextPlaceholder;} + sal_Bool IsPrintTextPlaceholder() const {return bPrintTextPlaceholder; } void SetPrintGraphic ( sal_Bool b ) { doSetModified(); bPrintGraphic = b;} void SetPrintTable ( sal_Bool b ) { doSetModified(); bPrintTable = b;} diff --git a/sw/inc/swprtopt.hxx b/sw/inc/swprtopt.hxx index 76930675eb6c..dbf2898c481e 100644 --- a/sw/inc/swprtopt.hxx +++ b/sw/inc/swprtopt.hxx @@ -95,8 +95,7 @@ public: } // get print options - void MakeOptions( PrintDialog* pDlg, - BOOL* pPrtProspect, BOOL* pPrtProspect_RTL, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData ); + void MakeOptions( BOOL bWeb ); }; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 36da231f1832..03d1c9d64184 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -372,8 +372,7 @@ public: // printing of one page. // bIsPDFExport == true is: do PDF Export (no printing!) sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, - sal_Int32 nRenderer, /* offset in vector of pages to print */ - bool bIsPDFExport = sal_False ); + sal_Int32 nRenderer /* offset in vector of pages to print */ ); // printing of one brochure page void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, @@ -384,7 +383,7 @@ public: OutputDevice* pOleOut, const Rectangle& rRect ); // creates temporary doc with selected text for PDF export - SwDoc * CreatePrtDoc( /*Printer* pPrt,*/ SfxObjectShellRef& ); + SwDoc * CreatePrtDoc( SfxObjectShellRef& ); SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt ); //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. @@ -487,11 +486,6 @@ public: */ void AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions ); - // print page/print preview - void PrintPreViewPage( SwPrtOptions& rOptions, sal_uInt16 nRowCol, - SfxProgress& rProgress, - const SwPagePreViewPrtData* = 0 ); - sal_Bool IsViewLocked() const { return bViewLocked; } void LockView( sal_Bool b ) { bViewLocked = b; } -- cgit From 1f8c7028f642e995945eb0d3f70a13ac5267aad1 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Mon, 12 Oct 2009 11:36:38 +0200 Subject: solve rebase problems --- sw/inc/printdata.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 11e2deed24ba..1d7841953edc 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -284,7 +284,7 @@ public: void SetPrintEmptyPages(sal_Bool b ) { doSetModified(); bPrintEmptyPages = b;} void SetPrintPostIts ( sal_Int16 n){ doSetModified(); nPrintPostIts = n; } void SetPrintProspect ( sal_Bool b ) { doSetModified(); bPrintProspect = b; } - void SetPrintProspect_RTL ( sal_Bool b ) { doSetModified(); bPrintProspect_RTL = b; } + void SetPrintProspect_RTL ( sal_Bool b ) { doSetModified(); bPrintProspectRTL = b; } void SetPrintPageBackground(sal_Bool b){ doSetModified(); bPrintPageBackground = b;} void SetPrintBlackFont(sal_Bool b){ doSetModified(); bPrintBlackFont = b;} void SetPrintSingleJobs(sal_Bool b){ doSetModified(); bPrintSingleJobs = b;} -- cgit From 021c0f0b52d7893d9497a509d3eb70b5777e1406 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Wed, 14 Oct 2009 11:15:39 +0200 Subject: fix a windows build problem --- sw/inc/unotxdoc.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 4f2c444195d7..bea720e592bf 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -258,7 +258,7 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException); - SW_DLLPUBLIC static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); //XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException); -- cgit From 0b7a663872f6377fced80cdd6368174f1f28eddb Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 3 Dec 2009 15:25:10 +0100 Subject: #i106926# printing of hidden text fixed --- sw/inc/printdata.hxx | 2 +- sw/inc/unotxdoc.hxx | 19 +++++++++++++------ sw/inc/viewopt.hxx | 9 +++++++-- 3 files changed, 21 insertions(+), 9 deletions(-) mode change 100644 => 100755 sw/inc/printdata.hxx mode change 100644 => 100755 sw/inc/unotxdoc.hxx mode change 100644 => 100755 sw/inc/viewopt.hxx (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx old mode 100644 new mode 100755 index 1d7841953edc..2df487f69838 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -121,7 +121,7 @@ public: void DeletePostItData(); bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } - void ViewOptionAdjustStart( SwWrtShell& rSh ); + void ViewOptionAdjustStart( SwWrtShell& rSh, const SwPrtOptions *pPrtOptions ); void ViewOptionAdjustStop(); bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx old mode 100644 new mode 100755 index bea720e592bf..a5c39b2d928d --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -591,21 +591,28 @@ public: /*-- 06.01.2004 15:08:34--------------------------------------------------- The class SwViewOptionAdjust_Impl is used to adjust the SwViewOption of the current ViewShell so that fields are not printed as commands and - hidden text and hidden characters are always invisible. + hidden characters are always invisible. Hidden text and place holders + should be printed according to the current print options. After printing the view options are restored -----------------------------------------------------------------------*/ class SwViewOptionAdjust_Impl { + // options not available in the File/Print UI, should be turned off for + // printing and PDF export if they are enabled bool m_bSwitchOff_IsFldName; - bool m_bSwitchOff_PlaceHolderView; - bool m_bSwitchOff_HiddenChar; - bool m_bSwitchOff_HiddenParagraphs; - bool m_bSwitchOff_IsShowHiddenField; + + // options available in the File/Print UI, should be turned of for PDF export + // and otherwise set (or not) according to + // pPrtOptions->bPrintHiddenText and pPrtOptions->bPrintTextPlaceholder + bool m_bToggle_HiddenChar; + bool m_bToggle_HiddenField; + bool m_bToggle_HiddenParagraphs; + bool m_bToggle_PlaceHolderView; SwViewOption* m_pViewOption; SwWrtShell& m_rShell; public: - SwViewOptionAdjust_Impl(SwWrtShell& rSh); + SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwPrtOptions *pPrtOptions ); ~SwViewOptionAdjust_Impl(); }; diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx old mode 100644 new mode 100755 index d650d90cf08e..2ac47e284b49 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -82,8 +82,7 @@ namespace svtools{ class ColorConfig;} #define VIEWOPT_CORE2_SMOOTHSCROLL 0x00000004L #define VIEWOPT_CORE2_CRSR_IN_PROT 0x00000008L #define VIEWOPT_CORE2_PDF_EXPORT 0x00000010L - - +#define VIEWOPT_CORE2_PRINTING 0x00000020L #define VIEWOPT_CORE2_BIGMARKHDL 0x00000040L #define VIEWOPT_2_UNUSED1 0x00000100L @@ -381,6 +380,12 @@ public: inline void SetPDFExport(BOOL b) { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);} + inline BOOL IsPrinting() const + {return nCore2Options & VIEWOPT_CORE2_PRINTING ? TRUE : FALSE;} + + inline void SetPrinting(BOOL b) + { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PRINTING) : (nCore2Options &= ~VIEWOPT_CORE2_PRINTING);} + /*--------------------------------------------------------------------------- ----------------------------------------------------------------------------*/ -- cgit From 34b5a53a562ac9bb3387e1e5603cd04165a268ae Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 8 Dec 2009 13:00:42 +0100 Subject: #i105728#, #i105730#, #i105727# intelli UI thingies --- sw/inc/docsh.hxx | 1 + sw/inc/printdata.hxx | 3 ++- sw/inc/viewsh.hxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 sw/inc/docsh.hxx mode change 100644 => 100755 sw/inc/viewsh.hxx (limited to 'sw/inc') diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx old mode 100644 new mode 100755 index 6ed3f6d652bd..df06af8a8a36 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -183,6 +183,7 @@ public: // Doc rausreichen aber VORSICHT inline SwDoc* GetDoc() { return pDoc; } + inline const SwDoc* GetDoc() const { return pDoc; } IDocumentDeviceAccess* getIDocumentDeviceAccess(); const IDocumentSettingAccess* getIDocumentSettingAccess() const; IDocumentChartDataProviderAccess* getIDocumentChartDataProviderAccess(); diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 2df487f69838..356ecb30b79e 100755 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -50,6 +50,7 @@ class OutputDevice; class SwViewOptionAdjust_Impl; class SwPrtOptions; class SwWrtShell; +class SfxViewShell; //////////////////////////////////////////////////////////// @@ -60,7 +61,7 @@ class SwPrintUIOptions : public vcl::PrinterOptionsHelper OutputDevice* m_pLast; public: - SwPrintUIOptions( bool bWeb, bool bSwSrcView ); + SwPrintUIOptions( bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts ); ~SwPrintUIOptions(); bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx old mode 100644 new mode 100755 index 03d1c9d64184..30624f23c2ef --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -387,7 +387,7 @@ public: SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt ); //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten. - void CalcPagesForPrint( sal_uInt16 nMax, SfxProgress* pProgress = 0 ); + void CalcPagesForPrint( sal_uInt16 nMax ); //All about fields. void UpdateFlds(sal_Bool bCloseDB = sal_False); -- cgit From af1e3ee0d10c10d6f30d8700ddc677a86dbf82c3 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 10 Dec 2009 11:14:28 +0100 Subject: #i106914# apply configuration settings in UI --- sw/inc/printdata.hxx | 281 +++++++++++++++++++++++++++------------------------ 1 file changed, 148 insertions(+), 133 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 356ecb30b79e..75f16d01ace3 100755 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -52,6 +52,139 @@ class SwPrtOptions; class SwWrtShell; class SfxViewShell; +// forward declarations +class SwPrintUIOptions; +class SwRenderData; + +//////////////////////////////////////////////////////////// + + +class SwPrintData +{ + const SwPrintUIOptions * m_pPrintUIOptions; // not owner + const SwRenderData * m_pRenderData; // not owner + +public: + + sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground, + bPrintBlackFont, + //#i81434# - printing of hidden text + bPrintHiddenText, bPrintTextPlaceholder, + bPrintLeftPages, bPrintRightPages, bPrintReverse, bPrintProspect, + bPrintProspectRTL, + bPrintSingleJobs, bPaperFromSetup, + // --> FME 2005-12-13 #b6354161# Print empty pages + bPrintEmptyPages, + // <-- + // #i56195# no field update while printing mail merge documents + bUpdateFieldsInPrinting, + bModified; + + sal_Int16 nPrintPostIts; + rtl::OUString sFaxName; + + SwPrintData() + { + m_pPrintUIOptions = NULL; + m_pRenderData = NULL; + + bPrintGraphic = + bPrintTable = + bPrintDraw = + bPrintControl = + bPrintLeftPages = + bPrintRightPages = + bPrintPageBackground = + bPrintEmptyPages = + bUpdateFieldsInPrinting = sal_True; + + bPaperFromSetup = + bPrintReverse = + bPrintProspect = + bPrintProspectRTL = + bPrintSingleJobs = + bModified = + bPrintBlackFont = + bPrintHiddenText = + bPrintTextPlaceholder = sal_False; + + nPrintPostIts = 0; + } + + virtual ~SwPrintData() {} + + sal_Bool operator==(const SwPrintData& rData)const + { + return + bPrintGraphic == rData.bPrintGraphic && + bPrintTable == rData.bPrintTable && + bPrintDraw == rData.bPrintDraw && + bPrintControl == rData.bPrintControl && + bPrintPageBackground== rData.bPrintPageBackground && + bPrintBlackFont == rData.bPrintBlackFont && + bPrintLeftPages == rData.bPrintLeftPages && + bPrintRightPages == rData.bPrintRightPages && + bPrintReverse == rData.bPrintReverse && + bPrintProspect == rData.bPrintProspect && + bPrintProspectRTL == rData.bPrintProspectRTL && + bPrintSingleJobs == rData.bPrintSingleJobs && + bPaperFromSetup == rData.bPaperFromSetup && + bPrintEmptyPages == rData.bPrintEmptyPages && + bUpdateFieldsInPrinting == rData.bUpdateFieldsInPrinting && + nPrintPostIts == rData.nPrintPostIts && + sFaxName == rData.sFaxName && + bPrintHiddenText == rData.bPrintHiddenText && + bPrintTextPlaceholder == rData.bPrintTextPlaceholder; + } + + // Note: in the context where this class ist used the pointers should always be valid + // during the lifetime of this object + const SwPrintUIOptions & GetPrintUIOptions() const { return *m_pPrintUIOptions; } + const SwRenderData & GetRenderData() const { return *m_pRenderData; } + void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } + void SetRenderData( const SwRenderData *pData ) { m_pRenderData = pData; } + + sal_Bool IsPrintGraphic() const { return bPrintGraphic; } + sal_Bool IsPrintTable() const { return bPrintTable; } + sal_Bool IsPrintDraw() const { return bPrintDraw; } + sal_Bool IsPrintControl() const { return bPrintControl; } + sal_Bool IsPrintLeftPage() const { return bPrintLeftPages; } + sal_Bool IsPrintRightPage() const { return bPrintRightPages; } + sal_Bool IsPrintReverse() const { return bPrintReverse; } + sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } + sal_Bool IsPrintEmptyPages() const { return bPrintEmptyPages; } + sal_Bool IsPrintProspect() const { return bPrintProspect; } + sal_Bool IsPrintProspectRTL() const { return bPrintProspectRTL; } + sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } + sal_Bool IsPrintBlackFont() const { return bPrintBlackFont; } + sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs; } + sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } + const rtl::OUString GetFaxName() const { return sFaxName; } + sal_Bool IsPrintHiddenText() const { return bPrintHiddenText; } + sal_Bool IsPrintTextPlaceholder() const { return bPrintTextPlaceholder; } + + void SetPrintGraphic( sal_Bool b ) { doSetModified(); bPrintGraphic = b; } + void SetPrintTable( sal_Bool b ) { doSetModified(); bPrintTable = b; } + void SetPrintDraw( sal_Bool b ) { doSetModified(); bPrintDraw = b; } + void SetPrintControl( sal_Bool b ) { doSetModified(); bPrintControl = b; } + void SetPrintLeftPage( sal_Bool b ) { doSetModified(); bPrintLeftPages = b; } + void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPages = b; } + void SetPrintReverse( sal_Bool b ) { doSetModified(); bPrintReverse = b; } + void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b; } + void SetPrintEmptyPages( sal_Bool b ) { doSetModified(); bPrintEmptyPages = b; } + void SetPrintPostIts( sal_Int16 n ) { doSetModified(); nPrintPostIts = n; } + void SetPrintProspect( sal_Bool b ) { doSetModified(); bPrintProspect = b; } + void SetPrintProspect_RTL( sal_Bool b ) { doSetModified(); bPrintProspectRTL = b; } + void SetPrintPageBackground( sal_Bool b ) { doSetModified(); bPrintPageBackground = b; } + void SetPrintBlackFont( sal_Bool b ) { doSetModified(); bPrintBlackFont = b; } + void SetPrintSingleJobs( sal_Bool b ) { doSetModified(); bPrintSingleJobs = b; } + void SetFaxName( const rtl::OUString& rSet ) { sFaxName = rSet; } + void SetPrintHiddenText( sal_Bool b ) { doSetModified(); bPrintHiddenText = b; } + void SetPrintTextPlaceholder( sal_Bool b ) { doSetModified(); bPrintTextPlaceholder = b; } + + virtual void doSetModified () { bModified = sal_True;} +}; + //////////////////////////////////////////////////////////// @@ -59,13 +192,25 @@ class SfxViewShell; class SwPrintUIOptions : public vcl::PrinterOptionsHelper { OutputDevice* m_pLast; + const SwPrintData & m_rDefaultPrintData; public: - SwPrintUIOptions( bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts ); - ~SwPrintUIOptions(); + SwPrintUIOptions( bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts, const SwPrintData &rDefaultPrintData ); + virtual ~SwPrintUIOptions(); bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp ); + bool IsPrintFormControls() const { return getBoolValue( "PrintControls", m_rDefaultPrintData.bPrintControl ); } + bool IsPrintPageBackground() const { return getBoolValue( "PrintPageBackground", m_rDefaultPrintData.bPrintPageBackground ); } + bool IsPrintProspect() const { return getBoolValue( "PrintProspect", m_rDefaultPrintData.bPrintProspect ); } + bool IsPrintProspectRTL() const { return getIntValue( "PrintProspectRTL", m_rDefaultPrintData.bPrintProspectRTL ) ? true : false; } + bool IsPrintTextPlaceholders() const { return getBoolValue( "PrintTextPlaceholder", m_rDefaultPrintData.bPrintTextPlaceholder ); } + bool IsPrintHiddenText() const { return getBoolValue( "PrintHiddenText", m_rDefaultPrintData.bPrintHiddenText ); } + bool IsPrintWithBlackTextColor() const { return getBoolValue( "PrintBlackFonts", m_rDefaultPrintData.bPrintBlackFont ); } + sal_Int16 GetPrintPostItsType() const { return static_cast< sal_Int16 >(getIntValue( "PrintAnnotationMode", m_rDefaultPrintData.nPrintPostIts )); } + bool IsPaperFromSetup() const { return getBoolValue( "PrintPaperFromSetup", m_rDefaultPrintData.bPaperFromSetup ); } + bool IsPrintReverse() const { return false; /*handled by print dialog now*/ /*getBoolValue( "PrintReversed", m_rDefaultPrintData.bPrintReverse );*/ } + bool IsPrintLeftPages() const; bool IsPrintRightPages() const; bool IsPrintEmptyPages( bool bIsPDFExport ) const; @@ -130,8 +275,7 @@ public: const SwPrtOptions * GetSwPrtOptions() const { return m_pPrtOptions; } SwPrtOptions & GetSwPrtOptionsRef() { return *m_pPrtOptions; } void MakeSwPrtOptions( SwPrtOptions &rOptions, const SwDocShell *pDocShell, - const SwPrintUIOptions *pOpt, const SwRenderData *pData, - bool bIsSkipEmptyPages, bool bIsPDFExport ); + const SwPrintUIOptions *pOpt, const SwRenderData *pData, bool bIsPDFExport ); typedef std::map< sal_Int32, const SwPageFrm * > ValidStartFramesMap_t; @@ -167,135 +311,6 @@ public: }; -//////////////////////////////////////////////////////////// - - -class SwPrintData -{ - const SwPrintUIOptions * m_pPrintUIOptions; // not owner - const SwRenderData * m_pRenderData; // not owner - -public: - - sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground, - bPrintBlackFont, - //#i81434# - printing of hidden text - bPrintHiddenText, bPrintTextPlaceholder, - bPrintLeftPages, bPrintRightPages, bPrintReverse, bPrintProspect, - bPrintProspectRTL, - bPrintSingleJobs, bPaperFromSetup, - // --> FME 2005-12-13 #b6354161# Print empty pages - bPrintEmptyPages, - // <-- - // #i56195# no field update while printing mail merge documents - bUpdateFieldsInPrinting, - bModified; - - sal_Int16 nPrintPostIts; - rtl::OUString sFaxName; - - SwPrintData() - { - m_pPrintUIOptions = NULL; - m_pRenderData = NULL; - - bPrintGraphic = - bPrintTable = - bPrintDraw = - bPrintControl = - bPrintLeftPages = - bPrintRightPages = - bPrintPageBackground = - bPrintEmptyPages = - bUpdateFieldsInPrinting = sal_True; - - bPaperFromSetup = - bPrintReverse = - bPrintProspect = - bPrintProspectRTL = - bPrintSingleJobs = - bModified = - bPrintBlackFont = - bPrintHiddenText = - bPrintTextPlaceholder = sal_False; - - nPrintPostIts = 0; - } - - virtual ~SwPrintData() {} - - sal_Bool operator==(const SwPrintData& rData)const - { - return - bPrintGraphic == rData.bPrintGraphic && - bPrintTable == rData.bPrintTable && - bPrintDraw == rData.bPrintDraw && - bPrintControl == rData.bPrintControl && - bPrintPageBackground== rData.bPrintPageBackground && - bPrintBlackFont == rData.bPrintBlackFont && - bPrintLeftPages == rData.bPrintLeftPages && - bPrintRightPages == rData.bPrintRightPages && - bPrintReverse == rData.bPrintReverse && - bPrintProspect == rData.bPrintProspect && - bPrintProspectRTL == rData.bPrintProspectRTL && - bPrintSingleJobs == rData.bPrintSingleJobs && - bPaperFromSetup == rData.bPaperFromSetup && - bPrintEmptyPages == rData.bPrintEmptyPages && - bUpdateFieldsInPrinting == rData.bUpdateFieldsInPrinting && - nPrintPostIts == rData.nPrintPostIts && - sFaxName == rData.sFaxName && - bPrintHiddenText == rData.bPrintHiddenText && - bPrintTextPlaceholder == rData.bPrintTextPlaceholder; - } - - // Note: in the context where this class ist used the pointers should always be valid - // during the lifetime of this object - const SwPrintUIOptions & GetPrintUIOptions() const { return *m_pPrintUIOptions; } - void SetPrintUIOptions( const SwPrintUIOptions *pOpt ) { m_pPrintUIOptions = pOpt; } - const SwRenderData & GetRenderData() const { return *m_pRenderData; } - void SetRenderData( const SwRenderData *pData ) { m_pRenderData = pData; } - - sal_Bool IsPrintGraphic() const { return bPrintGraphic; } - sal_Bool IsPrintTable() const { return bPrintTable; } - sal_Bool IsPrintDraw() const { return bPrintDraw; } - sal_Bool IsPrintControl() const { return bPrintControl; } - sal_Bool IsPrintLeftPage() const { return bPrintLeftPages; } - sal_Bool IsPrintRightPage() const { return bPrintRightPages; } - sal_Bool IsPrintReverse() const { return bPrintReverse; } - sal_Bool IsPaperFromSetup() const { return bPaperFromSetup; } - sal_Bool IsPrintEmptyPages() const{ return bPrintEmptyPages; } - sal_Bool IsPrintProspect() const { return bPrintProspect; } - sal_Bool IsPrintProspectRTL() const { return bPrintProspectRTL; } - sal_Bool IsPrintPageBackground() const { return bPrintPageBackground; } - sal_Bool IsPrintBlackFont() const { return bPrintBlackFont; } - sal_Bool IsPrintSingleJobs() const { return bPrintSingleJobs; } - sal_Int16 GetPrintPostIts() const { return nPrintPostIts; } - const rtl::OUString GetFaxName() const{return sFaxName; } - sal_Bool IsPrintHiddenText() const {return bPrintHiddenText;} - sal_Bool IsPrintTextPlaceholder() const {return bPrintTextPlaceholder; } - - void SetPrintGraphic ( sal_Bool b ) { doSetModified(); bPrintGraphic = b;} - void SetPrintTable ( sal_Bool b ) { doSetModified(); bPrintTable = b;} - void SetPrintDraw ( sal_Bool b ) { doSetModified(); bPrintDraw = b;} - void SetPrintControl ( sal_Bool b ) { doSetModified(); bPrintControl = b; } - void SetPrintLeftPage ( sal_Bool b ) { doSetModified(); bPrintLeftPages = b;} - void SetPrintRightPage( sal_Bool b ) { doSetModified(); bPrintRightPages = b;} - void SetPrintReverse ( sal_Bool b ) { doSetModified(); bPrintReverse = b;} - void SetPaperFromSetup( sal_Bool b ) { doSetModified(); bPaperFromSetup = b;} - void SetPrintEmptyPages(sal_Bool b ) { doSetModified(); bPrintEmptyPages = b;} - void SetPrintPostIts ( sal_Int16 n){ doSetModified(); nPrintPostIts = n; } - void SetPrintProspect ( sal_Bool b ) { doSetModified(); bPrintProspect = b; } - void SetPrintProspect_RTL ( sal_Bool b ) { doSetModified(); bPrintProspectRTL = b; } - void SetPrintPageBackground(sal_Bool b){ doSetModified(); bPrintPageBackground = b;} - void SetPrintBlackFont(sal_Bool b){ doSetModified(); bPrintBlackFont = b;} - void SetPrintSingleJobs(sal_Bool b){ doSetModified(); bPrintSingleJobs = b;} - void SetFaxName(const rtl::OUString& rSet){sFaxName = rSet;} - void SetPrintHiddenText(sal_Bool b){ doSetModified(); bPrintHiddenText = b;} - void SetPrintTextPlaceholder(sal_Bool b){ doSetModified(); bPrintTextPlaceholder = b;} - - virtual void doSetModified () { bModified = sal_True;} -}; - //////////////////////////////////////////////////////////// #endif //_SW_PRINTDATA_HXX -- cgit From 9195c2b45eb5488e939bb88281d45cb45fbe4861 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 11 Dec 2009 11:34:10 +0100 Subject: #i106926# fixed hidden text in view when cancelling print to file --- sw/inc/unotxdoc.hxx | 24 +++++++++--------------- sw/inc/viewopt.hxx | 3 ++- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index a5c39b2d928d..45a890aeab7d 100755 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -29,9 +29,11 @@ ************************************************************************/ #ifndef _UNOTXDOC_HXX #define _UNOTXDOC_HXX + #include "swdllapi.h" #include #include + #include #include #include @@ -79,6 +81,8 @@ #include // helper for implementations #include +#include + #define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \ Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32 @@ -129,7 +133,6 @@ class SwPrintUIOptions; class SwPrintData; class SwRenderData; class SwPrtOptions; -class SwViewOption; class SwWrtShell; @@ -597,20 +600,11 @@ public: -----------------------------------------------------------------------*/ class SwViewOptionAdjust_Impl { - // options not available in the File/Print UI, should be turned off for - // printing and PDF export if they are enabled - bool m_bSwitchOff_IsFldName; - - // options available in the File/Print UI, should be turned of for PDF export - // and otherwise set (or not) according to - // pPrtOptions->bPrintHiddenText and pPrtOptions->bPrintTextPlaceholder - bool m_bToggle_HiddenChar; - bool m_bToggle_HiddenField; - bool m_bToggle_HiddenParagraphs; - bool m_bToggle_PlaceHolderView; - - SwViewOption* m_pViewOption; - SwWrtShell& m_rShell; + SwWrtShell & m_rShell; + SwViewOption m_aOldViewOptions; + SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing + bool m_bRestoreViewOptions; + public: SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwPrtOptions *pPrtOptions ); ~SwViewOptionAdjust_Impl(); diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 2ac47e284b49..8b2e4d5aa6fa 100755 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -455,7 +455,8 @@ public: SwViewOption& operator=( const SwViewOption &rOpt ); // Vergleichsmethoden BOOL IsEqualFlags ( const SwViewOption &rOpt ) const; - inline BOOL operator==( const SwViewOption &rOpt ) const; + inline BOOL operator == ( const SwViewOption &rOpt ) const; + inline BOOL operator != ( const SwViewOption &rOpt ) const { return !(*this == rOpt); } /*--------------------------------------------------------------------------- -- cgit From af8a4cf23931e9b26d31683292dfe56cec2e97cb Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 11 Dec 2009 16:17:51 +0100 Subject: #i106926# fixing view settings after rendering --- sw/inc/printdata.hxx | 3 ++- sw/inc/unotxdoc.hxx | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 75f16d01ace3..3368418354cf 100755 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -267,7 +267,8 @@ public: void DeletePostItData(); bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } - void ViewOptionAdjustStart( SwWrtShell& rSh, const SwPrtOptions *pPrtOptions ); + void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ); + void ViewOptionAdjust( const SwPrtOptions *pPrtOptions ); void ViewOptionAdjustStop(); bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 45a890aeab7d..39438bbc3add 100755 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -602,12 +602,14 @@ class SwViewOptionAdjust_Impl { SwWrtShell & m_rShell; SwViewOption m_aOldViewOptions; - SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing - bool m_bRestoreViewOptions; +// SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing +// bool m_bRestoreViewOptions; public: - SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwPrtOptions *pPrtOptions ); + SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ); ~SwViewOptionAdjust_Impl(); + + void AdjustViewOptions( const SwPrtOptions *pPrtOptions ); }; -- cgit From 4bbfefa5fde9fb5f3941528a54fcdcfac17ca78d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:36 +0100 Subject: swunolocking1: #i107171#: fix crash caused by SwXParagraph::attachToText(): register at the text node, not at an uno cursor. --- sw/inc/unoobj.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index b7a6c54d2bd2..08f5d2308b66 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -1283,7 +1283,7 @@ public: static SwXParagraph* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); //falls es mal als Service erzeugt werden kann //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 attachToText(SwXText* pParent, SwUnoCrsr* pCrsr); + void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); }; /* -----------------23.03.99 12:57------------------- * -- cgit From 733b831970204059b9d89eff203551d6d3bf4bbe Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:41 +0100 Subject: swunolocking1: swtypes.hxx: rename frame anchor types enum RndStdIds: rename frame anchor types (FLY_*) to be more intuitive. [note the completely ridiculous number of files that care about anchor types] --- sw/inc/dcontact.hxx | 10 +++++----- sw/inc/fmtanchr.hxx | 4 ++-- sw/inc/swtypes.hxx | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index e1f20183deca..dc767403d1d5 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -191,11 +191,11 @@ public: } RndStdIds GetAnchorId() const { return GetAnchorFmt().GetAnchorId(); } - bool ObjAnchoredAtPage() const { return GetAnchorId() == FLY_PAGE; } - bool ObjAnchoredAtFly() const { return GetAnchorId() == FLY_AT_FLY; } - bool ObjAnchoredAtPara() const { return GetAnchorId() == FLY_AT_CNTNT; } - bool ObjAnchoredAtChar() const { return GetAnchorId() == FLY_AUTO_CNTNT; } - bool ObjAnchoredAsChar() const { return GetAnchorId() == FLY_IN_CNTNT; } + bool ObjAnchoredAtPage() const { return GetAnchorId() == FLY_AT_PAGE; } + bool ObjAnchoredAtFly() const { return GetAnchorId() == FLY_AT_FLY; } + bool ObjAnchoredAtPara() const { return GetAnchorId() == FLY_AT_PARA; } + bool ObjAnchoredAtChar() const { return GetAnchorId() == FLY_AT_CHAR; } + bool ObjAnchoredAsChar() const { return GetAnchorId() == FLY_AS_CHAR; } const SwPosition& GetCntntAnchor() const { diff --git a/sw/inc/fmtanchr.hxx b/sw/inc/fmtanchr.hxx index fd6975205347..df544884dd51 100644 --- a/sw/inc/fmtanchr.hxx +++ b/sw/inc/fmtanchr.hxx @@ -55,7 +55,7 @@ class SW_DLLPUBLIC SwFmtAnchor: public SfxPoolItem static sal_uInt32 mnOrderCounter; public: - SwFmtAnchor( RndStdIds eRnd = FLY_PAGE, USHORT nPageNum = 0 ); + SwFmtAnchor( RndStdIds eRnd = FLY_AT_PAGE, USHORT nPageNum = 0 ); SwFmtAnchor( const SwFmtAnchor &rCpy ); ~SwFmtAnchor(); @@ -86,7 +86,7 @@ public: }; inline const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const - { return (const SwFmtAnchor&)Get( RES_ANCHOR,bInP); } + { return static_cast(Get(RES_ANCHOR, bInP)); } inline const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const { return aSet.GetAnchor(bInP); } diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 64cd8231f0ef..fbb90658098d 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -166,11 +166,11 @@ const short lOutlineMinTextDistance = 216; // 0.15 inch = 0.38 cm //Schnittstellen Bedeutung haben (SwDoc). enum RndStdIds { - FLY_AT_CNTNT, //Absatzgebundener Rahmen - FLY_IN_CNTNT, //Zeichengebundener Rahmen - FLY_PAGE, //Seitengebundener Rahmen - FLY_AT_FLY, //Rahmengebundener Rahmen ( LAYER_IMPL ) - FLY_AUTO_CNTNT, //Automatisch positionierter, absatzgebundener Rahmen + FLY_AT_PARA, // anchored at paragraph + FLY_AS_CHAR, // anchored as character + FLY_AT_PAGE, // anchored at page + FLY_AT_FLY, // anchored at frame + FLY_AT_CHAR, // anchored at character //Der Rest wird nur fuer SS benutzt. RND_STD_HEADER, RND_STD_FOOTER, -- cgit From eb1338534074029d8135c9a475cd301a8d11e3e3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: calbck.hxx: SwClientIter constructor takes a const& parameter --- sw/inc/calbck.hxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 7a8ff7f8f471..cde55aec812e 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -202,7 +202,7 @@ class SwClientIter friend SwClient* SwModify::_Remove(SwClient *); // fuer Ptr-Korrektur friend void SwModify::Add(SwClient *); // nur fuer ASSERT ! - SwModify& rRoot; + SwModify const& rRoot; SwClient *pAkt, *pDelNext; // fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von // Clients, wenn der Iterator gerade draufsteht. @@ -213,11 +213,10 @@ class SwClientIter TypeId aSrchId; // fuer First/Next - suche diesen Type public: - SW_DLLPUBLIC SwClientIter( SwModify& ); + SW_DLLPUBLIC SwClientIter( SwModify const& ); SW_DLLPUBLIC ~SwClientIter(); const SwModify& GetModify() const { return rRoot; } - SwModify& GetModify() { return rRoot; } #ifndef CFRONT SwClient* operator++(int); // zum Naechsten -- cgit From c00fbf426f2add382d18d99ed14a3c48b7d36afb Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: swtable.hxx: SwTable::FindTable() takes a const parameter --- sw/inc/swtable.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 1a62bb3d4dfd..800fd4bb4a18 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -299,7 +299,7 @@ public: virtual BOOL GetInfo( SfxPoolItem& ) const; // suche im Format nach der angemeldeten Tabelle - static SwTable* FindTable( SwFrmFmt* pFmt ); + static SwTable * FindTable( SwFrmFmt const*const pFmt ); // Struktur ein wenig aufraeumen void GCLines(); -- cgit From 92bbc112a283deee8796f09a1eaa49515979a548 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: #i105557#: remove unnecessary includes of unoobj.hxx --- sw/inc/chpfld.hxx | 4 +++- sw/inc/unochart.hxx | 10 ++++++++-- sw/inc/unofield.hxx | 8 ++++++-- sw/inc/unoidx.hxx | 15 +++++++++++++-- 4 files changed, 30 insertions(+), 7 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/chpfld.hxx b/sw/inc/chpfld.hxx index 08ebcf93bd5c..0edd6681da58 100644 --- a/sw/inc/chpfld.hxx +++ b/sw/inc/chpfld.hxx @@ -32,9 +32,11 @@ #include "fldbas.hxx" + class SwFrm; +class SwCntntNode; class SwTxtNode; -#include + enum SwChapterFormat { diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx index 955030cbada8..bc29daa21a4d 100644 --- a/sw/inc/unochart.hxx +++ b/sw/inc/unochart.hxx @@ -32,6 +32,8 @@ #include #include + +#include #include #include #include @@ -48,8 +50,8 @@ #include #include #include - #include + #include //OMultiTypeInterfaceContainerHelper #include // helper for implementations #include // helper for implementations @@ -57,17 +59,21 @@ #include // helper for implementations #include +#include +#include +#include #include -#include +class SfxItemPropertySet; class SwDoc; class SwTable; class SwTableBox; class SwUnoCrsr; struct SwRangeDescriptor; class SwSelBoxes; +class SwFrmFmt; ////////////////////////////////////////////////////////////////////// diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx index bef657b5b797..092a4bdc56a1 100644 --- a/sw/inc/unofield.hxx +++ b/sw/inc/unofield.hxx @@ -30,14 +30,18 @@ #ifndef _UNOFIELD_HXX #define _UNOFIELD_HXX -#include +#include #include #include +#include + +#include + #include -#include #include #include + class SwFieldType; class SwDoc; class SwFmtFld; diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index 5ea20f65c89d..ef503926ad1f 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -30,15 +30,26 @@ #ifndef _UNOIDX_HXX #define _UNOIDX_HXX +#include +#include +#include +#include +#include #include #include -#include -#include + +#include + +#include #include #include + + +class SfxItemPropertySet; class SwTOXBaseSection; class SwTOXMark; class SwTOXType; + /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -- cgit From 37dee57c4d5640e59c296c926a74a25342afdc2e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:43 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unorefmark.hxx: move SwXReferenceMark from unoobj.hxx to new unorefmark.hxx. --- sw/inc/unoobj.hxx | 73 ------------------ sw/inc/unorefmark.hxx | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+), 73 deletions(-) create mode 100644 sw/inc/unorefmark.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 08f5d2308b66..62cf34e1a580 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -99,7 +99,6 @@ class SwFmtFtn; -class SwFmtRefMark; class GetCurTxtFmtColl; @@ -1416,78 +1415,6 @@ public: //SwClient virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); }; -/* -----------------27.08.98 15:11------------------- - * - * --------------------------------------------------*/ -typedef ::cppu::WeakImplHelper5 -< - ::com::sun::star::text::XTextContent, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel -> -SwRefMarkBaseClass; - -class SwXReferenceMark : public SwRefMarkBaseClass, - public SwClient -{ - SwEventListenerContainer aLstnrCntnr; - SwDoc* pDoc; - const SwFmtRefMark* pMark; - String sMarkName; - BOOL m_bIsDescriptor; - - BOOL IsValid() const {return 0 != GetRegisteredIn();} - void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); -public: - SwXReferenceMark(SwDoc* pDoc, const SwFmtRefMark* pMark); - ~SwXReferenceMark(); - - TYPEINFO(); - - 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); - - //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 ); - - //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 ); - //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); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - 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 ); - - const SwFmtRefMark* GetMark()const {return pMark;} - const String& GetMarkName() const {return sMarkName;} - SwDoc* GetDoc() const{return pDoc;} - void Invalidate(); -}; #endif - diff --git a/sw/inc/unorefmark.hxx b/sw/inc/unorefmark.hxx new file mode 100644 index 000000000000..8a37b5655e9e --- /dev/null +++ b/sw/inc/unorefmark.hxx @@ -0,0 +1,199 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOREFMARK_HXX +#define SW_UNOREFMARK_HXX + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + + +class SwDoc; +class SwPaM; +class SwFmtRefMark; +class SwXTextCursor; + + +/* -----------------27.08.98 15:11------------------- + * + * --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextContent +> SwXReferenceMark_Base; + +class SwXReferenceMark + : public SwXReferenceMark_Base + , public SwClient +{ + +private: + + SwEventListenerContainer aLstnrCntnr; + SwDoc* pDoc; + const SwFmtRefMark* pMark; + String sMarkName; + BOOL m_bIsDescriptor; + + BOOL IsValid() const {return 0 != GetRegisteredIn();} + void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); + + virtual ~SwXReferenceMark(); + +public: + + SwXReferenceMark(SwDoc * pDoc, const SwFmtRefMark * pMark); + + 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); + + const SwFmtRefMark* GetMark() const {return pMark;} + const String& GetMarkName() const {return sMarkName;} + SwDoc* GetDoc() const {return pDoc;} + void Invalidate(); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + 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); + +}; + +#endif // SW_UNOREFMARK_HXX + -- cgit From a36e10b3749788ccfb5c79827f53af04301866e1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:43 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unobookmark.hxx: move SwXBookmark, SwXFieldmark from unoobj.hxx to new unobookmark.hxx. --- sw/inc/unobookmark.hxx | 248 +++++++++++++++++++++++++++++++++++++++++++++++++ sw/inc/unoobj.hxx | 113 +--------------------- 2 files changed, 249 insertions(+), 112 deletions(-) create mode 100644 sw/inc/unobookmark.hxx (limited to 'sw/inc') diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx new file mode 100644 index 000000000000..2b16d7828001 --- /dev/null +++ b/sw/inc/unobookmark.hxx @@ -0,0 +1,248 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOBOOKMARK_HXX +#define SW_UNOBOOKMARK_HXX + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + + +class SwDoc; + + +typedef ::cppu::ImplInheritanceHelper5 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextContent +> SwXBookmark_Base; + +class SwXBookmark + : public SwXBookmark_Base + , private SwClient +{ + +private: + + SwEventListenerContainer m_aLstnrCntnr; + SwDoc* m_pDoc; + String m_aName; + ::sw::mark::IMark* m_pRegisteredBookmark; + + void registerInMark(::sw::mark::IMark* const pBkmk); + +protected: + + virtual ~SwXBookmark(); + +public: + + SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); + + const ::sw::mark::IMark* GetBookmark() const + { return m_pRegisteredBookmark; } + ::sw::mark::IMark* GetBookmark() + { return m_pRegisteredBookmark; } + SwDoc* GetDoc() + { return m_pDoc; } + + 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); + + TYPEINFO(); + + // SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > GetModel(); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + 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); + +}; + +typedef cppu::ImplInheritanceHelper1< SwXBookmark, + ::com::sun::star::text::XFormField > SwXFieldmark_Base; + +class SwXFieldmark + : public SwXFieldmark_Base +{ + +private: + + bool isReplacementObject; + +public: + + SwXFieldmark(bool isReplacementObject, + ::sw::mark::IMark* 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() + 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 setDescription(const ::rtl::OUString& rDescription) + 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); + +}; + +#endif // SW_UNOBOOKMARK_HXX + diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 62cf34e1a580..74197ec9b2ba 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -86,12 +86,11 @@ #include "TextCursorHelper.hxx" #include #include -#include #include #include -#include +#include #include #include @@ -569,116 +568,6 @@ public: }; */ -typedef ::cppu::ImplInheritanceHelper5 -< - ::sfx2::MetadatableMixin, - ::com::sun::star::text::XTextContent, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel -> -SwBookmarkBaseClass; - -class SwXBookmark - : public SwBookmarkBaseClass - , private SwClient -{ - 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(); - - 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); - - //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 ); - - //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 ); - - //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, 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 ); - - // MetadatableMixin - virtual ::sfx2::Metadatable* GetCoreObject(); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel > GetModel(); - - const ::sw::mark::IMark* GetBookmark() const - { return m_pRegisteredBookmark; } - ::sw::mark::IMark* GetBookmark() - { 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, ::sw::mark::IMark* 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); -}; - /*-----------------23.02.98 10:45------------------- --------------------------------------------------*/ -- cgit From af7ef16cd1dd50610a5d89798a3ef68aa43de922 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:44 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unoparagraph.hxx: move SwXParagraph{,Enumeration} from unoobj.hxx to new unoparagraph.hxx. move enum CursorType to unobaseclass.hxx. --- sw/inc/unobaseclass.hxx | 21 +++ sw/inc/unoobj.hxx | 201 ---------------------- sw/inc/unoparagraph.hxx | 439 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 460 insertions(+), 201 deletions(-) create mode 100644 sw/inc/unoparagraph.hxx (limited to 'sw/inc') diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 17b6e6f5d080..adb7b880356a 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -43,5 +43,26 @@ cppu::WeakImplHelper2 > SwSimpleEnumerationBaseClass; + +/* -----------------29.04.98 07:35------------------- + * + * --------------------------------------------------*/ +enum CursorType +{ + CURSOR_INVALID, + CURSOR_BODY, + CURSOR_FRAME, + CURSOR_TBLTEXT, + CURSOR_FOOTNOTE, + CURSOR_HEADER, + CURSOR_FOOTER, + CURSOR_REDLINE, + CURSOR_ALL, // for Search&Replace + CURSOR_SELECTION, // create a paragraph enumeration from + // a text range or cursor + CURSOR_SELECTION_IN_TABLE, + CURSOR_META, // meta/meta-field +}; + #endif diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 74197ec9b2ba..54e652fc6816 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ #include #include -#include #include #include @@ -115,25 +113,6 @@ typedef ::std::deque< FrameDependSortListEntry > typedef ::std::deque< ::boost::shared_ptr > FrameDependList_t; -/* -----------------29.04.98 07:35------------------- - * - * --------------------------------------------------*/ -enum CursorType -{ - CURSOR_INVALID, - CURSOR_BODY, - CURSOR_FRAME, - CURSOR_TBLTEXT, - CURSOR_FOOTNOTE, - CURSOR_HEADER, - CURSOR_FOOTER, - CURSOR_REDLINE, - CURSOR_ALL, // fuer Search&Replace - CURSOR_SELECTION, // create a paragraph enumeration from a text range or cursor - CURSOR_SELECTION_IN_TABLE, - CURSOR_META, // meta/meta-field -}; - /* -----------------26.06.98 16:18------------------- * @@ -993,186 +972,6 @@ public: void Invalidate(); }; -/*-----------------07.04.98 08:10------------------- - ---------------------------------------------------*/ -class SwXParagraphEnumeration : public SwSimpleEnumerationBaseClass, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xNextPara; - - const SwTable * pOwnTable; - const SwStartNode * pOwnStartNode; // start node of the cell the enumeration - // belongs to. - // Used to restrict the movement of the - // UNO cursor to the cell and its - // embedded tables. - sal_Int32 nFirstParaStart; - sal_Int32 nLastParaEnd; - ULONG nEndIndex; - CursorType eCursorType; - BOOL bFirstParagraph; - - SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} - -protected: - virtual ~SwXParagraphEnumeration(); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > SAL_CALL NextElement_Impl(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - -public: - SwXParagraphEnumeration(SwXText* pParent, SwPosition& rPos, CursorType eType); - SwXParagraphEnumeration(SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); - - - - //XEnumeration - virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::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 ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - //non-Uno functions - - void SetOwnTable( const SwTable* pTable ) { pOwnTable = pTable; } - const SwTable* GetOwnTable() const { return pOwnTable; } - void SetOwnStartNode( const SwStartNode* pNode ) { pOwnStartNode = pNode; } - const SwStartNode* GetOwnStartNode() const { return pOwnStartNode; } -}; -/*-----------------07.04.98 08:15------------------- - ---------------------------------------------------*/ -class SwXParagraph : public cppu::ImplInheritanceHelper10 -< - ::sfx2::MetadatableMixin, - ::com::sun::star::beans::XTolerantMultiPropertySet, - ::com::sun::star::beans::XMultiPropertySet, - ::com::sun::star::text::XTextRange, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::text::XTextContent, - ::com::sun::star::container::XContentEnumerationAccess ->, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - rtl::OUString m_sText; - sal_Int32 nSelectionStartPos; - sal_Int32 nSelectionEndPos; - BOOL m_bIsDescriptor; - - -protected: - void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) 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); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( - const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, - sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); - - virtual ~SwXParagraph(); -public: - SwXParagraph(); - 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(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTolerantMultiPropertySet - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - - //XMultiPropertySet -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::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::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) 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); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::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 ); - - //XEnumerationAccess - war XTextPortionEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) 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 ); - - //XContentEnumerationAccess - 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;} - - const SwTxtNode * GetTxtNode() const; - SwTxtNode * GetTxtNode(); - - static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const rtl::OUString& rPropertyName, USHORT nWID = 0); - static SwXParagraph* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); - //falls es mal als Service erzeugt werden kann - //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 attachToText(SwXText & rParent, SwTxtNode & rTxtNode); -}; /* -----------------23.03.99 12:57------------------- * * --------------------------------------------------*/ diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx new file mode 100644 index 000000000000..6ef62e00c1a9 --- /dev/null +++ b/sw/inc/unoparagraph.hxx @@ -0,0 +1,439 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOPARAGRAPH_HXX +#define SW_UNOPARAGRAPH_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + + +class SfxItemPropertySet; +struct SwPosition; +class SwUnoCrsr; +class SwStartNode; +class SwTxtNode; +class SwTable; +class SwXText; + + +/*-----------------07.04.98 08:15------------------- + +--------------------------------------------------*/ +typedef ::cppu::ImplInheritanceHelper10 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertySet +, ::com::sun::star::beans::XTolerantMultiPropertySet +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::text::XTextContent +, ::com::sun::star::text::XTextRange +> SwXParagraph_Base; + +class SwXParagraph + : public SwXParagraph_Base + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + ::rtl::OUString m_sText; + sal_Int32 nSelectionStartPos; + sal_Int32 nSelectionEndPos; + BOOL m_bIsDescriptor; + +protected: + + void SAL_CALL SetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + 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); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL + GetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL + GetPropertyValuesTolerant_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + sal_Bool bDirectValuesOnly) + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXParagraph(); + +public: + + SwXParagraph(); + 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); + + BOOL IsDescriptor() const {return m_bIsDescriptor;} + + const SwTxtNode * GetTxtNode() const; + SwTxtNode * GetTxtNode(); + + static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); + static SwXParagraph* GetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> xRef); + void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::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::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XTolerantMultiPropertySet + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL + setPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL + getPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL + getDirectPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + 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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + 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); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + +}; + + +/*-----------------07.04.98 08:10------------------- + +--------------------------------------------------*/ +class SwXParagraphEnumeration + : public SwSimpleEnumerationBaseClass + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + xParentText; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > + xNextPara; + + const SwTable * pOwnTable; + /// Start node of the cell the enumeration belongs to. + /// Used to restrict the movement of the UNO cursor to the cell and its + /// embedded tables. + const SwStartNode * pOwnStartNode; + sal_Int32 nFirstParaStart; + sal_Int32 nLastParaEnd; + ULONG nEndIndex; + CursorType eCursorType; + BOOL bFirstParagraph; + + SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} + +protected: + + virtual ~SwXParagraphEnumeration(); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > SAL_CALL + NextElement_Impl() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +public: + + SwXParagraphEnumeration( + SwXText* pParent, SwPosition& rPos, CursorType eType); + SwXParagraphEnumeration( + SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); + + // non-Uno functions + + void SetOwnTable(const SwTable* pTable) + { pOwnTable = pTable; } + const SwTable* GetOwnTable() const + { return pOwnTable; } + void SetOwnStartNode(const SwStartNode* pNode) + { pOwnStartNode = pNode; } + const SwStartNode* GetOwnStartNode() const + { return pOwnStartNode; } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumeration + virtual sal_Bool SAL_CALL hasMoreElements() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOPARAGRAPH_HXX + -- cgit From a04b8cd2adec9a16a9989670160634d588a15a87 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:44 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unosection.hxx: move SwXTextSection from unoobj.hxx to new unosection.hxx. --- sw/inc/unoframe.hxx | 1 + sw/inc/unoobj.hxx | 126 ------------------- sw/inc/unosection.hxx | 337 ++++++++++++++++++++++++++++++++++++++++++++++++++ sw/inc/unotbl.hxx | 1 + 4 files changed, 339 insertions(+), 126 deletions(-) create mode 100644 sw/inc/unosection.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index a02999c8ca3d..4f62430f1cc2 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 54e652fc6816..c4e6a3035ccd 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -58,9 +57,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -77,7 +74,6 @@ #include // helper for implementations #include // helper for implementations #include // helper for implementations -#include // helper for implementations #include #include #include @@ -754,128 +750,6 @@ public: const SwUnoCrsr* GetCursor() const { return (const SwUnoCrsr*)GetRegisteredIn(); } }; -/*-----------------09.03.98 13:57------------------- - ---------------------------------------------------*/ - -class SwXTextSection; -class SwXTextSectionClient : public SwClient -{ - friend class SwXTextSection; - SwXTextSection* m_pSection; - ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XTextSection > m_xReference; - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - SwXTextSectionClient( - SwSectionFmt& rFmt, - SwXTextSection& rTextSection, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > xSection ); - virtual ~SwXTextSectionClient(); - DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, - SwXTextSectionClient* ); - -public: - TYPEINFO(); - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > GetXTextSection(); - - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > - CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE ); - static SwXTextSectionClient* Create( - SwXTextSection& rSection, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > xSection, - SwSectionFmt& rFmt ); -}; - -struct SwTextSectionProperties_Impl; -class SwXTextSection : public cppu::WeakImplHelper7 -< - ::com::sun::star::text::XTextSection, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XMultiPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel ->/*, - public SwClient*/ -{ - friend class SwXTextSectionClient; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - - BOOL m_bIsDescriptor; - BOOL m_bIndexHeader; - String m_sName; - SwTextSectionProperties_Impl* pProps; - SwXTextSectionClient* m_pClient; -protected: - void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) 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); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); - virtual ~SwXTextSection(); - void ResetClient() {m_pClient = 0;} - void SetClient( SwXTextSectionClient* pClient ){m_pClient = pClient;} - -public: - 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); - - //XTextSection - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > SAL_CALL getParentSection(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > > SAL_CALL getChildSections(void) 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 ); - - //XMultiPropertySet -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::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::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) 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); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::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 ); - - //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 ); - - //SwClient -// virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - 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 ); - - SwSectionFmt* GetFmt()const; - static SwXTextSection* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); -}; /*-----------------12.02.98 08:01------------------- --------------------------------------------------*/ diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx new file mode 100644 index 000000000000..31d15d7010d4 --- /dev/null +++ b/sw/inc/unosection.hxx @@ -0,0 +1,337 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOSECTION_HXX +#define SW_UNOSECTION_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + + +class SfxItemPropertySet; +class SwSectionFmt; + + +/*-----------------09.03.98 13:57------------------- + +--------------------------------------------------*/ + +class SwXTextSection; + +class SwXTextSectionClient + : public SwClient +{ + +private: + + friend class SwXTextSection; + + SwXTextSection * m_pSection; + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection > m_xReference; + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwXTextSectionClient( + SwSectionFmt& rFmt, + SwXTextSection& rTextSection, + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > xSection); + + virtual ~SwXTextSectionClient(); + + DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, + SwXTextSectionClient* ); + +public: + + TYPEINFO(); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > + GetXTextSection(); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > + CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE); + static SwXTextSectionClient* Create( + SwXTextSection& rSection, + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > xSection, + SwSectionFmt& rFmt); +}; + + +struct SwTextSectionProperties_Impl; + +typedef ::cppu::WeakImplHelper7 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextSection +> SwXTextSection_Base; + +class SwXTextSection + : public SwXTextSection_Base +{ + +private: + + friend class SwXTextSectionClient; + + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + + BOOL m_bIsDescriptor; + BOOL m_bIndexHeader; + String m_sName; + SwTextSectionProperties_Impl* pProps; + SwXTextSectionClient* m_pClient; + +protected: + + void SAL_CALL SetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& aValues) + 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); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL + GetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); + + virtual ~SwXTextSection(); + + void ResetClient() { m_pClient = 0; } + void SetClient(SwXTextSectionClient* pClient) { m_pClient = pClient; } + +public: + + 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); + + SwSectionFmt* GetFmt() const; + + static SwXTextSection* GetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> xRef); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::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::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + 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); + + // XTextSection + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > SAL_CALL + getParentSection() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > > SAL_CALL + getChildSections() + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOSECTION_HXX + diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index a8ca07bb0f34..7e28a5a2d116 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -31,6 +31,7 @@ #define _UNOTBL_HXX #include +#include #include #include #include -- cgit From 3d404991d52a130cf2144bcf3aec2ea52859d31f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:45 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotextcursor.hxx: move SwXTextCursor from unoobj.hxx to new unotextcursor.hxx. move enum SwGetPropertyStatesCaller to unotextcursor.hxx. --- sw/inc/unoobj.hxx | 222 +---------------------- sw/inc/unotbl.hxx | 5 + sw/inc/unotextcursor.hxx | 461 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 467 insertions(+), 221 deletions(-) create mode 100644 sw/inc/unotextcursor.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index c4e6a3035ccd..98bee1bf0e93 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -42,24 +42,16 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -77,13 +69,9 @@ #include #include #include -#include // helper for implementations -#include "TextCursorHelper.hxx" -#include #include #include -#include #include @@ -169,8 +157,8 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); /* -----------------03.12.98 12:22------------------- * * --------------------------------------------------*/ +class OTextCursorHelper; class SwXTextRange; -class SwXTextCursor; class SwXText : public ::com::sun::star::lang::XTypeProvider, public ::com::sun::star::text::XTextRangeCompare, public ::com::sun::star::text::XRelativeTextContentInsert, @@ -285,214 +273,6 @@ public: CursorType GetTextType() {return eCrsrType;} }; -/* -----------------03.12.98 12:16------------------- - * - * --------------------------------------------------*/ -enum SwGetPropertyStatesCaller -{ - SW_PROPERTY_STATE_CALLER_DEFAULT, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, - SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT -}; -#define CRSR_ATTR_MODE_TABLE 1 //attributes should be applied to a table selection -#define CRSR_ATTR_MODE_DONTREPLACE 2 //attributes should be added, not replaced - -typedef cppu::WeakImplHelper12< - ::com::sun::star::text::XSentenceCursor, - ::com::sun::star::text::XWordCursor, - ::com::sun::star::text::XParagraphCursor, - ::com::sun::star::text::XRedline, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::document::XDocumentInsertable, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::util::XSortable, - ::com::sun::star::container::XContentEnumerationAccess, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::beans::XMultiPropertyStates - > SwXTextCursor_Base; -class SwXTextCursor : public SwXTextCursor_Base, - public SwClient, - public OTextCursorHelper -{ - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwSortOptions* pLastSortOptions; - - CursorType eType; - - // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl - // user event has been posted. In this case we have to remove the user - // event in ~SwXTextCursor(). - ULONG mnUserEventId; - bool mbRemoveUserEvent; - // <-- - - DECL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface>* ); - -protected: - virtual ~SwXTextCursor(); -public: - void DeleteAndInsert(const String& rText, const bool bForceExpandHints); - SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, const SwPosition& rPos, - CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); - SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - DECLARE_XINTERFACE() - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextCursor - neu - virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL goLeft( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL goRight( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoStart( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoEnd( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - - //XWordCursor - neu - virtual BOOL SAL_CALL isStartOfWord( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isEndOfWord( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoNextWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoPreviousWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoEndOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoStartOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - - //XSentenceCursor - neu - virtual BOOL SAL_CALL isStartOfSentence( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isEndOfSentence( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoNextSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoPreviousSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoStartOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoEndOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - - //ParagraphCursor - neu - virtual BOOL SAL_CALL isStartOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL isEndOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoStartOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoEndOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoNextParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoPreviousParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - - //XRedline - 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); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) 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); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - static void SetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const rtl::OUString& rPropertyName, - const ::com::sun::star::uno::Any& aValue, - USHORT nAttrMode = 0) - 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); - static ::com::sun::star::uno::Any GetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > GetPropertyStates( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller = SW_PROPERTY_STATE_CALLER_DEFAULT) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::beans::PropertyState GetPropertyState( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static void SetPropertyToDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XDocumentInsertable - neu - virtual void SAL_CALL insertDocumentFromURL(const rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); - - //XSortable - neu - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException ); - - //XContentEnumerationAccess - 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 ); - - //XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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 ); - - //XMultiPropertyStates - //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - virtual const SwPaM* GetPaM() const; - virtual SwPaM* GetPaM(); - virtual const SwDoc* GetDoc() const; - virtual SwDoc* GetDoc(); - SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} - const SwUnoCrsr* GetCrsr()const{return (SwUnoCrsr*)GetRegisteredIn();} - - static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAttrMode ); - // --> OD 2006-07-12 #i63870# - // split third parameter into new parameters - // and to get better control about resulting -// static void GetCrsrAttr(SwPaM& rPam, SfxItemSet& rSet, BOOL bCurrentAttrOnly = FALSE); - static void GetCrsrAttr( SwPaM& rPam, - SfxItemSet& rSet, - BOOL bOnlyTxtAttr = FALSE, - BOOL bGetFromChrFmt = TRUE ); - // <-- - static void getTextFromPam(SwPaM& aCrsr, rtl::OUString& rBuffer); - static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); - - static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); - static void SetString(SwCursor& rCrsr, const rtl::OUString& rString); - - static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - createSortDescriptor(sal_Bool bFromTable); - static sal_Bool convertSortProperties( - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor, - SwSortOptions& rSortOpt); - - // --> FME 2006-03-07 #126177# - void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } - // <-- - - bool IsAtEndOfMeta() const; -}; /*-----------------20.03.98 07:47------------------- --------------------------------------------------*/ diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 7e28a5a2d116..fa82f1b63aa3 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,10 @@ #include // helper for implementations #include // helper for implementations +#include +#include + + class SwTableBoxFmt; class SwTableLine; class SwTableCursor; diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx new file mode 100644 index 000000000000..ce91bd295267 --- /dev/null +++ b/sw/inc/unotextcursor.hxx @@ -0,0 +1,461 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTCURSOR_HXX +#define SW_UNOTEXTCURSOR_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + + +class SfxItemSet; +class SfxItemPropertySet; +class SwDoc; +struct SwPosition; +class SwCursor; +class SwUnoCrsr; +class SwFmtColl; +struct SwSortOptions; + + +/* -----------------03.12.98 12:16------------------- + * + * --------------------------------------------------*/ +enum SwGetPropertyStatesCaller +{ + SW_PROPERTY_STATE_CALLER_DEFAULT, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT +}; + +/// attributes should be applied to a table selection +#define CRSR_ATTR_MODE_TABLE 1 +/// attributes should be added, not replaced +#define CRSR_ATTR_MODE_DONTREPLACE 2 + +typedef ::cppu::WeakImplHelper12 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertyStates +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::util::XSortable +, ::com::sun::star::document::XDocumentInsertable +, ::com::sun::star::text::XSentenceCursor +, ::com::sun::star::text::XWordCursor +, ::com::sun::star::text::XParagraphCursor +, ::com::sun::star::text::XRedline +> SwXTextCursor_Base; + +class SwXTextCursor + : public SwXTextCursor_Base + , public SwClient + , public OTextCursorHelper +{ + +private: + + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwSortOptions* pLastSortOptions; + + CursorType eType; + + // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl + // user event has been posted. In this case we have to remove the user + // event in ~SwXTextCursor(). + ULONG mnUserEventId; + bool mbRemoveUserEvent; + // <-- + + DECL_STATIC_LINK(SwXTextCursor, RemoveCursor_Impl, + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*); + +protected: + + virtual ~SwXTextCursor(); + +public: + + SwXTextCursor( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > xParent, + const SwPosition& rPos, + CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); + SwXTextCursor( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > xParent, + SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); + + SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} + const SwUnoCrsr* GetCrsr() const {return (SwUnoCrsr*)GetRegisteredIn();} + + // --> FME 2006-03-07 #126177# + void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } + // <-- + + bool IsAtEndOfMeta() const; + + void DeleteAndInsert(const String& rText, + const bool bForceExpandHints); + + static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, + USHORT nAttrMode); + static void GetCrsrAttr( SwPaM& rPam, SfxItemSet& rSet, + BOOL bOnlyTxtAttr = FALSE, BOOL bGetFromChrFmt = TRUE ); + static void getTextFromPam(SwPaM& aCrsr, ::rtl::OUString& rBuffer); + static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); + + static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); + static void SetString(SwCursor& rCrsr, const ::rtl::OUString& rString); + + static ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + createSortDescriptor(sal_Bool bFromTable); + static sal_Bool convertSortProperties( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rDescriptor, + SwSortOptions& rSortOpt); + + static void SetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& aValue, + USHORT nAttrMode = 0) + 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); + static ::com::sun::star::uno::Any GetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > GetPropertyStates( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::beans::PropertyState GetPropertyState( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static void SetPropertyToDefault( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Any GetPropertyDefault( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + virtual const SwPaM* GetPaM() const; + virtual SwPaM* GetPaM(); + virtual const SwDoc* GetDoc() const; + virtual SwDoc* GetDoc(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + DECLARE_XINTERFACE() + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertyStates + virtual void SAL_CALL setAllPropertiesToDefault() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyDefaults( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XSortable + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > SAL_CALL + createSortDescriptor() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL sort( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& xDescriptor) + throw (::com::sun::star::uno::RuntimeException); + + // XDocumentInsertable + virtual void SAL_CALL insertDocumentFromURL( + const ::rtl::OUString& rURL, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rOptions) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XTextCursor + virtual void SAL_CALL collapseToStart() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL collapseToEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isCollapsed() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goLeft(sal_Int16 nCount, sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goRight(sal_Int16 nCount, sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoStart(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoEnd(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xRange, + sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + + // XWordCursor + virtual sal_Bool SAL_CALL isStartOfWord() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfWord() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + + // XSentenceCursor + virtual sal_Bool SAL_CALL isStartOfSentence() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfSentence() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + + // XParagraphCursor + virtual sal_Bool SAL_CALL isStartOfParagraph() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfParagraph() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + + // XRedline + virtual void SAL_CALL makeRedline( + const ::rtl::OUString& rRedlineType, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& RedlineProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXTCURSOR_HXX + -- cgit From e23c9ccd3e9e8d415d0bbab189e2de5ba48b42e9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:46 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotextrange.hxx: move SwXTextRange, SwXTextRanges from unoobj.hxx to new unotextrange.hxx. move SwUnoInternalPaM to unotextrange.hxx. --- sw/inc/unoframe.hxx | 8 +- sw/inc/unoobj.hxx | 184 ------------------------ sw/inc/unotbl.hxx | 9 +- sw/inc/unotextrange.hxx | 376 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 389 insertions(+), 188 deletions(-) create mode 100644 sw/inc/unotextrange.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 4f62430f1cc2..470303ab92ed 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -31,7 +31,7 @@ #define _UNOFRAME_HXX #include -#include +#include #include #include #include @@ -43,8 +43,14 @@ #include */ +#include + +#include + + class SwDoc; class SfxItemPropertSet; + /*-----------------12.02.98 11:21------------------- --------------------------------------------------*/ diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 98bee1bf0e93..fa6600b14107 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -35,46 +35,35 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include -#include #include #include #include -#include -#include #include -#include #include #include #include #include #include -#include #include #include // helper for factories #include // helper for implementations -#include // helper for implementations #include // helper for implementations #include // helper for implementations #include // helper for implementations -#include #include #include #include #include -#include - #include #include @@ -110,19 +99,6 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, FrameDependSortList_t & rFrames, const bool _bAtCharAnchoredObjs ); -/* -----------------29.04.98 07:35------------------- - * - * --------------------------------------------------*/ -class SwUnoInternalPaM : public SwPaM -{ - SwUnoInternalPaM( const SwUnoInternalPaM& ); -public: - SwUnoInternalPaM(SwDoc& rDoc); - ~SwUnoInternalPaM(); - - SwUnoInternalPaM& operator=(const SwPaM& rPaM); -}; - /*-----------------04.03.98 11:54------------------- Start/EndAction oder Start/EndAllAction --------------------------------------------------*/ @@ -149,8 +125,6 @@ class UnoActionRemoveContext /****************************************************************************** * ******************************************************************************/ -typedef com::sun::star::uno::Reference< com::sun::star::text::XTextRange > * XTextRangeRefPtr; -SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -371,164 +345,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); }; -class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 -< - ::com::sun::star::text::XTextRange, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XContentEnumerationAccess, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::text::XRedline ->, private SwClient -{ - friend class SwXText; - enum RangePosition - { - RANGE_IN_TEXT, // 'normaler' ::com::sun::star::text::TextRange - RANGE_IN_FRAME,// TextPosition wurde mit einem Rahmen angelegt, der kein Uno-Objekt besitzt - RANGE_IN_CELL, // TextPosition wurde mit einer Zelle angelegt, die kein Uno-Objekt besitzt - RANGE_IS_TABLE, // Anker einer Tabelle - RANGE_INVALID // von NewInstance erzeugt - } eRangePosition; - - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden - const SfxItemPropertySet* m_pPropSet; - //SwDepend aFrameDepend; - ::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 - void DeleteAndInsert(const String& rText, const bool bForceExpandHints) - 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, 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(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XContentEnumerationAccess - 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 ); - - //XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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 ); - - //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); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XRedline - 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; } - const ::sw::mark::IMark * 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); - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, - const SwPosition& rPos); -}; - -/* -----------------15.05.98 08:29------------------- - * - * --------------------------------------------------*/ -typedef cppu::WeakImplHelper3 -< - ::com::sun::star::container::XIndexAccess, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::lang::XServiceInfo -> -SwXTextRangesBaseClass; -class SwXTextRanges : public SwXTextRangesBaseClass, - public SwClient -{ - XTextRangeArr* pRangeArr; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - XTextRangeArr* GetRangesArray(); - SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } -protected: - virtual ~SwXTextRanges(); -public: - SwXTextRanges(); - SwXTextRanges(SwPaM* pCrsr); - - - 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); - - - //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 ); - - //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 ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - const SwUnoCrsr* GetCursor() const { return (const SwUnoCrsr*)GetRegisteredIn(); } -}; /*-----------------12.02.98 08:01------------------- diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index fa82f1b63aa3..c14dac1bc2d0 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -41,11 +41,14 @@ #include #include #include -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations + +#include +#include +#include +#include #include + #include diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx new file mode 100644 index 000000000000..a7d13daf4848 --- /dev/null +++ b/sw/inc/unotextrange.hxx @@ -0,0 +1,376 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTRANGE_HXX +#define SW_UNOTEXTRANGE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + + +class String; +class SfxItemPropertySet; +class SwDoc; +class SwStartNode; +struct SwPosition; +class SwPaM; +class SwUnoCrsr; +class SwFrmFmt; +class SwTableBox; + +namespace sw { + namespace mark { + class IMark; + } +} + +/* -----------------29.04.98 07:35------------------- + * + * --------------------------------------------------*/ +class SwUnoInternalPaM + : public SwPaM +{ + +private: + SwUnoInternalPaM(const SwUnoInternalPaM&); + SwUnoInternalPaM& operator=(const SwPaM& rPaM); + +public: + SwUnoInternalPaM(SwDoc& rDoc); + virtual ~SwUnoInternalPaM(); + +}; + + +typedef ::cppu::WeakImplHelper8 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::text::XTextRange +, ::com::sun::star::text::XRedline +> SwXTextRange_Base; + +class SW_DLLPUBLIC SwXTextRange + : public SwXTextRange_Base + , private SwClient +{ + +private: + + friend class SwXText; + + enum RangePosition + { + RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange + RANGE_IN_FRAME, // position created with a frame that has no uno object + RANGE_IN_CELL, // position created with a cell that has no uno object + RANGE_IS_TABLE, // anchor of a table + RANGE_INVALID // created by NewInstance + } eRangePosition; + + SwDoc* pDoc; + SwTableBox* pBox; + const SwStartNode* pBoxStartNode; + SwDepend aObjectDepend; // register at format of table or frame + const SfxItemPropertySet* m_pPropSet; + //SwDepend aFrameDepend; + ::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 + void DeleteAndInsert(const String& rText, const bool bForceExpandHints) + throw (::com::sun::star::uno::RuntimeException); + +protected: + + virtual ~SwXTextRange(); + +public: + + SwXTextRange(SwPaM& rPam, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > & xParent, + enum RangePosition eRange = RANGE_IN_TEXT); + // only for RANGE_IS_TABLE + SwXTextRange(SwFrmFmt& rTblFmt); + + BOOL GetPositions(SwPaM& rToFill) const; + const SwDoc* GetDoc() const + { return pDoc; } + SwDoc* GetDoc() + { return pDoc; } + const ::sw::mark::IMark * 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); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XRedline + virtual void SAL_CALL makeRedline( + const ::rtl::OUString& rRedlineType, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& RedlineProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +/* -----------------15.05.98 08:29------------------- + * + * --------------------------------------------------*/ +typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > * + XTextRangeRefPtr; +SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) + +typedef ::cppu::WeakImplHelper3 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XIndexAccess +> SwXTextRanges_Base; + +class SwXTextRanges + : public SwXTextRanges_Base + , public SwClient +{ + +private: + + XTextRangeArr* pRangeArr; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + xParentText; + XTextRangeArr* GetRangesArray(); + SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } + +protected: + + virtual ~SwXTextRanges(); + +public: + + SwXTextRanges(); + SwXTextRanges(SwPaM* pCrsr); + + const SwUnoCrsr* GetCursor() const { + return (const SwUnoCrsr*)(GetRegisteredIn()); + } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + 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); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() + 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); + +}; + +#endif // SW_UNOTEXTRANGE_HXX + -- cgit From a6b34b60ba3e7451cfa8d5a492d53484ec131421 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:47 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotext.hxx etc.: move SwXText from unoobj.hxx to new unotext.hxx. move SwXBodyText, SwXHeadFootText from unoobj.hxx to new unotextbodyhf.hxx. move SwXFootnote from unoobj.hxx to new unofootnote.hxx. --- sw/inc/unofootnote.hxx | 246 +++++++++++++++++++++++++++++++ sw/inc/unoframe.hxx | 18 ++- sw/inc/unoobj.hxx | 326 ---------------------------------------- sw/inc/unoredline.hxx | 4 +- sw/inc/unotbl.hxx | 13 +- sw/inc/unotext.hxx | 375 +++++++++++++++++++++++++++++++++++++++++++++++ sw/inc/unotextbodyhf.hxx | 218 +++++++++++++++++++++++++++ 7 files changed, 864 insertions(+), 336 deletions(-) create mode 100644 sw/inc/unofootnote.hxx create mode 100644 sw/inc/unotext.hxx create mode 100644 sw/inc/unotextbodyhf.hxx (limited to 'sw/inc') diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx new file mode 100644 index 000000000000..d1c869404d32 --- /dev/null +++ b/sw/inc/unofootnote.hxx @@ -0,0 +1,246 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOFOOTNOTE_HXX +#define SW_UNOFOOTNOTE_HXX + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + + +class SwDoc; +class SwFmtFtn; + + +/*-----------------12.02.98 08:01------------------- + +--------------------------------------------------*/ +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::text::XFootnote +> SwXFootnote_Base; + +class SwXFootnote + : public SwXFootnote_Base + , public SwXText + , public SwClient +{ + +private: + + friend class SwXFootnotes; + + SwEventListenerContainer aLstnrCntnr; + const SwFmtFtn* pFmtFtn; + BOOL m_bIsDescriptor; + String m_sLabel; + BOOL m_bIsEndnote; + +protected: + + virtual const SwStartNode *GetStartNode() const; + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + createCursor() + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXFootnote(); + +public: + + SwXFootnote(BOOL bEndnote); + SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); + + 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); + + const SwFmtFtn* FindFmt() const { return GetDoc() ? pFmtFtn : 0; } + void Invalidate(); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + 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 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + 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); + + // XFootnote + virtual ::rtl::OUString SAL_CALL getLabel() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabel(const ::rtl::OUString& rLabel) + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOFOOTNOTE_HXX + diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 470303ab92ed..d681e520d028 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -30,26 +30,34 @@ #ifndef _UNOFRAME_HXX #define _UNOFRAME_HXX -#include #include #include +#include #include #include #include #include #include #include - /* -#include - */ +#include #include +#include #include +#include +#include +#include +#include + -class SwDoc; class SfxItemPropertSet; +class SdrObject; +class SwDoc; +class SwFmt; +class SwFlyFrmFmt; + /*-----------------12.02.98 11:21------------------- diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index fa6600b14107..d43a4a7105e1 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -36,28 +36,14 @@ #include #include #include -#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include #include #include // helper for factories -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations #include #include #include @@ -68,7 +54,6 @@ #include -class SwFmtFtn; class GetCurTxtFmtColl; @@ -128,124 +113,6 @@ class UnoActionRemoveContext void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); -/* -----------------03.12.98 12:22------------------- - * - * --------------------------------------------------*/ -class OTextCursorHelper; -class SwXTextRange; -class SwXText : public ::com::sun::star::lang::XTypeProvider, - public ::com::sun::star::text::XTextRangeCompare, - public ::com::sun::star::text::XRelativeTextContentInsert, - public ::com::sun::star::text::XRelativeTextContentRemove, - public ::com::sun::star::beans::XPropertySet, - public ::com::sun::star::lang::XUnoTunnel, - public ::com::sun::star::text::XTextAppendAndConvert -{ - SwDoc* pDoc; - BOOL bObjectValid; - CursorType eCrsrType; - const SfxItemPropertySet* m_pPropSet; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishOrAppendParagraph( - bool bFinish, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) - throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - virtual void PrepareForAttach( ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xRange, - const SwXTextRange* const pRange, const SwPaM * const pPam); - -public: /*not protected because C++ is retarded*/ - virtual const SwStartNode *GetStartNode() const; - -public: - SwXText(SwDoc* pDc, CursorType eType); - virtual ~SwXText(); - - const SwDoc* GetDoc()const {return pDoc;} - SwDoc* GetDoc() {return pDoc;} - - // wenn ein SwXText attached wird, wird das Doc gesetzt - void SetDoc(SwDoc* pDc) - {DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); - pDoc = pDc; - bObjectValid = 0 != pDc; - } - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual void SAL_CALL insertString(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const rtl::OUString& aString, BOOL bAbsorb) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL insertControlCharacter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, sal_Int16 nControlCharacter, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL insertTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XTextRangeCompare - sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XRelativeTextContentInsert - virtual void SAL_CALL insertTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XRelativeTextContentRemove - virtual void SAL_CALL removeTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::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); - - //XUnoTunnel - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XParagraphAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextPortionAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextPortion( const ::rtl::OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextContentAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& TextContent, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextConvert - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > SAL_CALL convertToTextFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& Start, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& End, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& FrameProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTable > SAL_CALL convertToTable( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > > > >& TableRanges, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > >& CellProperties, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& RowProperties, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& TableProperties - ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - - // - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - INT16 ComparePositions(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos2) throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException); - BOOL CheckForOwnMember(const SwXTextRange* pRange1, const OTextCursorHelper* pCursor1)throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - // - void Invalidate() {bObjectValid = sal_False;} - BOOL IsValid()const {return bObjectValid;} - - CursorType GetTextType() {return eCrsrType;} -}; /*-----------------20.03.98 07:47------------------- @@ -301,147 +168,6 @@ public: --------------------------------------------------*/ -typedef cppu::WeakAggImplHelper2 -< - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::lang::XServiceInfo -> SwXBodyTextBaseClass; -class SwXBodyText : public SwXBodyTextBaseClass, - public SwXText -{ -protected: - virtual ~SwXBodyText(); -public: - SwXBodyText(SwDoc* pDoc); - - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();} - virtual void SAL_CALL release( ) throw(){OWeakObject::release();} - - //XAggregation - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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 ); - - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); -}; - - -/*-----------------12.02.98 08:01------------------- - ---------------------------------------------------*/ -typedef -cppu::WeakImplHelper5 -< - ::com::sun::star::text::XFootnote, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XUnoTunnel -> -SwXFootnoteBaseClass; -class SwXFootnote : public SwXFootnoteBaseClass, - public SwXText, - public SwClient -{ - friend class SwXFootnotes; - - SwEventListenerContainer aLstnrCntnr; - const SwFmtFtn* pFmtFtn; - BOOL m_bIsDescriptor; - String m_sLabel; - BOOL m_bIsEndnote; - -protected: - virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - virtual ~SwXFootnote(); -public: - SwXFootnote(BOOL bEndnote); - SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); - - - TYPEINFO(); - - 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); - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){SwXFootnoteBaseClass::acquire();} - virtual void SAL_CALL release( ) throw(){SwXFootnoteBaseClass::release();} - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XFootnote - virtual rtl::OUString SAL_CALL getLabel(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setLabel(const rtl::OUString& aLabel) 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 ); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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 ); - - //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); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - 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 ); - - const SwFmtFtn* FindFmt() const {return GetDoc() ? pFmtFtn : 0;} - void Invalidate(); -}; - /* -----------------23.03.99 12:57------------------- * * --------------------------------------------------*/ @@ -521,58 +247,6 @@ public: void SetSortOptions(const SwSortOptions& rSortOpt); }; */ -/* -----------------25.08.98 11:02------------------- - * - * --------------------------------------------------*/ -typedef -cppu::WeakImplHelper2 -< - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XEnumerationAccess -> -SwXHeadFootTextBaseClass; -class SwXHeadFootText : public SwXHeadFootTextBaseClass, - public SwXText, - public SwClient -{ - SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } - BOOL bIsHeader; -protected: - virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); -public: - SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); - ~SwXHeadFootText(); - - TYPEINFO(); - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){SwXHeadFootTextBaseClass::acquire();} - virtual void SAL_CALL release( ) throw(){SwXHeadFootTextBaseClass::release();} - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) 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 ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) 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); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); -}; #endif diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx index 5730c6e55ff0..b46189734301 100644 --- a/sw/inc/unoredline.hxx +++ b/sw/inc/unoredline.hxx @@ -31,9 +31,11 @@ #define _UNOREDLINE_HXX #include -#include +#include + class SwRedline; + /* -----------------------------19.12.00 11:35-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index c14dac1bc2d0..d2e14309a5d4 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -30,8 +30,8 @@ #ifndef _UNOTBL_HXX #define _UNOTBL_HXX -#include #include +#include #include #include #include @@ -43,22 +43,27 @@ #include #include +#include #include #include #include #include +#include #include +#include +#include -class SwTableBoxFmt; +class SwUnoCrsr; +class SwTable; +class SwTableBox; class SwTableLine; class SwTableCursor; class SwTableBoxFmt; -class SwTableLine; -class SwTableCursor; class SwChartDataProvider; +class SwFrmFmt; /* -----------------------------22.09.00 11:10-------------------------------- diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx new file mode 100644 index 000000000000..499e0620dae4 --- /dev/null +++ b/sw/inc/unotext.hxx @@ -0,0 +1,375 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXT_HXX +#define SW_UNOTEXT_HXX + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + +namespace com { namespace sun { namespace star { + namespace text { + class XTextContent; + } +} } } + +class SfxItemPropertySet; +class SwDoc; +class SwStartNode; +class SwPaM; +class OTextCursorHelper; +class SwXTextRange; + + +/* -----------------03.12.98 12:22------------------- + * + * --------------------------------------------------*/ + +class SwXText + : public ::com::sun::star::lang::XTypeProvider + , public ::com::sun::star::lang::XUnoTunnel + , public ::com::sun::star::beans::XPropertySet + , public ::com::sun::star::text::XTextAppendAndConvert + , public ::com::sun::star::text::XTextRangeCompare + , public ::com::sun::star::text::XRelativeTextContentInsert + , public ::com::sun::star::text::XRelativeTextContentRemove +{ + +private: + + SwDoc* pDoc; + BOOL bObjectValid; + CursorType eCrsrType; + const SfxItemPropertySet* m_pPropSet; + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + finishOrAppendParagraph( + bool bFinish, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + virtual void PrepareForAttach( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + SwXTextRange const * const pRange, SwPaM const * const pPam); + +protected: + + virtual ~SwXText(); + +public: /*not protected because C++ is retarded*/ + virtual const SwStartNode *GetStartNode() const; + +public: + + SwXText(SwDoc* pDc, CursorType eType); + + const SwDoc* GetDoc() const { return pDoc; } + SwDoc* GetDoc() { return pDoc; } + + // SwDoc is set when SwXText is attached + void SetDoc(SwDoc* pDc) { + DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); + pDoc = pDc; + bObjectValid = 0 != pDc; + } + + void Invalidate() { bObjectValid = sal_False; } + BOOL IsValid() const { return bObjectValid; } + + CursorType GetTextType() { return eCrsrType; } + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > createCursor() + throw (::com::sun::star::uno::RuntimeException); + INT16 ComparePositions( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange>& xPos1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange>& xPos2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + BOOL CheckForOwnMember(const SwXTextRange* pRange1, + const OTextCursorHelper* pCursor1) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual bool CheckForOwnMemberMeta( + const SwXTextRange* const pRange, + const SwPaM* const pPam, bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + + 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 >& rIdentifier) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual void SAL_CALL insertString( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + const ::rtl::OUString& aString, sal_Bool bAbsorb) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertControlCharacter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + sal_Int16 nControlCharacter, sal_Bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XText + virtual void SAL_CALL insertTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > & xContent, + sal_Bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > & xContent) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + + // XParagraphAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendParagraph( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + finishParagraph( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextPortionAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendTextPortion( + const ::rtl::OUString& rText, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextContentAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent >& xTextContent, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextConvert + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > SAL_CALL + convertToTextFrame( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xStart, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xEnd, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& xFrameProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextTable > SAL_CALL + convertToTable( + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > > > > const& + rTableRanges, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > > > const& + rCellProperties, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > > const& + rRowProperties, + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > const& + rTableProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextRangeCompare + sal_Int16 SAL_CALL compareRegionStarts( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL compareRegionEnds( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XRelativeTextContentInsert + virtual void SAL_CALL insertTextContentBefore( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xNewContent, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xSuccessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertTextContentAfter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xNewContent, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xPredecessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XRelativeTextContentRemove + virtual void SAL_CALL removeTextContentBefore( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xSuccessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTextContentAfter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xPredecessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXT_HXX + diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx new file mode 100644 index 000000000000..8e7a64c18669 --- /dev/null +++ b/sw/inc/unotextbodyhf.hxx @@ -0,0 +1,218 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTBODYHF_HXX +#define SW_UNOTEXTBODYHF_HXX + +#include +#include +#include + +#include + +#include +#include +#include + + +class SwDoc; +class SwFrmFmt; + + +typedef ::cppu::WeakAggImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumerationAccess +> SwXBodyText_Base; + +class SwXBodyText + : public SwXBodyText_Base + , public SwXText +{ + +protected: + + virtual ~SwXBodyText(); + +public: + + SwXBodyText(SwDoc* pDoc); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > + CreateTextCursor(sal_Bool bIgnoreTables = sal_False); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XAggregation + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + 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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + + +/* -----------------25.08.98 11:02------------------- + * + * --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumerationAccess +> SwXHeadFootText_Base; + +class SwXHeadFootText + : public SwXHeadFootText_Base + , public SwXText + , public SwClient +{ + +private: + + SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + BOOL bIsHeader; + +protected: + + virtual const SwStartNode *GetStartNode() const; + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + createCursor() + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXHeadFootText(); + +public: + + SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + 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); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXTBODYHF_HXX + -- cgit From 80c54710e69437a743c9a0213c4e76eed6286945 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:47 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unoparaframeenum.hxx: move SwXParaFrameEnumeration from unoobj.hxx to new unoparaframeenum.hxx. move FrameDependSortList_t, CollectFrameAtNode to unoparaframeenum.hxx. --- sw/inc/unoobj.hxx | 68 ---------------------- sw/inc/unoparaframeenum.hxx | 138 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 68 deletions(-) create mode 100644 sw/inc/unoparaframeenum.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index d43a4a7105e1..ae9eaa205a3b 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -50,27 +50,10 @@ #include -#include -#include - class GetCurTxtFmtColl; -struct FrameDependSortListEntry { - xub_StrLen nIndex; - sal_uInt32 nOrder; - ::boost::shared_ptr pFrameDepend; - FrameDependSortListEntry (xub_StrLen const i_nIndex, - sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) - : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } -}; -typedef ::std::deque< FrameDependSortListEntry > - FrameDependSortList_t; - -typedef ::std::deque< ::boost::shared_ptr > - FrameDependList_t; - /* -----------------26.06.98 16:18------------------- * @@ -79,10 +62,6 @@ typedef ::std::deque< ::boost::shared_ptr > SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); ::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); -// OD 2004-05-07 #i28701# - adjust 4th parameter -void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, - FrameDependSortList_t & rFrames, - const bool _bAtCharAnchoredObjs ); /*-----------------04.03.98 11:54------------------- Start/EndAction oder Start/EndAllAction @@ -168,53 +147,6 @@ public: --------------------------------------------------*/ -/* -----------------23.03.99 12:57------------------- - * - * --------------------------------------------------*/ -#define PARAFRAME_PORTION_PARAGRAPH 0 -#define PARAFRAME_PORTION_CHAR 1 -#define PARAFRAME_PORTION_TEXTRANGE 2 - -class SwXParaFrameEnumeration : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XEnumeration, - ::com::sun::star::lang::XServiceInfo ->, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - m_xNextObject; // created by hasMoreElements - FrameDependList_t m_Frames; - - SwUnoCrsr* GetCursor() const - {return static_cast(const_cast(GetRegisteredIn()));} - -public: - SwXParaFrameEnumeration(const SwPaM& rPaM, - sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); - ~SwXParaFrameEnumeration(); - - // XEnumeration - virtual sal_Bool SAL_CALL hasMoreElements() - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL nextElement() - throw( ::com::sun::star::container::NoSuchElementException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException ); - - // XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_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() - throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); -}; - /* -----------------29.09.98 09:01------------------- * diff --git a/sw/inc/unoparaframeenum.hxx b/sw/inc/unoparaframeenum.hxx new file mode 100644 index 000000000000..d05fccfed46d --- /dev/null +++ b/sw/inc/unoparaframeenum.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * 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: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOPARAFRAMEENUM_HXX +#define SW_UNOPARAFRAMEENUM_HXX + +#include + +#include + +#include +#include +#include + +#include + +#include +#include + + +class SwNodeIndex; +class SwPaM; +class SwUnoCrsr; +class SwFrmFmt; + + +struct FrameDependSortListEntry +{ + xub_StrLen nIndex; + sal_uInt32 nOrder; + ::boost::shared_ptr pFrameDepend; + + FrameDependSortListEntry (xub_StrLen const i_nIndex, + sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) + : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } +}; + +typedef ::std::deque< FrameDependSortListEntry > + FrameDependSortList_t; + +typedef ::std::deque< ::boost::shared_ptr > + FrameDependList_t; + + +// OD 2004-05-07 #i28701# - adjust 4th parameter +void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, + FrameDependSortList_t & rFrames, + const bool _bAtCharAnchoredObjs ); + + +/* -----------------23.03.99 12:57------------------- + * + * --------------------------------------------------*/ + +#define PARAFRAME_PORTION_PARAGRAPH 0 +#define PARAFRAME_PORTION_CHAR 1 +#define PARAFRAME_PORTION_TEXTRANGE 2 + + +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumeration +> SwXParaFrameEnumeration_Base; + +class SwXParaFrameEnumeration + : public SwXParaFrameEnumeration_Base + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > + m_xNextObject; // created by hasMoreElements + FrameDependList_t m_Frames; + + SwUnoCrsr* GetCursor() const + {return static_cast(const_cast(GetRegisteredIn()));} + + virtual ~SwXParaFrameEnumeration(); + +public: + + SwXParaFrameEnumeration(const SwPaM& rPaM, + sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumeration + virtual sal_Bool SAL_CALL hasMoreElements() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOPARAFRAMEENUM_HXX + -- cgit From 7e156d00e9e09e3329856c685a9c6c0138db1253 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:49 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: move misc stuff: move GetPageDescByName_Impl from unoobj.hxx to pagedesc.hxx. move UnoActionContext, UnoActionRemoveContext, ClientModify, CreateUnoTunnelId from unoobj.hxx to unobaseclass.hxx. move UnoActionContext, UnoActionRemoveContext from unoobj.cxx to unoobj2.cxx. --- sw/inc/pagedesc.hxx | 3 +++ sw/inc/unobaseclass.hxx | 52 ++++++++++++++++++++++++++++++++++++++++++------- sw/inc/unoobj.hxx | 26 ------------------------- sw/inc/unoparagraph.hxx | 2 +- sw/inc/unoredlines.hxx | 5 +++-- sw/inc/unotbl.hxx | 1 + 6 files changed, 53 insertions(+), 36 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 40d8874f912d..8815945c8bc4 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -344,4 +344,7 @@ public: operator SwPageDesc() const; // #i7983# }; + +SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); + #endif //_PAGEDESC_HXX diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index adb7b880356a..75443b2c7584 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -30,18 +30,22 @@ #ifndef _UNOBASECLASS_HXX #define _UNOBASECLASS_HXX -#include #include #include + #include -typedef -cppu::WeakImplHelper2 -< - ::com::sun::star::container::XEnumeration, - ::com::sun::star::lang::XServiceInfo + +class SfxPoolItem; +class SwClient; +class SwDoc; + + +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumeration > -SwSimpleEnumerationBaseClass; +SwSimpleEnumeration_Base; /* -----------------29.04.98 07:35------------------- @@ -64,5 +68,39 @@ enum CursorType CURSOR_META, // meta/meta-field }; +/*-----------------04.03.98 11:54------------------- + Start/EndAction or Start/EndAllAction + -------------------------------------------------- */ +class UnoActionContext +{ + private: + SwDoc * m_pDoc; + + public: + UnoActionContext(SwDoc *const pDoc); + ~UnoActionContext(); + + void InvalidateDocument() { m_pDoc = 0; } +}; + +/* -----------------07.07.98 12:03------------------- + interrupt Actions for a little while + -------------------------------------------------- */ +class UnoActionRemoveContext +{ + private: + SwDoc *const m_pDoc; + + public: + UnoActionRemoveContext(SwDoc *const pDoc); + ~UnoActionRemoveContext(); +}; + + +::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); + +/// helper function for implementing SwClient::Modify +void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); + #endif diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index ae9eaa205a3b..6ab11b13e9ec 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -59,38 +59,12 @@ class GetCurTxtFmtColl; * * --------------------------------------------------*/ -SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); -::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); -/*-----------------04.03.98 11:54------------------- - Start/EndAction oder Start/EndAllAction ---------------------------------------------------*/ -class UnoActionContext -{ - SwDoc* pDoc; - public: - UnoActionContext(SwDoc* pDoc); - ~UnoActionContext(); - - void InvalidateDocument() {pDoc = 0;} -}; -/* -----------------07.07.98 12:03------------------- - * Actions kurzfristig unterbrechen - * --------------------------------------------------*/ -class UnoActionRemoveContext -{ - SwDoc* pDoc; - public: - UnoActionRemoveContext(SwDoc* pDoc); - ~UnoActionRemoveContext(); -}; - /****************************************************************************** * ******************************************************************************/ -void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); /*-----------------20.03.98 07:47------------------- diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index 6ef62e00c1a9..984786b0d1fb 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -359,7 +359,7 @@ public: --------------------------------------------------*/ class SwXParagraphEnumeration - : public SwSimpleEnumerationBaseClass + : public SwSimpleEnumeration_Base , public SwClient { diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx index 52f2ab16a368..ba08afc1f8bf 100644 --- a/sw/inc/unoredlines.hxx +++ b/sw/inc/unoredlines.hxx @@ -78,8 +78,9 @@ public: /* -----------------------------12.01.01 14:58-------------------------------- ---------------------------------------------------------------------------*/ -class SwXRedlineEnumeration : public SwSimpleEnumerationBaseClass, - public SwClient +class SwXRedlineEnumeration + : public SwSimpleEnumeration_Base + , public SwClient { SwDoc* pDoc; USHORT nCurrentIndex; diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index d2e14309a5d4..a539c7384a39 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -51,6 +51,7 @@ #include #include +#include #include #include #include -- cgit From 4f555e6d5467a2a198113789c5527969e287da9c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:49 +0100 Subject: swunolocking1: #i105557#: remove unoobj.hxx --- sw/inc/unoobj.hxx | 158 ------------------------------------------------------ 1 file changed, 158 deletions(-) delete mode 100644 sw/inc/unoobj.hxx (limited to 'sw/inc') diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx deleted file mode 100644 index 6ab11b13e9ec..000000000000 --- a/sw/inc/unoobj.hxx +++ /dev/null @@ -1,158 +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: unoobj.hxx,v $ - * - * $Revision: 1.49 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _UNOOBJ_HXX -#define _UNOOBJ_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // helper for factories - -#include -#include -#include - -#include - - -class GetCurTxtFmtColl; - - - -/* -----------------26.06.98 16:18------------------- - * - * --------------------------------------------------*/ - - - -/****************************************************************************** - * - ******************************************************************************/ - - - -/*-----------------20.03.98 07:47------------------- - ---------------------------------------------------*/ -/* das wird zunaechst nicht gebraucht - bisher fuer den XPropertySetCloner -class SwXPropertySet : public ::com::sun::star::beans::XPropertySet, - public UsrObject -{ - ::com::sun::star::uno::Sequence<::com::sun::star::uno::Any>* pAny; - ::com::sun::star::uno::Sequence< Property >* pInfo; - -public: - // Eigentumsuebergang der Pointer! - SwXPropertySet( ::com::sun::star::uno::Sequence<::com::sun::star::uno::Any>* pAny, - ::com::sun::star::uno::Sequence* pInfo ); - virtual ~SwXPropertySet(); - - SMART_UNO_DECLARATION( SwXPropertySet, UsrObject ); - - //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); - -}; -*/ -/*-----------------20.03.98 08:26------------------- - ---------------------------------------------------*/ -/* das wird zunaechst nicht gebraucht - bisher fuer den XPropertySetCloner - -class SwXPropertySetInfo: public ::com::sun::star::beans::XPropertySetInfo, UsrObject -{ - ::com::sun::star::uno::Sequence< Property >* pSeq; - -public: - SwXPropertySetInfo( const ::com::sun::star::uno::Sequence& rInfo ); - virtual ~SwXPropertySetInfo(); - - SMART_UNO_DECLARATION( SwXPropertySetInfo, UsrObject ); - - virtual ::com::sun::star::uno::Sequence< Property > getProperties(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual Property getPropertyByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL hasPropertyByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); -}; -*/ - -/*-----------------23.02.98 10:45------------------- - ---------------------------------------------------*/ - - -/* -----------------29.09.98 09:01------------------- - * - * --------------------------------------------------*/ -/* os: 04.12.98 11:40 hier gibt es noch keine sinnvolle Definition -#define MAX_SORT_FIELDS 3 // das ist eher willkuerlich (wie im Dialog) -class SwXTextSortDescriptor : public XTextSortDescriptor, - public UsrObject -{ - SwSortOptions aSortOptions; - BOOL bUseHeader; -public: - SwXTextSortDescriptor(BOOL bUsedInTable); - virtual ~SwXTextSortDescriptor(); - - //XTextSortDescriptor - virtual sal_Unicode getTextColumnSeparator(void) const; - virtual void setTextColumnSeparator(sal_Unicode TextColumnSeparator_); - - //XSortDescriptor - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::SortField > getSortFields(void) const; - virtual void setSortFields(const ::com::sun::star::uno::Sequence< ::com::sun::star::util::SortField >& SortFields_); - virtual sal_uInt16 getMaxFieldCount(void) const; - virtual ColumnsOrRows getOrientation(void) const; - virtual void setOrientation(ColumnsOrRows Orientation_); - virtual BOOL getUseHeader(void) const; - virtual void setUseHeader(BOOL UseHeader_); - - const SwSortOptions& GetSortOptions() const {return aSortOptions;} - void SetSortOptions(const SwSortOptions& rSortOpt); -}; -*/ - -#endif - -- cgit From 5e8eac444983d7fcf8e4c102171179dbb6fffed9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:47 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add UnoImplPtr: new smart pointer template UnoImplPtr: calls dtor with SolarMutex locked. --- sw/inc/unobaseclass.hxx | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 75443b2c7584..5f55115f479e 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -27,8 +27,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _UNOBASECLASS_HXX -#define _UNOBASECLASS_HXX +#ifndef SW_UNOBASECLASS_HXX +#define SW_UNOBASECLASS_HXX #include #include @@ -102,5 +102,42 @@ class UnoActionRemoveContext /// helper function for implementing SwClient::Modify void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); -#endif + +#include +#include +#include +#include + +namespace sw { + + template class UnoImplPtr + : private ::boost::noncopyable + { + private: + T * m_p; + + public: + UnoImplPtr(T *const i_p) + : m_p(i_p) + { + OSL_ENSURE(i_p, "UnoImplPtr: null"); + } + + ~UnoImplPtr() + { + ::vos::OGuard g(Application::GetSolarMutex()); + delete m_p; // #i105557#: call dtor with locked solar mutex + m_p = 0; + } + + T & operator * () const { return *m_p; } + + T * operator ->() const { return m_p; } + + T * get () const { return m_p; } + }; + +} // namespace sw + +#endif // SW_UNOBASECLASS_HXX -- cgit From a22723dc6276d018fcd2fffa04c143e9c6c04c7a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:48 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add UnoTunnel helpers: new template UnoTunnelImpl to implement XUnoTunnel::getSomething(). new template UnoTunnelGetImplementation to use XUnoTunnel::getSomething(). --- sw/inc/unobaseclass.hxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sw/inc') diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 5f55115f479e..e9ae3f909a63 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -30,6 +30,7 @@ #ifndef SW_UNOBASECLASS_HXX #define SW_UNOBASECLASS_HXX +#include #include #include @@ -137,6 +138,32 @@ namespace sw { T * get () const { return m_p; } }; + template< class C > C * + UnoTunnelGetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XUnoTunnel > const & xUnoTunnel) + { + if (!xUnoTunnel.is()) { return 0; } + C *const pC( reinterpret_cast< C* >( + ::sal::static_int_cast< sal_IntPtr >( + xUnoTunnel->getSomething(C::getUnoTunnelId())))); + return pC; + } + + template< class C > sal_Int64 + UnoTunnelImpl(const ::com::sun::star::uno::Sequence< sal_Int8 > & rId, + C *const pThis) + { + if ((rId.getLength() == 16) && + (0 == rtl_compareMemory(C::getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16))) + { + return ::sal::static_int_cast< sal_Int64 >( + reinterpret_cast< sal_IntPtr >(pThis) ); + } + return 0; + } + } // namespace sw #endif // SW_UNOBASECLASS_HXX -- cgit From 6e3f9b6a9a1f70811e393d10a21addfaeedc174e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:48 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add XServiceInfo helpers: new functions GetSupportedServiceNamesImpl and SupportsServiceImpl. --- sw/inc/unobaseclass.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sw/inc') diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index e9ae3f909a63..91ef17d4e9d4 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -164,6 +164,13 @@ namespace sw { return 0; } + ::com::sun::star::uno::Sequence< ::rtl::OUString > + GetSupportedServiceNamesImpl( + size_t const nServices, char const*const pServices[]); + sal_Bool SupportsServiceImpl( + size_t const nServices, char const*const pServices[], + ::rtl::OUString const & rServiceName); + } // namespace sw #endif // SW_UNOBASECLASS_HXX -- cgit From e9ca667fa65f946acec102e3932372010b8622bd Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: refactor Meta registration at its text node. Meta will now be registered via SwTxtMeta::ChgTxtNode(), with additional workarounds necessary in SwFmtMeta::DoCopy(). --- sw/inc/fmtmeta.hxx | 8 +++++--- sw/inc/txtatr.hxx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 952181d0498c..6d3f63ece477 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -122,8 +122,8 @@ public: virtual SfxPoolItem * Clone( SfxItemPool *pPool = 0 ) const; // TYPEINFO(); - // notify clients registered at m_pMeta that this meta is being removed - void NotifyRemoval(); + /// notify clients registered at m_pMeta that this meta is being (re-)moved + void NotifyChangeTxtNode(SwTxtNode *const pTxtNode); static SwFmtMeta * CreatePoolDefault( const USHORT i_nWhich ); ::sw::Meta * GetMeta() { return m_pMeta.get(); } /// this method must be called when the hint is actually copied @@ -140,7 +140,7 @@ class Meta , public SwModify { protected: - friend class ::SwFmtMeta; // SetFmtMeta + friend class ::SwFmtMeta; // SetFmtMeta, NotifyChangeTxtNode friend class ::SwXMeta; // GetTxtNode, GetTxtAttr SwFmtMeta * m_pFmt; @@ -151,6 +151,8 @@ protected: SwFmtMeta * GetFmtMeta() const { return m_pFmt; } void SetFmtMeta( SwFmtMeta * const i_pFmt ) { m_pFmt = i_pFmt; }; + void NotifyChangeTxtNode(); + public: explicit Meta(SwFmtMeta * const i_pFmt = 0); virtual ~Meta(); diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index d9e9463a30a7..8c0ad5854665 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -80,7 +80,7 @@ public: const xub_StrLen i_nStart, const xub_StrLen i_nEnd ); virtual ~SwTxtMeta(); - void ChgTxtNode( SwTxtNode * const pNode ) { m_pTxtNode = pNode; } + void ChgTxtNode(SwTxtNode * const pNode); SwTxtNode * GetTxtNode() const { return m_pTxtNode; } }; -- cgit From dd567990b4372498dfbe5063082c792f241ee41d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXMeta: move SwClient base to pImpl struct, and use UnoImplPtr to lock destructor. replace broken SwClient iteration with a WeakReference in sw::Meta. make constructor protected, and add factory function CreateXMeta. use new XUnoTunnel and XServiceInfo helpers. --- sw/inc/fmtmeta.hxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 6d3f63ece477..792a7d8374db 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -31,6 +31,8 @@ #ifndef SW_FMTMETA_HXX #define SW_FMTMETA_HXX +#include + #include #include @@ -141,7 +143,10 @@ class Meta { protected: friend class ::SwFmtMeta; // SetFmtMeta, NotifyChangeTxtNode - friend class ::SwXMeta; // GetTxtNode, GetTxtAttr + friend class ::SwXMeta; // GetTxtNode, GetTxtAttr, Get/SetXMeta + + ::com::sun::star::uno::WeakReference< + ::com::sun::star::rdf::XMetadatable> m_wXMeta; SwFmtMeta * m_pFmt; @@ -153,6 +158,13 @@ protected: void NotifyChangeTxtNode(); + ::com::sun::star::uno::WeakReference< + ::com::sun::star::rdf::XMetadatable> const& GetXMeta() const + { return m_wXMeta; } + void SetXMeta(::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable> const& xMeta) + { m_wXMeta = xMeta; } + public: explicit Meta(SwFmtMeta * const i_pFmt = 0); virtual ~Meta(); -- cgit From faf50e31a983c1be11d74c1b574cd6c5f63d3a4e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXReferenceMark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. add factory function CreateXReferenceMark. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unorefmark.hxx | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unorefmark.hxx b/sw/inc/unorefmark.hxx index 8a37b5655e9e..61b6d09df06b 100644 --- a/sw/inc/unorefmark.hxx +++ b/sw/inc/unorefmark.hxx @@ -40,16 +40,12 @@ #include -#include - -#include -#include +#include class SwDoc; -class SwPaM; +class SwModify; class SwFmtRefMark; -class SwXTextCursor; /* -----------------27.08.98 15:11------------------- @@ -65,41 +61,24 @@ typedef ::cppu::WeakImplHelper5 class SwXReferenceMark : public SwXReferenceMark_Base - , public SwClient { private: - SwEventListenerContainer aLstnrCntnr; - SwDoc* pDoc; - const SwFmtRefMark* pMark; - String sMarkName; - BOOL m_bIsDescriptor; - - BOOL IsValid() const {return 0 != GetRegisteredIn();} - void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXReferenceMark(); public: - SwXReferenceMark(SwDoc * pDoc, const SwFmtRefMark * pMark); - - 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); - - const SwFmtRefMark* GetMark() const {return pMark;} - const String& GetMarkName() const {return sMarkName;} - SwDoc* GetDoc() const {return pDoc;} - void Invalidate(); - - TYPEINFO(); + SwXReferenceMark(SwDoc *const pDoc, const SwFmtRefMark *const pMark); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static SwXReferenceMark * + CreateXReferenceMark(SwDoc & rDoc, SwFmtRefMark const& rMarkFmt); + /// may return 0 + static SwXReferenceMark * + GetReferenceMark(SwModify const& rUnoCB, SwFmtRefMark const& rMarkFmt); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); -- cgit From 440e521dad8c97e939460af857c6a851b220c52e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:50 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXBookmark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in sw::mark::MarkBase. make constructor protected, and add factory function CreateXBookmark. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. remove SwXBookmarks::GetObject(). --- sw/inc/unobookmark.hxx | 48 ++++++++++++++++++++++-------------------------- sw/inc/unocoll.hxx | 1 - 2 files changed, 22 insertions(+), 27 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx index 2b16d7828001..46d0054551b7 100644 --- a/sw/inc/unobookmark.hxx +++ b/sw/inc/unobookmark.hxx @@ -41,12 +41,10 @@ #include -#include #include +#include #include -#include -#include class SwDoc; @@ -63,33 +61,15 @@ typedef ::cppu::ImplInheritanceHelper5 class SwXBookmark : public SwXBookmark_Base - , private SwClient { private: - SwEventListenerContainer m_aLstnrCntnr; - SwDoc* m_pDoc; - String m_aName; - ::sw::mark::IMark* m_pRegisteredBookmark; - - void registerInMark(::sw::mark::IMark* const pBkmk); + class Impl; + ::sw::UnoImplPtr m_pImpl; protected: - virtual ~SwXBookmark(); - -public: - - SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); - - const ::sw::mark::IMark* GetBookmark() const - { return m_pRegisteredBookmark; } - ::sw::mark::IMark* GetBookmark() - { return m_pRegisteredBookmark; } - SwDoc* GetDoc() - { return m_pDoc; } - void attachToRangeEx( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange, @@ -102,10 +82,26 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - TYPEINFO(); + const ::sw::mark::IMark* GetBookmark() const; - // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + virtual ~SwXBookmark(); + + /// @param pDoc and pMark != 0, but not & because of ImplInheritanceHelper + SwXBookmark(::sw::mark::IMark *const pMark, SwDoc *const pDoc); + +public: + + /// descriptor + SwXBookmark(); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> + CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark & rBookmark); + + /// @return IMark for this, but only if it lives in pDoc + static ::sw::mark::IMark const* GetBookmarkInDoc(SwDoc const*const pDoc, + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XUnoTunnel> & xUT); // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index b630668f8965..f4d54a55adca 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -481,7 +481,6 @@ class SwXBookmarks : public SwCollectionBaseClass, 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( ::sw::mark::IMark& rBkm, SwDoc* pDoc); }; class SwXNumberingRulesCollection : public cppu::WeakImplHelper1 -- cgit From ee9d6d30959b5467fb5f2407ce5aa24fe1043fc5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:50 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParagraph: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. make SwXParagraph instances reusable with a WeakReference in SwTxtNode. make constructor private, and add factory function CreateXParagraph. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/ndtxt.hxx | 20 +++++++++++-- sw/inc/unoparagraph.hxx | 75 ++++++++++++++----------------------------------- 2 files changed, 38 insertions(+), 57 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index d4d59afa3d9c..04f1fad3e660 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -30,6 +30,8 @@ #ifndef _NDTXT_HXX #define _NDTXT_HXX +#include + #include "swdllapi.h" #include #include @@ -76,9 +78,12 @@ class SwScriptInfo; struct SwDocStat; struct SwParaIdleData_Impl; -namespace com { namespace sun { namespace star { namespace uno { - template < class > class Sequence; -}}}} +namespace com { namespace sun { namespace star { + namespace uno { + template < class > class Sequence; + } + namespace text { class XTextContent; } +} } } typedef std::set< xub_StrLen > SwSoftPageBreakList; @@ -132,6 +137,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable SwList* mpList; // <-- + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> m_wXParagraph; SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl, const SfxItemSet* pAutoAttr = 0 ); @@ -813,6 +820,13 @@ public: USHORT GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const; + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> const& GetXParagraph() const + { return m_wXParagraph; } + SW_DLLPRIVATE void SetXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> const& xParagraph) + { m_wXParagraph = xParagraph; } + // sfx2::Metadatable virtual ::sfx2::IXmlIdRegistry& GetRegistry(); virtual bool IsInClipboard() const; diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index 984786b0d1fb..d5c5e2ed2832 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -48,12 +48,11 @@ #include #include -#include #include -class SfxItemPropertySet; struct SwPosition; +class SwPaM; class SwUnoCrsr; class SwStartNode; class SwTxtNode; @@ -80,73 +79,41 @@ typedef ::cppu::ImplInheritanceHelper10 class SwXParagraph : public SwXParagraph_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::rtl::OUString m_sText; - sal_Int32 nSelectionStartPos; - sal_Int32 nSelectionEndPos; - BOOL m_bIsDescriptor; - -protected: - - void SAL_CALL SetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rValues) - 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); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL - GetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - - ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL - GetPropertyValuesTolerant_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - sal_Bool bDirectValuesOnly) - throw (::com::sun::star::uno::RuntimeException); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParagraph(); + SwXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > const & xParent, + SwTxtNode & rTxtNode, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); + public: + /// descriptor SwXParagraph(); - 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); - BOOL IsDescriptor() const {return m_bIsDescriptor;} + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> + CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> + const& xParentText = 0, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); const SwTxtNode * GetTxtNode() const; - SwTxtNode * GetTxtNode(); - - static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const ::rtl::OUString& rPropertyName, USHORT nWID = 0); - static SwXParagraph* GetImplementation( - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> xRef); + bool IsDescriptor() const; + /// make rPaM select the paragraph + bool SelectPaM(SwPaM & rPaM); + /// for SwXText void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static bool getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); -- cgit From 77ca8486db12a970aef9aeafea3ac9a4c297d2b2 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParagraphEnumeration: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoparagraph.hxx | 56 ++++++++----------------------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index d5c5e2ed2832..b14aeb7dc3d9 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -32,6 +32,8 @@ #ifndef SW_UNOPARAGRAPH_HXX #define SW_UNOPARAGRAPH_HXX +#include + #include #include #include @@ -47,16 +49,13 @@ #include -#include #include struct SwPosition; class SwPaM; class SwUnoCrsr; -class SwStartNode; class SwTxtNode; -class SwTable; class SwXText; @@ -327,60 +326,23 @@ public: --------------------------------------------------*/ class SwXParagraphEnumeration : public SwSimpleEnumeration_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - xNextPara; - - const SwTable * pOwnTable; - /// Start node of the cell the enumeration belongs to. - /// Used to restrict the movement of the UNO cursor to the cell and its - /// embedded tables. - const SwStartNode * pOwnStartNode; - sal_Int32 nFirstParaStart; - sal_Int32 nLastParaEnd; - ULONG nEndIndex; - CursorType eCursorType; - BOOL bFirstParagraph; - - SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParagraphEnumeration(); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextContent > SAL_CALL - NextElement_Impl() - throw (::com::sun::star::container::NoSuchElementException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - public: + /// takes ownership of cursor SwXParagraphEnumeration( - SwXText* pParent, SwPosition& rPos, CursorType eType); - SwXParagraphEnumeration( - SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); - - // non-Uno functions - - void SetOwnTable(const SwTable* pTable) - { pOwnTable = pTable; } - const SwTable* GetOwnTable() const - { return pOwnTable; } - void SetOwnStartNode(const SwStartNode* pNode) - { pOwnStartNode = pNode; } - const SwStartNode* GetOwnStartNode() const - { return pOwnStartNode; } - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + const & xParent, + ::std::auto_ptr pCursor, + const CursorType eType); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() -- cgit From 2fee7963e992089b67eeb2fb60da27054037da32 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextSection: replace SwXTextSectionClient with Impl struct, use UnoImplPtr to lock dtor. move all implementation details out of header, into Impl struct. remove ugly destruction of SwUnoCrsr via Application::PostUserEvent. replace broken SwClient iteration with a WeakReference in SwSectionFmt. add factory function CreateXTextSection. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/frmfmt.hxx | 19 ++++++++-- sw/inc/section.hxx | 20 ++++++++++ sw/inc/unosection.hxx | 102 ++++---------------------------------------------- 3 files changed, 43 insertions(+), 98 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index a86b1c6689a0..61663d131aad 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -30,11 +30,14 @@ #ifndef _FRMFMT_HXX #define _FRMFMT_HXX -#include - // --> OD 2004-08-06 #i28749# #include // <-- + +#include + +#include + #include "swdllapi.h" class SwFlyFrm; @@ -51,8 +54,9 @@ class SW_DLLPUBLIC SwFrmFmt: public SwFmt { friend class SwDoc; friend class SwPageDesc; //darf den protected CTor rufen. -// friend class SwSwgReader; // der SW2-Reader auch! -// friend class Sw3IoImp; // der SW3-Reader auch! + + ::com::sun::star::uno::WeakReference< + ::com::sun::star::uno::XInterface> m_wXObject; protected: SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, @@ -136,6 +140,13 @@ public: virtual String GetDescription() const; + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::uno::XInterface> const& GetXObject() const + { return m_wXObject; } + SW_DLLPRIVATE void SetXObject(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> const& xObject) + { m_wXObject = xObject; } + DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt) }; diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index c530c8280870..3acd8cab16cb 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -41,6 +41,11 @@ #include #include + +namespace com { namespace sun { namespace star { + namespace text { class XTextSection; } +} } } + // Forward Deklaration class SwSectionFmt; class SwDoc; @@ -230,6 +235,13 @@ class SW_DLLPUBLIC SwSectionFmt : public SwFrmFmt { friend class SwDoc; + /** why does this exist in addition to the m_wXObject in SwFrmFmt? + in case of an index, both a SwXDocumentIndex and a SwXTextSection + register at this SwSectionFmt, so we need to have two refs. + */ + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection> m_wXTextSection; + /* SW_DLLPUBLIC */ SwSection* _GetSection() const; SW_DLLPRIVATE void UpdateParent(); // Parent wurde veraendert @@ -271,6 +283,14 @@ public: // ist die Section eine gueltige fuers GlobalDocument? const SwSection* GetGlobalDocSection() const; + + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection> const& GetXTextSection() const + { return m_wXTextSection; } + SW_DLLPRIVATE void SetXTextSection(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection> const& xTextSection) + { m_wXTextSection = xTextSection; } + }; // -------------- inlines --------------------------------- diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx index 31d15d7010d4..6f3eb1794c84 100644 --- a/sw/inc/unosection.hxx +++ b/sw/inc/unosection.hxx @@ -43,14 +43,9 @@ #include -#include -#include +#include -#include -#include - -class SfxItemPropertySet; class SwSectionFmt; @@ -58,51 +53,6 @@ class SwSectionFmt; --------------------------------------------------*/ -class SwXTextSection; - -class SwXTextSectionClient - : public SwClient -{ - -private: - - friend class SwXTextSection; - - SwXTextSection * m_pSection; - ::com::sun::star::uno::WeakReference< - ::com::sun::star::text::XTextSection > m_xReference; - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - - SwXTextSectionClient( - SwSectionFmt& rFmt, - SwXTextSection& rTextSection, - ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > xSection); - - virtual ~SwXTextSectionClient(); - - DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, - SwXTextSectionClient* ); - -public: - - TYPEINFO(); - - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > - GetXTextSection(); - - static ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > - CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE); - static SwXTextSectionClient* Create( - SwXTextSection& rSection, - ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > xSection, - SwSectionFmt& rFmt); -}; - struct SwTextSectionProperties_Impl; @@ -122,57 +72,21 @@ class SwXTextSection private: - friend class SwXTextSectionClient; - - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; + class Impl; + ::sw::UnoImplPtr m_pImpl; - BOOL m_bIsDescriptor; - BOOL m_bIndexHeader; - String m_sName; - SwTextSectionProperties_Impl* pProps; - SwXTextSectionClient* m_pClient; - -protected: - - void SAL_CALL SetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& aValues) - 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); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL - GetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - - SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); + SwXTextSection(SwSectionFmt *const pFmt, const bool bIndexHeader = false); virtual ~SwXTextSection(); - void ResetClient() { m_pClient = 0; } - void SetClient(SwXTextSectionClient* pClient) { m_pClient = pClient; } - public: - 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); - SwSectionFmt* GetFmt() const; - static SwXTextSection* GetImplementation( - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> xRef); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > + CreateXTextSection(SwSectionFmt *const pFmt = 0, + const bool bIndexHeader = false); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); -- cgit From 30bfe9b171379f987c470761acf6735a8b48fe67 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextRanges: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XServiceInfo helpers. replace SvWeirdArray with STL vector. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index a7d13daf4848..94d4996b4633 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -45,10 +45,9 @@ #include #include -#include - #include #include +#include class String; @@ -85,6 +84,13 @@ public: }; +namespace sw { + + void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); + +} // namespace sw + + typedef ::cppu::WeakImplHelper8 < ::com::sun::star::lang::XUnoTunnel , ::com::sun::star::lang::XServiceInfo @@ -300,9 +306,6 @@ public: /* -----------------15.05.98 08:29------------------- * * --------------------------------------------------*/ -typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > * - XTextRangeRefPtr; -SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) typedef ::cppu::WeakImplHelper3 < ::com::sun::star::lang::XUnoTunnel @@ -312,32 +315,20 @@ typedef ::cppu::WeakImplHelper3 class SwXTextRanges : public SwXTextRanges_Base - , public SwClient { private: - XTextRangeArr* pRangeArr; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - XTextRangeArr* GetRangesArray(); - SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXTextRanges(); public: - SwXTextRanges(); - SwXTextRanges(SwPaM* pCrsr); + SwXTextRanges(SwPaM *const pCrsr); - const SwUnoCrsr* GetCursor() const { - return (const SwUnoCrsr*)(GetRegisteredIn()); - } - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + const SwUnoCrsr* GetCursor() const; static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); -- cgit From 220dc1e003f4a26a2d92b6c9bb2464a9b9d63b0e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:52 +0100 Subject: swunolocking1: #i105557#: SwXTextRange: try to hide the implementation detail that SwXTextRange registers at a bookmark from its clients by using SwXTextRange::GetPositions(). --- sw/inc/unotext.hxx | 5 ++--- sw/inc/unotextrange.hxx | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx index 499e0620dae4..97a45ece73cf 100644 --- a/sw/inc/unotext.hxx +++ b/sw/inc/unotext.hxx @@ -93,7 +93,7 @@ private: virtual void PrepareForAttach( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, - SwXTextRange const * const pRange, SwPaM const * const pPam); + SwPaM const & rPam); protected: @@ -136,8 +136,7 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual bool CheckForOwnMemberMeta( - const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) + const SwPaM & rPam, const bool bAbsorb) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 94d4996b4633..079296d2a441 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -130,7 +130,9 @@ private: xParentText; ::sw::mark::IMark* pMark; - void _CreateNewBookmark(SwPaM& rPam); + const ::sw::mark::IMark * GetBookmark() const + { return pMark; } + void SetPositions(SwPaM const& rPam); //TODO: new exception type for protected content void DeleteAndInsert(const String& rText, const bool bForceExpandHints) throw (::com::sun::star::uno::RuntimeException); @@ -153,8 +155,6 @@ public: { return pDoc; } SwDoc* GetDoc() { return pDoc; } - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, const ::com::sun::star::uno::Reference< -- cgit From 1f8d8b1e17487074cf77595ab9d9569858e6f04e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:52 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextRange: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 54 +++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 40 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 079296d2a441..8b34ce7f94c1 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -45,26 +45,15 @@ #include #include -#include #include #include -class String; -class SfxItemPropertySet; class SwDoc; -class SwStartNode; struct SwPosition; class SwPaM; class SwUnoCrsr; class SwFrmFmt; -class SwTableBox; - -namespace sw { - namespace mark { - class IMark; - } -} /* -----------------29.04.98 07:35------------------- * @@ -104,13 +93,15 @@ typedef ::cppu::WeakImplHelper8 class SW_DLLPUBLIC SwXTextRange : public SwXTextRange_Base - , private SwClient { private: friend class SwXText; + class Impl; + ::sw::UnoImplPtr m_pImpl; + enum RangePosition { RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange @@ -118,26 +109,14 @@ private: RANGE_IN_CELL, // position created with a cell that has no uno object RANGE_IS_TABLE, // anchor of a table RANGE_INVALID // created by NewInstance - } eRangePosition; - - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; // register at format of table or frame - const SfxItemPropertySet* m_pPropSet; - //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - ::sw::mark::IMark* pMark; - - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } + }; + void SetPositions(SwPaM const& rPam); //TODO: new exception type for protected content - void DeleteAndInsert(const String& rText, const bool bForceExpandHints) + void DeleteAndInsert( + const ::rtl::OUString& rText, const bool bForceExpandHints) throw (::com::sun::star::uno::RuntimeException); - -protected: + void Invalidate(); virtual ~SwXTextRange(); @@ -146,31 +125,26 @@ public: SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & xParent, - enum RangePosition eRange = RANGE_IN_TEXT); + const enum RangePosition eRange = RANGE_IN_TEXT); // only for RANGE_IS_TABLE SwXTextRange(SwFrmFmt& rTblFmt); - BOOL GetPositions(SwPaM& rToFill) const; - const SwDoc* GetDoc() const - { return pDoc; } - SwDoc* GetDoc() - { return pDoc; } + const SwDoc* GetDoc() const; + SwDoc* GetDoc(); + bool GetPositions(SwPaM & rToFill) const; 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); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); // XUnoTunnel -- cgit From 5d6da5c1f774b02973085816bb0717d8a2c891a3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:53 +0100 Subject: swunolocking1: #i105557#: SwXTextRange: move static methods to namespace sw. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 8b34ce7f94c1..c3c3d362db6b 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -77,6 +77,13 @@ namespace sw { void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); + bool XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateParentXText(SwDoc & rDoc, const SwPosition& rPos); + } // namespace sw @@ -105,10 +112,8 @@ private: enum RangePosition { RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange - RANGE_IN_FRAME, // position created with a frame that has no uno object RANGE_IN_CELL, // position created with a cell that has no uno object RANGE_IS_TABLE, // anchor of a table - RANGE_INVALID // created by NewInstance }; void SetPositions(SwPaM const& rPam); @@ -133,17 +138,10 @@ public: SwDoc* GetDoc(); bool GetPositions(SwPaM & rToFill) const; - 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); - - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); + ::com::sun::star::text::XTextRange > CreateXTextRange( + SwDoc & rDoc, + const SwPosition& rPos, const SwPosition *const pMark); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); -- cgit From 0a3b5f8b3edacaf2e58de0b661077683e5973db5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:54 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParaFrameEnumeration: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace PARAFRAME_PORTION_ macros with an enum. use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoparaframeenum.hxx | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoparaframeenum.hxx b/sw/inc/unoparaframeenum.hxx index d05fccfed46d..7e5b43f1e637 100644 --- a/sw/inc/unoparaframeenum.hxx +++ b/sw/inc/unoparaframeenum.hxx @@ -42,13 +42,12 @@ #include -#include -#include +#include +class SwDepend; class SwNodeIndex; class SwPaM; -class SwUnoCrsr; class SwFrmFmt; @@ -80,10 +79,12 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, * * --------------------------------------------------*/ -#define PARAFRAME_PORTION_PARAGRAPH 0 -#define PARAFRAME_PORTION_CHAR 1 -#define PARAFRAME_PORTION_TEXTRANGE 2 - +enum ParaFrameMode +{ + PARAFRAME_PORTION_PARAGRAPH, + PARAFRAME_PORTION_CHAR, + PARAFRAME_PORTION_TEXTRANGE, +}; typedef ::cppu::WeakImplHelper2 < ::com::sun::star::lang::XServiceInfo @@ -92,27 +93,19 @@ typedef ::cppu::WeakImplHelper2 class SwXParaFrameEnumeration : public SwXParaFrameEnumeration_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - m_xNextObject; // created by hasMoreElements - FrameDependList_t m_Frames; - - SwUnoCrsr* GetCursor() const - {return static_cast(const_cast(GetRegisteredIn()));} + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParaFrameEnumeration(); public: SwXParaFrameEnumeration(const SwPaM& rPaM, - sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + const enum ParaFrameMode eParaFrameMode, SwFrmFmt *const pFmt = 0); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() -- cgit From aa16ebadc706825e9884378ba41b311eaad069b9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:54 +0100 Subject: swunolocking1: #i105557#: SwXTextCursor: move enum SwGetPropertyStatesCaller to unocrsrhelper.hxx. move static methods of SwXTextCursor to namespace SwUnoCursorHelper. move various not-actually-local functions with declarations in multiple cxx files to namespace SwUnoCursorHelper. clean up the implementation a little. --- sw/inc/unocrsrhelper.hxx | 111 ++++++++++++++++++++++++++++++++++++++++++++++- sw/inc/unotextcursor.hxx | 84 ----------------------------------- 2 files changed, 109 insertions(+), 86 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index 613a5e51eb89..b7e92df88b30 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -30,12 +30,25 @@ #ifndef _UNOCRSRHELPER_HXX #define _UNOCRSRHELPER_HXX -#include -#include #include +#include +#include + +#include +#include + + +class String; +class SfxItemSet; +class SfxItemPropertySet; struct SfxItemPropertySimpleEntry; +class SwTxtNode; class SwPaM; +class SwCursor; +class SwUnoCrsr; +class SwFmtColl; +struct SwSortOptions; class SwDoc; namespace com{ namespace sun{ namespace star{ @@ -47,6 +60,17 @@ namespace com{ namespace sun{ namespace star{ } }}} +/* -----------------03.12.98 12:16------------------- + * + * --------------------------------------------------*/ +enum SwGetPropertyStatesCaller +{ + SW_PROPERTY_STATE_CALLER_DEFAULT, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT +}; + /* -----------------------------14.12.00 15:06-------------------------------- ---------------------------------------------------------------------------*/ @@ -62,6 +86,7 @@ namespace SwUnoCursorHelper void SetValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any& rAny ); bool FillValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any*& pAny ); }; + sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , com::sun::star::uno::Any *pAny @@ -102,6 +127,88 @@ namespace SwUnoCursorHelper const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + /// @param bTableMode: attributes should be applied to a table selection + void SetCrsrAttr(SwPaM & rPam, const SfxItemSet & rSet, + const SetAttrMode nAttrMode, + const bool bTableMode = false); + void GetCrsrAttr(SwPaM & rPam, SfxItemSet & rSet, + const bool bOnlyTxtAttr = false, + const bool bGetFromChrFmt = true); + void GetTextFromPam(SwPaM & rPam, ::rtl::OUString & rBuffer); + SwFmtColl * GetCurTxtFmtColl(SwPaM & rPam, const bool bConditional); + + void SelectPam(SwPaM & rPam, const bool bExpand); + void SetString(SwCursor & rCursor, const ::rtl::OUString & rString); + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + CreateSortDescriptor(const bool bFromTable); + sal_Bool ConvertSortProperties( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rDescriptor, + SwSortOptions & rSortOpt); + + /// @param bTableMode: attributes should be applied to a table selection + void SetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName, + const ::com::sun::star::uno::Any & rValue, + const SetAttrMode nAttrMode = nsSetAttrMode::SETATTR_DEFAULT, + const bool bTableMode = false) + 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); + ::com::sun::star::uno::Any GetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > GetPropertyStates( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const SwGetPropertyStatesCaller eCaller = + SW_PROPERTY_STATE_CALLER_DEFAULT) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::beans::PropertyState GetPropertyState( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + void SetPropertyToDefault( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any GetPropertyDefault( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + bool SetPageDesc( + const ::com::sun::star::uno::Any& rValue, + SwDoc & rDoc, SfxItemSet & rSet); + void SetTxtFmtColl(const ::com::sun::star::uno::Any & rAny, SwPaM & rPaM) + throw (::com::sun::star::lang::IllegalArgumentException); + bool SetCursorPropertyValue( + SfxItemPropertySimpleEntry const& rEntry, + ::com::sun::star::uno::Any const& rValue, + SwPaM & rPam, SfxItemSet & rItemSet) + throw (::com::sun::star::lang::IllegalArgumentException); + } // namespace SwUnoCursorHelper #endif diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index ce91bd295267..fe9b2602180f 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -58,32 +58,13 @@ #include -class SfxItemSet; class SfxItemPropertySet; class SwDoc; struct SwPosition; -class SwCursor; class SwUnoCrsr; -class SwFmtColl; struct SwSortOptions; -/* -----------------03.12.98 12:16------------------- - * - * --------------------------------------------------*/ -enum SwGetPropertyStatesCaller -{ - SW_PROPERTY_STATE_CALLER_DEFAULT, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, - SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT -}; - -/// attributes should be applied to a table selection -#define CRSR_ATTR_MODE_TABLE 1 -/// attributes should be added, not replaced -#define CRSR_ATTR_MODE_DONTREPLACE 2 - typedef ::cppu::WeakImplHelper12 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet @@ -152,71 +133,6 @@ public: void DeleteAndInsert(const String& rText, const bool bForceExpandHints); - static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, - USHORT nAttrMode); - static void GetCrsrAttr( SwPaM& rPam, SfxItemSet& rSet, - BOOL bOnlyTxtAttr = FALSE, BOOL bGetFromChrFmt = TRUE ); - static void getTextFromPam(SwPaM& aCrsr, ::rtl::OUString& rBuffer); - static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); - - static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); - static void SetString(SwCursor& rCrsr, const ::rtl::OUString& rString); - - static ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue > - createSortDescriptor(sal_Bool bFromTable); - static sal_Bool convertSortProperties( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rDescriptor, - SwSortOptions& rSortOpt); - - static void SetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName, - const ::com::sun::star::uno::Any& aValue, - USHORT nAttrMode = 0) - 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); - static ::com::sun::star::uno::Any GetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyState > GetPropertyStates( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::beans::PropertyState GetPropertyState( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static void SetPropertyToDefault( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyDefault( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - virtual const SwPaM* GetPaM() const; virtual SwPaM* GetPaM(); virtual const SwDoc* GetDoc() const; -- cgit From 2db8914dbed3ba6148f53d7548c126d92a1f9b90 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXParagraph: move static methods to namespace sw. --- sw/inc/unoparagraph.hxx | 3 --- sw/inc/unotextrange.hxx | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index b14aeb7dc3d9..add936e9c702 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -111,9 +111,6 @@ public: /// for SwXText void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); - static bool getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const ::rtl::OUString& rPropertyName, USHORT nWID = 0); - // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index c3c3d362db6b..164b35b703da 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -84,6 +84,9 @@ namespace sw { ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc & rDoc, const SwPosition& rPos); + bool GetDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); + } // namespace sw -- cgit From 8b1fb77c76b7a3c1616af58aac9d8eb8f97c019e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXBodyText: make SwXBodyText::CreateTextCursor() return a pointer, not a UNO reference. --- sw/inc/unotextbodyhf.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 8e7a64c18669..baab8bc15845 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -45,6 +45,7 @@ class SwDoc; class SwFrmFmt; +class SwXTextCursor; typedef ::cppu::WeakAggImplHelper2 @@ -65,8 +66,7 @@ public: SwXBodyText(SwDoc* pDoc); - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - CreateTextCursor(sal_Bool bIgnoreTables = sal_False); + SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( -- cgit From 456e9d587f26b98929d7821b6d9e14d328c024b5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXTextCursor: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. remove ugly destruction of SwUnoCrsr via Application::PostUserEvent. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextcursor.hxx | 54 +++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 40 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index fe9b2602180f..e976af91e147 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -49,20 +49,14 @@ #include #include -#include -#include -#include -#include #include #include -class SfxItemPropertySet; class SwDoc; struct SwPosition; class SwUnoCrsr; -struct SwSortOptions; typedef ::cppu::WeakImplHelper12 @@ -82,65 +76,45 @@ typedef ::cppu::WeakImplHelper12 class SwXTextCursor : public SwXTextCursor_Base - , public SwClient , public OTextCursorHelper { private: - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwSortOptions* pLastSortOptions; - - CursorType eType; - - // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl - // user event has been posted. In this case we have to remove the user - // event in ~SwXTextCursor(). - ULONG mnUserEventId; - bool mbRemoveUserEvent; - // <-- - - DECL_STATIC_LINK(SwXTextCursor, RemoveCursor_Impl, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*); - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXTextCursor(); public: SwXTextCursor( + SwDoc & rDoc, ::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > xParent, - const SwPosition& rPos, - CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); + ::com::sun::star::text::XText > const& xParent, + const enum CursorType eType, + SwPosition const& rPos, + SwPosition const*const pMark = 0); SwXTextCursor( ::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > xParent, - SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); - - SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} - const SwUnoCrsr* GetCrsr() const {return (SwUnoCrsr*)GetRegisteredIn();} + ::com::sun::star::text::XText > const& xParent, + SwPaM const& rSourceCursor, + const enum CursorType eType = CURSOR_ALL); - // --> FME 2006-03-07 #126177# - void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } - // <-- + SwUnoCrsr * GetCursor(); + const SwUnoCrsr * GetCursor() const; bool IsAtEndOfMeta() const; - void DeleteAndInsert(const String& rText, + void DeleteAndInsert(::rtl::OUString const& rText, const bool bForceExpandHints); + // OTextCursorHelper virtual const SwPaM* GetPaM() const; virtual SwPaM* GetPaM(); virtual const SwDoc* GetDoc() const; virtual SwDoc* GetDoc(); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - DECLARE_XINTERFACE() static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); -- cgit From 817e682f25904005a810839d32a881df6760b8b6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:56 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXText: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unofootnote.hxx | 2 +- sw/inc/unoframe.hxx | 8 +++++- sw/inc/unotbl.hxx | 10 +++++--- sw/inc/unotext.hxx | 63 ++++++++++++------------------------------------ sw/inc/unotextbodyhf.hxx | 2 +- 5 files changed, 31 insertions(+), 54 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx index d1c869404d32..8710f7effa03 100644 --- a/sw/inc/unofootnote.hxx +++ b/sw/inc/unofootnote.hxx @@ -85,7 +85,7 @@ protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - createCursor() + CreateCursor() throw (::com::sun::star::uno::RuntimeException); virtual ~SwXFootnote(); diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index d681e520d028..0aaaebbe7338 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -186,12 +186,18 @@ class SwXTextFrame : public SwXTextFrameBaseClass, protected: virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + CreateCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ~SwXTextFrame(); public: SwXTextFrame(SwDoc *pDoc); SwXTextFrame(SwFrmFmt& rFmt); + // FIXME: EVIL HACK: make available for SwXFrame::attachToRange + void SetDoc(SwDoc *const pDoc) { SwXText::SetDoc(pDoc); }; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL acquire( ) throw(); diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index a539c7384a39..d6daa705b739 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -106,13 +106,15 @@ class SwXCell : public SwXCellBaseClass, // table position where pBox was found last sal_uInt16 nFndPos; - using SwXText::IsValid; - protected: virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - sal_Bool IsValid(); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + CreateCursor() + throw (::com::sun::star::uno::RuntimeException); + + bool IsValid() const; virtual ~SwXCell(); diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx index 97a45ece73cf..3c805da5127c 100644 --- a/sw/inc/unotext.hxx +++ b/sw/inc/unotext.hxx @@ -40,8 +40,6 @@ #include #include -#include - #include @@ -75,28 +73,24 @@ class SwXText private: - SwDoc* pDoc; - BOOL bObjectValid; - CursorType eCrsrType; - const SfxItemPropertySet* m_pPropSet; - - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > SAL_CALL - finishOrAppendParagraph( - bool bFinish, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& - rCharacterAndParagraphProperties) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual void PrepareForAttach( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, SwPaM const & rPam); + virtual bool CheckForOwnMemberMeta( + const SwPaM & rPam, const bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); protected: + bool IsValid() const; + void Invalidate(); + void SetDoc(SwDoc *const pDoc); + virtual ~SwXText(); public: /*not protected because C++ is retarded*/ @@ -104,41 +98,16 @@ public: /*not protected because C++ is retarded*/ public: - SwXText(SwDoc* pDc, CursorType eType); + SwXText(SwDoc *const pDoc, const enum CursorType eType); - const SwDoc* GetDoc() const { return pDoc; } - SwDoc* GetDoc() { return pDoc; } - - // SwDoc is set when SwXText is attached - void SetDoc(SwDoc* pDc) { - DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); - pDoc = pDc; - bObjectValid = 0 != pDc; - } - - void Invalidate() { bObjectValid = sal_False; } - BOOL IsValid() const { return bObjectValid; } - - CursorType GetTextType() { return eCrsrType; } + const SwDoc* GetDoc() const; + SwDoc* GetDoc(); virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextCursor > createCursor() + ::com::sun::star::text::XTextCursor > + CreateCursor() throw (::com::sun::star::uno::RuntimeException); - INT16 ComparePositions( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange>& xPos1, - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange>& xPos2) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - BOOL CheckForOwnMember(const SwXTextRange* pRange1, - const OTextCursorHelper* pCursor1) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - virtual bool CheckForOwnMemberMeta( - const SwPaM & rPam, const bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index baab8bc15845..98656ca68c29 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -149,7 +149,7 @@ protected: virtual const SwStartNode *GetStartNode() const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - createCursor() + CreateCursor() throw (::com::sun::star::uno::RuntimeException); virtual ~SwXHeadFootText(); -- cgit From 3356582b67bb91d6d438cbf356527a928070d7fa Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:56 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXBodyText: use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextbodyhf.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 98656ca68c29..15c38044e4ff 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -64,7 +64,7 @@ protected: public: - SwXBodyText(SwDoc* pDoc); + SwXBodyText(SwDoc *const pDoc); SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); -- cgit From 069dead98a0b185ff521a31ed26dd81d98a91b7c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:57 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXHeadFootText: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in SwFrmFmt. make constructor protected, and add factory function CreateXHeadFootText. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextbodyhf.hxx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 15c38044e4ff..8fd4e8c2a442 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -38,8 +38,6 @@ #include -#include -#include #include @@ -136,13 +134,12 @@ typedef ::cppu::WeakImplHelper2 class SwXHeadFootText : public SwXHeadFootText_Base , public SwXText - , public SwClient { private: - SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } - BOOL bIsHeader; + class Impl; + ::sw::UnoImplPtr m_pImpl; protected: @@ -154,14 +151,13 @@ protected: virtual ~SwXHeadFootText(); -public: - - SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); + SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); - TYPEINFO(); +public: - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); + static bool IsXHeadFootText(SwClient *const pClient); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( -- cgit From 1f70baf3d1eaf363f0fb6281c7877a6ea783a667 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXFootnote: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. make constructor protected, and add factory function CreateXFootnote. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unofootnote.hxx | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx index 8710f7effa03..8d9a65d963ae 100644 --- a/sw/inc/unofootnote.hxx +++ b/sw/inc/unofootnote.hxx @@ -41,14 +41,11 @@ #include -#include - -#include -#include #include class SwDoc; +class SwModify; class SwFmtFtn; @@ -66,18 +63,15 @@ typedef ::cppu::WeakImplHelper5 class SwXFootnote : public SwXFootnote_Base , public SwXText - , public SwClient { private: friend class SwXFootnotes; - SwEventListenerContainer aLstnrCntnr; - const SwFmtFtn* pFmtFtn; - BOOL m_bIsDescriptor; - String m_sLabel; - BOOL m_bIsEndnote; + class Impl; + ::sw::UnoImplPtr m_pImpl; + protected: @@ -90,24 +84,17 @@ protected: virtual ~SwXFootnote(); -public: - - SwXFootnote(BOOL bEndnote); - SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); - - 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); + SwXFootnote(SwDoc & rDoc, const SwFmtFtn & rFmt); - const SwFmtFtn* FindFmt() const { return GetDoc() ? pFmtFtn : 0; } - void Invalidate(); +public: - TYPEINFO(); + SwXFootnote(const bool bEndnote); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static SwXFootnote * + CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt); + /// may return 0 + static SwXFootnote * + GetXFootnote(SwModify const& rUnoCB, SwFmtFtn const& rFootnoteFmt); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( -- cgit From 399fb822ef81bd2440da8ab48cc2028a6b44d5b7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXDocumentIndex: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in SwFrmFmt. make constructor private, and add factory function CreateXDocumentIndex. use new XUnoTunnel helpers. clean up the implementation a little. remove SwXDocumentIndexes::GetObject(). --- sw/inc/unoidx.hxx | 197 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 119 insertions(+), 78 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index ef503926ad1f..f82e2c9984d2 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -53,101 +53,143 @@ class SwTOXType; /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwDocIdxProperties_Impl; class SwXIndexStyleAccess_Impl; class SwXIndexTokenAccess_Impl; -class SwXDocumentIndex : public cppu::WeakImplHelper5 -< - ::com::sun::star::text::XDocumentIndex, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel ->, - public SwClient -{ - friend class SwXIndexStyleAccess_Impl; - friend class SwXIndexTokenAccess_Impl; +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XDocumentIndex +> SwXDocumentIndex_Base; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - SwDoc* m_pDoc; - const SwTOXBaseSection* pBase; - TOXTypes eTOXType; +class SwXDocumentIndex + : public SwXDocumentIndex_Base +{ - //Descriptor-Interface - sal_Bool bIsDescriptor; - SwDocIdxProperties_Impl* pProps; +private: - SwXIndexStyleAccess_Impl* pStyleAccess; - SwXIndexTokenAccess_Impl* pTokenAccess; + friend class SwXIndexStyleAccess_Impl; + friend class SwXIndexTokenAccess_Impl; - SwSectionFmt* GetFmt()const {return (SwSectionFmt*)GetRegisteredIn();} + class Impl; + ::sw::UnoImplPtr m_pImpl; - sal_Bool IsDescriptor() const {return bIsDescriptor;} - const SwDocIdxProperties_Impl* GetProperties_Impl() const { return pProps;} - SwDocIdxProperties_Impl* GetProperties_Impl() { return pProps;} - TOXTypes GetTOXType() const {return eTOXType;} + virtual ~SwXDocumentIndex(); - SwXIndexStyleAccess_Impl* GetStyleAccess() const {return pStyleAccess;} - void SetStyleAccess(SwXIndexStyleAccess_Impl* pSet) - {pStyleAccess = pSet;} + SwXDocumentIndex(SwTOXBaseSection const&, SwDoc &); - SwXIndexTokenAccess_Impl* GetTokenAccess() const {return pTokenAccess;} - void SetTokenAccess(SwXIndexTokenAccess_Impl* pSet) - {pTokenAccess = pSet;} -protected: - virtual ~SwXDocumentIndex(); public: - SwXDocumentIndex(const SwTOXBaseSection* = 0, SwDoc* = 0); - //Descriptor-Ctor - SwXDocumentIndex(TOXTypes eToxType, SwDoc& rDoc); + /// descriptor + SwXDocumentIndex(const TOXTypes eToxType, SwDoc& rDoc); - TYPEINFO(); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndex> + CreateXDocumentIndex(SwDoc & rDoc, SwTOXBaseSection const& rSection); 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); - - //XDocumentIndex - virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL update( ) throw(::com::sun::star::uno::RuntimeException); + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + 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); + + + // XDocumentIndex + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL update() + 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); - - //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(void) 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 ); - - //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 ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - 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 ); }; + /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ @@ -274,7 +316,6 @@ public: 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 SwXDocumentIndex* GetObject(const SwTOXBaseSection* pTOX); }; /* -----------------13.09.99 16:39------------------- -- cgit From 342e7b53a498adba704d9c177db58cdf3cf0733f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: move SwXDocumentIndex helper classes out of header. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoidx.hxx | 80 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 78 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index f82e2c9984d2..f3462a17bebb 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -32,9 +32,7 @@ #include #include -#include #include -#include #include #include @@ -53,8 +51,6 @@ class SwTOXType; /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwXIndexStyleAccess_Impl; -class SwXIndexTokenAccess_Impl; typedef ::cppu::WeakImplHelper5 < ::com::sun::star::lang::XUnoTunnel @@ -70,8 +66,8 @@ class SwXDocumentIndex private: - friend class SwXIndexStyleAccess_Impl; - friend class SwXIndexTokenAccess_Impl; + class StyleAccess_Impl; + class TokenAccess_Impl; class Impl; ::sw::UnoImplPtr m_pImpl; @@ -316,79 +312,7 @@ public: 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 ); -}; -/* -----------------13.09.99 16:39------------------- - - --------------------------------------------------*/ -class SwXIndexStyleAccess_Impl : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XIndexReplace, - ::com::sun::star::lang::XServiceInfo -> -{ - SwXDocumentIndex& rParent; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; -protected: - virtual ~SwXIndexStyleAccess_Impl(); -public: - SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx); - - - //XIndexReplace - virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::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 ); - - //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 ); - -}; - -/* -----------------13.09.99 16:39------------------- - - --------------------------------------------------*/ -class SwXIndexTokenAccess_Impl : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XIndexReplace, - ::com::sun::star::lang::XServiceInfo -> -{ - SwXDocumentIndex& rParent; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; - sal_Int32 nCount; -protected: - virtual ~SwXIndexTokenAccess_Impl(); -public: - SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx); - - - - //XIndexReplace - virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::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 ); - - //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 ); - }; #endif - -- cgit From f3dca2c04f5bd6d30c33e06de2ef6f35636ddbe9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: SwXDocumentIndexes: use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoidx.hxx | 67 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index f3462a17bebb..8d432f9fdcf3 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -271,46 +271,57 @@ public: SwDoc* pDoc); void Invalidate(); }; + /* -----------------05.05.99 12:27------------------- * * --------------------------------------------------*/ - -class SwXDocumentIndexes : public SwCollectionBaseClass, - public SwUnoCollection +class SwXDocumentIndexes + : public SwCollectionBaseClass + , public SwUnoCollection { -protected: - virtual ~SwXDocumentIndexes(); -public: - SwXDocumentIndexes(SwDoc* pDoc); - -// SMART_UNO_DECLARATION( SwXDocumentIndexes, UsrObject ); +private: -// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) + virtual ~SwXDocumentIndexes(); -// throw( ::com::sun::star::uno::RuntimeException ); -// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! -// virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut ); +public: + SwXDocumentIndexes(SwDoc *const pDoc); - //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 ); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::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 ); + // 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); + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() + 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); - //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 ); + // XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( + const ::rtl::OUString& rName) + 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() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); }; -- cgit From fb0dd0d206e140a72291bff3e0225c938bb9de68 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXDocumentIndexMark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. make constructor private, and add factory function CreateXDocumentIndexMark. use new XUnoTunnel helpers. clean up the implementation a little. remove SwXDocumentIndexMark::GetObject(). --- sw/inc/unoidx.hxx | 179 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 110 insertions(+), 69 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index 8d432f9fdcf3..dd1edce22d0d 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -36,14 +36,13 @@ #include #include +#include #include -#include #include #include -class SfxItemPropertySet; class SwTOXBaseSection; class SwTOXMark; class SwTOXType; @@ -189,87 +188,129 @@ public: /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwXDocumentIndexMark : public cppu::WeakImplHelper4 -< - ::com::sun::star::text::XDocumentIndexMark, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XUnoTunnel ->, - public SwClient +typedef ::cppu::WeakImplHelper4 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::text::XDocumentIndexMark +> SwXDocumentIndexMark_Base; + +class SwXDocumentIndexMark + : public SwXDocumentIndexMark_Base { - SwEventListenerContainer aLstnrCntnr; - SwDepend aTypeDepend; - SwDoc* m_pDoc; - const SwTOXMark* m_pTOXMark; - const SfxItemPropertySet* m_pPropSet; - - sal_Bool bIsDescriptor; - sal_Bool bMainEntry; - TOXTypes eType; - sal_uInt16 nLevel; - String sAltText; - String sPrimaryKey; - String sSecondaryKey; - String sTextReading; - String sPrimaryKeyReading; - String sSecondaryKeyReading; - String sUserIndexName; - - void InitMap(TOXTypes eToxType); -protected: - virtual ~SwXDocumentIndexMark(); -public: - SwXDocumentIndexMark(TOXTypes eToxType); - SwXDocumentIndexMark(const SwTOXType* pType, - const SwTOXMark* pMark, - SwDoc* pDc); +private: - TYPEINFO(); + class Impl; + ::sw::UnoImplPtr m_pImpl; - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + virtual ~SwXDocumentIndexMark(); - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + SwXDocumentIndexMark(SwDoc & rDoc, + SwTOXType & rType, const SwTOXMark & rMark); - virtual rtl::OUString SAL_CALL getMarkEntry(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setMarkEntry(const rtl::OUString& aIndexEntry) throw( ::com::sun::star::uno::RuntimeException ); +public: - //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(void) throw( ::com::sun::star::uno::RuntimeException ); + /// descriptor + SwXDocumentIndexMark(const TOXTypes eToxType); - //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 ); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndexMark> + CreateXDocumentIndexMark(SwDoc & rDoc, + SwTOXType & rType, const SwTOXMark & rMark); - //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); + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - //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 ); + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + 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& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + 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& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + 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& rPropertyName, + 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 addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); - 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 ); + // 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); - SwTOXType* GetTOXType() const {return (SwTOXType*)aTypeDepend.GetRegisteredIn();} - const SwTOXMark* GetTOXMark() const {return m_pTOXMark;} + // XDocumentIndexMark + virtual rtl::OUString SAL_CALL getMarkEntry() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMarkEntry(const rtl::OUString& rIndexEntry) + throw (::com::sun::star::uno::RuntimeException); - static SwXDocumentIndexMark* GetObject(SwTOXType* pType, const SwTOXMark* pMark, - SwDoc* pDoc); - void Invalidate(); }; /* -----------------05.05.99 12:27------------------- -- cgit From 82aba30102fe1cce3f6582bfbe29bacb7498363d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: remove class SwUnoCallBack. everything SwUnoCallBack class does has unfixable race conditions. in SwDoc, the uno callback is now a plain SwModify. --- sw/inc/doc.hxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index de82d9056ff9..0066b37b4575 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -199,7 +199,6 @@ class SwLayouter; class SdrView; class SdrMarkList; class SwAuthEntry; -class SwUnoCallBack; class SwLayoutCache; class IStyleAccess; struct SwCallMouseEvent; @@ -391,7 +390,7 @@ class SW_DLLPUBLIC SwDoc : SwLayoutCache *pLayoutCache; // Layout cache to read and save with the // document for a faster formatting - SwUnoCallBack *pUnoCallBack; + SwModify *pUnoCallBack; IGrammarContact *mpGrammarContact; // for grammar checking in paragraphs during editing mutable comphelper::ImplementationReference< SwChartDataProvider -- cgit From c93ddde38115731d4e5ca2dd41f0dced93625cd7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:14:00 +0100 Subject: swunolocking1: #i107771#: SwXDocumentIndexMark: register at SwTOXMark instead of UnoCallBack. implement instance caching with a WeakReference in SwTOXMark. [the ODF export depends on caching: see XMLIndexMarkExport::GetID()] --- sw/inc/tox.hxx | 32 ++++++++++++++++++++++++++++---- sw/inc/unoidx.hxx | 4 ++-- 2 files changed, 30 insertions(+), 6 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 9223ffa2d9df..b7384212a4e5 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -27,8 +27,10 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _TOX_HXX -#define _TOX_HXX +#ifndef SW_TOX_HXX +#define SW_TOX_HXX + +#include #include #include @@ -47,6 +49,11 @@ #define INCLUDED_VECTOR #endif + +namespace com { namespace sun { namespace star { + namespace text { class XDocumentIndexMark; } +} } } + class SwTOXType; class SwTOXMark; class SwTxtTOXMark; @@ -61,7 +68,9 @@ SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10) #define IVER_TOXMARK_STRPOOL ((USHORT)1) #define IVER_TOXMARK_NEWTOX ((USHORT)2) -class SW_DLLPUBLIC SwTOXMark : public SfxPoolItem, public SwClient +class SW_DLLPUBLIC SwTOXMark + : public SfxPoolItem + , public SwModify { friend void _InitCore(); friend class SwTxtTOXMark; @@ -80,6 +89,8 @@ class SW_DLLPUBLIC SwTOXMark : public SfxPoolItem, public SwClient BOOL bAutoGenerated : 1; // generated using a concordance file BOOL bMainEntry : 1; // main entry emphasized by character style + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark; SwTOXMark(); // to create the dflt. atr. in _InitCore @@ -97,6 +108,11 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + // SwClient + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + void InvalidateTOXMark(); + String GetText() const; inline BOOL IsAlternativeText() const; @@ -131,6 +147,14 @@ public: const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; } SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; } + + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const + { return m_wXDocumentIndexMark; } + SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndexMark> const& xMark) + { m_wXDocumentIndexMark = xMark; } + }; /*-------------------------------------------------------------------- @@ -769,4 +793,4 @@ inline void SwTOXBase::SetOptions(USHORT nOpt) } -#endif // _TOX_HXX +#endif // SW_TOX_HXX diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index dd1edce22d0d..664b0c46a78b 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -207,7 +207,7 @@ private: virtual ~SwXDocumentIndexMark(); SwXDocumentIndexMark(SwDoc & rDoc, - SwTOXType & rType, const SwTOXMark & rMark); + SwTOXType & rType, SwTOXMark & rMark); public: @@ -217,7 +217,7 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndexMark> CreateXDocumentIndexMark(SwDoc & rDoc, - SwTOXType & rType, const SwTOXMark & rMark); + SwTOXType & rType, SwTOXMark & rMark); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); -- cgit From b59c89d2ae495e0c42ae76042379960444269b19 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 14 Jan 2010 22:27:44 +0100 Subject: undo previous erroneous change, solar.hrc belongs to svl instead vcl now --- sw/inc/helpid.h | 2 +- sw/inc/pch/precompiled_sw.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index dca700fbb8b6..6bab531ad1c5 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -28,7 +28,7 @@ * ************************************************************************/ #ifndef _SOLAR_HRC -#include +#include #endif #define HID_BASE HID_APP_START diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index f43d09731f2f..e8aadd472aa6 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -677,7 +677,7 @@ #include "svl/slstitm.hxx" #include "svl/smplhint.hxx" #include "svtools/soerr.hxx" -#include "vcl/solar.hrc" +#include "svl/solar.hrc" #include "unotools/sourceviewconfig.hxx" #include "svtools/stdctrl.hxx" #include "svl/stritem.hxx" -- cgit From 35933081fda3551db61a81c9af5ac393fb5fc80e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 22 Jan 2010 19:07:50 +0100 Subject: swunolocking1: fix regression: SwXParagraphEnumeration constructor really needs the start node as a parameter because determining it from the cursor cannot work in nested tables. --- sw/inc/unoparagraph.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sw/inc') diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index add936e9c702..8743737c338e 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -55,7 +55,9 @@ struct SwPosition; class SwPaM; class SwUnoCrsr; +class SwStartNode; class SwTxtNode; +class SwTable; class SwXText; @@ -339,7 +341,9 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const & xParent, ::std::auto_ptr pCursor, - const CursorType eType); + const CursorType eType, + SwStartNode const*const pStartNode = 0, + SwTable const*const pTable = 0); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() -- cgit