From ebc5777548dea42ed966a16c66d879b1485bbfb4 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sun, 13 Jun 2010 15:22:56 +0200 Subject: CWS swlayoutrefactoring: #i81480#: enable sw code to use multiple layouts --- sw/inc/IDocumentLayoutAccess.hxx | 9 +- sw/inc/doc.hxx | 25 +-- sw/inc/docsh.hxx | 2 +- sw/inc/ndnotxt.hxx | 2 +- sw/inc/ndtxt.hxx | 2 +- sw/inc/node.hxx | 15 +- sw/inc/swcrsr.hxx | 4 +- sw/inc/txtftn.hxx | 3 +- sw/inc/viewopt.hxx | 16 +- sw/inc/viewsh.hxx | 12 +- sw/sdi/_docsh.sdi | 11 -- sw/sdi/_viewsh.sdi | 10 ++ sw/source/core/access/accdoc.cxx | 8 +- sw/source/core/access/accfrmobj.cxx | 4 +- sw/source/core/crsr/callnk.cxx | 10 +- sw/source/core/crsr/callnk.hxx | 3 +- sw/source/core/crsr/crsrsh.cxx | 52 ++++--- sw/source/core/crsr/crstrvl.cxx | 44 +++--- sw/source/core/crsr/crstrvl1.cxx | 2 +- sw/source/core/crsr/pam.cxx | 10 +- sw/source/core/crsr/swcrsr.cxx | 41 +++-- sw/source/core/crsr/trvlfnfl.cxx | 2 +- sw/source/core/crsr/trvltbl.cxx | 14 +- sw/source/core/crsr/unocrsr.cxx | 6 +- sw/source/core/crsr/viscrs.cxx | 16 +- sw/source/core/doc/doc.cxx | 115 +++++--------- sw/source/core/doc/docbm.cxx | 2 +- sw/source/core/doc/docchart.cxx | 6 +- sw/source/core/doc/doccorr.cxx | 6 +- sw/source/core/doc/docdesc.cxx | 93 +++++------ sw/source/core/doc/docdraw.cxx | 33 ++-- sw/source/core/doc/docedt.cxx | 10 +- sw/source/core/doc/docfld.cxx | 8 +- sw/source/core/doc/docfly.cxx | 16 +- sw/source/core/doc/docfmt.cxx | 9 +- sw/source/core/doc/docftn.cxx | 35 +++-- sw/source/core/doc/doclay.cxx | 83 +++++++--- sw/source/core/doc/docnew.cxx | 20 +-- sw/source/core/doc/docredln.cxx | 8 +- sw/source/core/doc/doctxm.cxx | 36 +++-- sw/source/core/doc/ftnidx.cxx | 8 +- sw/source/core/doc/htmltbl.cxx | 11 +- sw/source/core/doc/lineinfo.cxx | 23 +-- sw/source/core/doc/notxtfrm.cxx | 16 +- sw/source/core/doc/poolfmt.cxx | 2 +- sw/source/core/doc/swserv.cxx | 2 +- sw/source/core/doc/visiturl.cxx | 2 +- sw/source/core/docnode/ndsect.cxx | 31 ++-- sw/source/core/docnode/ndtbl.cxx | 18 +-- sw/source/core/docnode/ndtbl1.cxx | 10 +- sw/source/core/docnode/node.cxx | 35 +++-- sw/source/core/docnode/node2lay.cxx | 8 +- sw/source/core/docnode/nodes.cxx | 4 +- sw/source/core/draw/dcontact.cxx | 21 +-- sw/source/core/draw/dflyobj.cxx | 7 +- sw/source/core/draw/dpage.cxx | 2 +- sw/source/core/draw/dview.cxx | 22 +-- sw/source/core/edit/autofmt.cxx | 2 +- sw/source/core/edit/edattr.cxx | 2 +- sw/source/core/edit/eddel.cxx | 2 +- sw/source/core/edit/editsh.cxx | 16 +- sw/source/core/edit/edlingu.cxx | 4 +- sw/source/core/edit/edsect.cxx | 2 +- sw/source/core/edit/edundo.cxx | 12 +- sw/source/core/fields/authfld.cxx | 4 +- sw/source/core/fields/cellfml.cxx | 2 +- sw/source/core/fields/ddefld.cxx | 2 +- sw/source/core/fields/ddetbl.cxx | 2 +- sw/source/core/fields/docufld.cxx | 12 +- sw/source/core/fields/reffld.cxx | 8 +- sw/source/core/frmedt/fecopy.cxx | 2 +- sw/source/core/frmedt/fedesc.cxx | 4 +- sw/source/core/frmedt/fefly1.cxx | 22 +-- sw/source/core/frmedt/feflyole.cxx | 2 +- sw/source/core/frmedt/feshview.cxx | 14 +- sw/source/core/frmedt/fetab.cxx | 2 +- sw/source/core/frmedt/fews.cxx | 16 +- sw/source/core/frmedt/tblsel.cxx | 49 +++--- sw/source/core/graphic/ndgrf.cxx | 4 +- sw/source/core/inc/bodyfrm.hxx | 2 +- sw/source/core/inc/cellfrm.hxx | 2 +- sw/source/core/inc/cntfrm.hxx | 2 +- sw/source/core/inc/colfrm.hxx | 2 +- sw/source/core/inc/flyfrm.hxx | 3 +- sw/source/core/inc/flyfrms.hxx | 8 +- sw/source/core/inc/frame.hxx | 18 +-- sw/source/core/inc/frmtool.hxx | 3 +- sw/source/core/inc/ftnboss.hxx | 2 +- sw/source/core/inc/ftnfrm.hxx | 4 +- sw/source/core/inc/hffrm.hxx | 6 +- sw/source/core/inc/layfrm.hxx | 2 +- sw/source/core/inc/notxtfrm.hxx | 2 +- sw/source/core/inc/pagefrm.hxx | 2 +- sw/source/core/inc/rootfrm.hxx | 5 + sw/source/core/inc/rowfrm.hxx | 2 +- sw/source/core/inc/sectfrm.hxx | 2 +- sw/source/core/inc/tabfrm.hxx | 2 +- sw/source/core/inc/txtfrm.hxx | 2 +- sw/source/core/layout/atrfrm.cxx | 18 +-- sw/source/core/layout/calcmove.cxx | 13 +- sw/source/core/layout/colfrm.cxx | 12 +- sw/source/core/layout/findfrm.cxx | 16 -- sw/source/core/layout/flowfrm.cxx | 28 ++-- sw/source/core/layout/fly.cxx | 75 ++++++--- sw/source/core/layout/flycnt.cxx | 7 +- sw/source/core/layout/flyincnt.cxx | 4 +- sw/source/core/layout/flylay.cxx | 18 +-- sw/source/core/layout/flypos.cxx | 2 +- sw/source/core/layout/frmtool.cxx | 87 ++++++----- sw/source/core/layout/ftnfrm.cxx | 63 +++++--- sw/source/core/layout/hffrm.cxx | 24 +-- sw/source/core/layout/layact.cxx | 32 ++-- sw/source/core/layout/laycache.cxx | 22 ++- sw/source/core/layout/newfrm.cxx | 46 +++++- sw/source/core/layout/pagechg.cxx | 101 ++++++------ sw/source/core/layout/pagedesc.cxx | 2 +- sw/source/core/layout/paintfrm.cxx | 38 ++--- sw/source/core/layout/sectfrm.cxx | 53 ++++--- sw/source/core/layout/ssfrm.cxx | 10 +- sw/source/core/layout/tabfrm.cxx | 57 +++---- sw/source/core/layout/trvlfrm.cxx | 16 +- sw/source/core/layout/wsfrm.cxx | 108 +++++++------ .../tocntntanchoredobjectposition.cxx | 14 +- .../tolayoutanchoredobjectposition.cxx | 8 +- sw/source/core/ole/ndole.cxx | 2 +- sw/source/core/table/swnewtable.cxx | 2 +- sw/source/core/text/blink.cxx | 2 +- sw/source/core/text/frmcrsr.cxx | 14 +- sw/source/core/text/frmform.cxx | 8 +- sw/source/core/text/frmpaint.cxx | 11 +- sw/source/core/text/inftxt.cxx | 8 +- sw/source/core/text/itratr.cxx | 23 ++- sw/source/core/text/porfld.cxx | 16 +- sw/source/core/text/porfly.cxx | 3 +- sw/source/core/text/porrst.cxx | 13 +- sw/source/core/text/redlnitr.cxx | 4 +- sw/source/core/text/txtfld.cxx | 2 +- sw/source/core/text/txtfly.cxx | 15 +- sw/source/core/text/txtfrm.cxx | 29 ++-- sw/source/core/text/txtftn.cxx | 5 +- sw/source/core/text/txtio.cxx | 5 +- sw/source/core/tox/txmsrt.cxx | 2 +- sw/source/core/txtnode/SwGrammarContact.cxx | 2 +- sw/source/core/txtnode/atrflyin.cxx | 5 +- sw/source/core/txtnode/atrftn.cxx | 11 +- sw/source/core/txtnode/fntcache.cxx | 9 +- sw/source/core/txtnode/ndtxt.cxx | 16 +- sw/source/core/txtnode/txtedt.cxx | 2 +- sw/source/core/undo/rolbck.cxx | 2 +- sw/source/core/undo/unattr.cxx | 2 +- sw/source/core/undo/undobj1.cxx | 3 +- sw/source/core/undo/undraw.cxx | 3 +- sw/source/core/undo/unins.cxx | 2 +- sw/source/core/unocore/unocrsrhelper.cxx | 2 +- sw/source/core/unocore/unodraw.cxx | 12 +- sw/source/core/unocore/unoflatpara.cxx | 2 +- sw/source/core/unocore/unoobj2.cxx | 12 +- sw/source/core/view/vdraw.cxx | 2 +- sw/source/core/view/viewimp.cxx | 8 +- sw/source/core/view/viewpg.cxx | 1 - sw/source/core/view/viewsh.cxx | 102 +++++++++---- sw/source/core/view/vnew.cxx | 42 +++-- sw/source/core/view/vprint.cxx | 32 ++-- sw/source/filter/html/css1atr.cxx | 3 +- sw/source/filter/html/htmlforw.cxx | 3 +- sw/source/filter/html/htmltab.cxx | 2 +- sw/source/filter/rtf/rtfatr.cxx | 2 +- sw/source/filter/rtf/swparrtf.cxx | 2 +- sw/source/filter/ww1/fltshell.cxx | 4 +- sw/source/filter/ww8/ww8graf2.cxx | 3 +- sw/source/filter/xml/wrtxml.cxx | 2 +- sw/source/filter/xml/xmlexp.cxx | 4 +- sw/source/filter/xml/xmltbli.cxx | 2 +- sw/source/ui/app/docsh.cxx | 4 +- sw/source/ui/app/docsh2.cxx | 170 +++++---------------- sw/source/ui/app/swmodul1.cxx | 4 +- sw/source/ui/config/viewopt.cxx | 18 ++- sw/source/ui/docvw/edtwin.cxx | 2 +- sw/source/ui/inc/view.hxx | 1 + sw/source/ui/uiview/pview.cxx | 9 +- sw/source/ui/uiview/srcview.cxx | 1 + sw/source/ui/uiview/view.cxx | 53 ++++--- sw/source/ui/uiview/view0.cxx | 79 +++++++++- sw/source/ui/uiview/view2.cxx | 7 +- sw/source/ui/uiview/viewport.cxx | 51 +++++-- sw/source/ui/uiview/viewtab.cxx | 5 +- sw/source/ui/uno/unomod.cxx | 11 +- sw/source/ui/uno/unotxdoc.cxx | 28 +++- sw/source/ui/uno/unotxvw.cxx | 2 +- sw/source/ui/vba/vbainformationhelper.cxx | 5 +- sw/source/ui/vba/wordvbahelper.cxx | 4 +- 191 files changed, 1687 insertions(+), 1385 deletions(-) mode change 100644 => 100755 sw/inc/viewopt.hxx mode change 100644 => 100755 sw/source/core/view/viewpg.cxx diff --git a/sw/inc/IDocumentLayoutAccess.hxx b/sw/inc/IDocumentLayoutAccess.hxx index 8ff2f4c52588..3dd0d67aaaba 100644 --- a/sw/inc/IDocumentLayoutAccess.hxx +++ b/sw/inc/IDocumentLayoutAccess.hxx @@ -30,6 +30,7 @@ #include +class ViewShell; class SwRootFrm; class SwFrmFmt; class SfxItemSet; @@ -44,12 +45,14 @@ public: /** Returns the layout set at the document. */ - virtual const SwRootFrm* GetRootFrm() const = 0; - virtual SwRootFrm* GetRootFrm() = 0; + virtual const ViewShell* GetCurrentViewShell() const = 0; + virtual ViewShell* GetCurrentViewShell() = 0; //swmod 071107//swmod 071225 + virtual const SwRootFrm* GetCurrentLayout() const = 0; + virtual SwRootFrm* GetCurrentLayout() = 0; //swmod 080218 /** !!!The old layout must be deleted!!! */ - virtual void SetRootFrm( SwRootFrm* pNew ) = 0; + virtual void SetCurrentViewShell( ViewShell* pNew ) = 0; //swmod 071107//swmod 071225 /** */ diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d433ff603b2f..1601f6c04cb1 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -330,7 +330,7 @@ class SW_DLLPUBLIC SwDoc : SwTOXTypes *pTOXTypes; // Verzeichnisse SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's - SwRootFrm *pLayout; // Rootframe des spezifischen Layouts. + ViewShell *pCurrentView; // SwDoc should get a new member pCurrentView//swmod 071225 SdrModel *pDrawModel; // StarView Drawing SwUndos *pUndos; // Undo/Redo History @@ -469,7 +469,6 @@ private: bool mbCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move bool mbNoDrawUndoObj : 1; // TRUE: keine DrawUndoObjecte speichern bool mbVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt - bool mbBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen bool mbInReading : 1; // TRUE: Dokument wird gerade gelesen bool mbInXMLImport : 1; // TRUE: During xml import, attribute portion building is not necessary bool mbUpdateTOX : 1; // TRUE: nach Dokument laden die TOX Updaten @@ -600,6 +599,8 @@ private: bool mbProtectForm : 1; bool mbTabAtLeftIndentForParagraphsInList; // OD 2008-06-05 #i89181# - see above + bool mbLastBrowseMode : 1; + // #i78591# sal_uInt32 n32DummyCompatabilityOptions1; sal_uInt32 n32DummyCompatabilityOptions2; @@ -989,16 +990,17 @@ public: /** IDocumentLayoutAccess */ - virtual const SwRootFrm* GetRootFrm() const ; - virtual SwRootFrm* GetRootFrm(); - virtual void SetRootFrm( SwRootFrm* pNew ); + virtual void SetCurrentViewShell( ViewShell* pNew );//swmod 071225 virtual SwLayouter* GetLayouter(); virtual const SwLayouter* GetLayouter() const; virtual void SetLayouter( SwLayouter* pNew ); virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ); virtual void DelLayoutFmt( SwFrmFmt *pFmt ); virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms ); - + virtual const ViewShell *GetCurrentViewShell() const; //swmod 080219 + virtual ViewShell *GetCurrentViewShell();//swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later. + virtual const SwRootFrm *GetCurrentLayout() const; + virtual SwRootFrm *GetCurrentLayout();//swmod 080219 /** IDocumentTimerAccess */ virtual void StartIdling(); @@ -1199,6 +1201,8 @@ public: String GetUniqueOLEName() const; String GetUniqueFrameName() const; + std::set GetAllLayouts();//swmod 080225 + void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName ); const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const; @@ -1367,16 +1371,13 @@ public: // get the set of printable pages for the XRenderable API by // evaluating the respective settings (see implementation) - void CalculatePagesForPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, + void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ); - void CalculatePagePairsForProspectPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, + void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ); - sal_uInt16 GetPageCount() const; - const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const; - //PageDescriptor-Schnittstelle sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); } const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; } @@ -1941,7 +1942,7 @@ public: // update all modified OLE-Objects. The modification is called over the // StarOne - Interface --> Bug 67026 void SetOLEObjModified() - { if( GetRootFrm() ) aOLEModifiedTimer.Start(); } + { if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); } //swmod 071107//swmod 071225 // -------------------- Uno - Schnittstellen --------------------------- const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; } diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 16e6cd047fb6..26a06461f94a 100755 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -277,7 +277,7 @@ public: void EnterWait( BOOL bLockDispatcher ); void LeaveWait( BOOL bLockDispatcher ); - void ToggleBrowserMode(BOOL bOn, SwView* pView = 0); + void ToggleBrowserMode(BOOL bOn, SwView* pView); ULONG LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, BOOL bUnoCall ); diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx index 64586f06cd8c..cf0b60724e0c 100644 --- a/sw/inc/ndnotxt.hxx +++ b/sw/inc/ndnotxt.hxx @@ -63,7 +63,7 @@ protected: public: ~SwNoTxtNode(); - virtual SwCntntFrm *MakeFrm(); + virtual SwCntntFrm *MakeFrm( SwFrm* ); inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); } diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index cf3a4a779487..47e1b7008b6b 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -354,7 +354,7 @@ public: const ::com::sun::star::uno::Sequence& rOffsets ); // virtuelle Methoden aus dem CntntNode - virtual SwCntntFrm *MakeFrm(); + virtual SwCntntFrm *MakeFrm( SwFrm* ); virtual SwCntntNode *SplitCntntNode( const SwPosition & ); virtual SwCntntNode *JoinNext(); virtual SwCntntNode *JoinPrev(); diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 6cc14bbbf2c2..8bdf86af3a38 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -64,6 +64,7 @@ class SwTOXBase; class SwSectionNode; class SwStartNode; class SwTabFrm; +class SwRootFrm; class SwTable; class SwTableNode; class SwTableBox; @@ -402,8 +403,12 @@ public: virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - virtual SwCntntFrm *MakeFrm() = 0; + // MakeFrm will be called for a certain layout + // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent) + virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0; + virtual SwCntntNode *SplitCntntNode(const SwPosition & ) = 0; + virtual SwCntntNode *JoinNext(); virtual SwCntntNode *JoinPrev(); // koennen 2 Nodes zusammengefasst werden ? @@ -417,7 +422,9 @@ public: BOOL GoNext(SwIndex *, USHORT nMode ) const; BOOL GoPrevious(SwIndex *, USHORT nMode ) const; - SwCntntFrm *GetFrm( const Point* pDocPos = 0, + // Replacement for good old GetFrm(..): + SwCntntFrm *getLayoutFrm( const SwRootFrm*, + const Point* pDocPos = 0, const SwPosition *pPos = 0, const BOOL bCalcFrm = TRUE ) const; // Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres @@ -525,7 +532,7 @@ public: const SwTable& GetTable() const { return *pTable; } SwTable& GetTable() { return *pTable; } - SwTabFrm *MakeFrm(); + SwTabFrm *MakeFrm( SwFrm* ); //Legt die Frms fuer den TableNode (also die TabFrms) an. void MakeFrms( SwNodeIndex* pIdxBehind ); @@ -572,7 +579,7 @@ public: const SwSection& GetSection() const { return *m_pSection; } SwSection& GetSection() { return *m_pSection; } - SwFrm *MakeFrm(); + SwFrm *MakeFrm( SwFrm* ); //Legt die Frms fuer den SectionNode (also die SectionFrms) an. //Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt, diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 6e26a6a3bfcb..f61499a77452 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -137,7 +137,7 @@ public: BOOL GoEndWord(); BOOL GoNextWord(); BOOL GoPrevWord(); - BOOL SelectWord( const Point* pPt = 0 ); + BOOL SelectWord( ViewShell* pViewShell, const Point* pPt = 0 ); // API versions of above functions (will be used with a different // WordType for the break iterator) @@ -148,7 +148,7 @@ public: BOOL GoEndWordWT( sal_Int16 nWordType ); BOOL GoNextWordWT( sal_Int16 nWordType ); BOOL GoPrevWordWT( sal_Int16 nWordType ); - BOOL SelectWordWT( sal_Int16 nWordType, const Point* pPt = 0 ); + BOOL SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt = 0 ); enum SentenceMoveType { diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index 0b55053d03dd..af38c2c7d503 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -33,6 +33,7 @@ class SwNodeIndex; class SwTxtNode; class SwNodes; class SwDoc; +class SwFrm; // ATT_FTN ********************************************************** @@ -59,7 +60,7 @@ public: void MakeNewTextSection( SwNodes& rNodes ); // loesche die FtnFrame aus der Seite - void DelFrms(); + void DelFrms( const SwFrm* ); // bedingten Absatzvorlagen checken void CheckCondColl(); diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx old mode 100644 new mode 100755 index f0036e7abf35..8037bec0f4de --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -159,9 +159,10 @@ protected: BOOL bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings BOOL bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents // --> FME 2004-06-29 #114856# Formular view - BOOL bFormView : 1; + BOOL mbFormView : 1; // <-- - BOOL bBookview : 1; // view mode for page preview + BOOL mbBookview : 1; // view mode for page preview + BOOL mbBrowseMode : 1; //swmod 080130 BOOL mbViewLayoutBookMode : 1; // book view mode for edit view sal_Bool bShowPlaceHolderFields : 1; //only used in printing! @@ -404,12 +405,15 @@ public: void SetSelectionInReadonly(BOOL bSet) {bSelectionInReadonly = bSet;} // --> FME 2004-06-29 #114856# Formular view - BOOL IsFormView() const { return bFormView; } - void SetFormView( BOOL bSet ) { bFormView = bSet; } + BOOL IsFormView() const { return mbFormView; } + void SetFormView( BOOL bSet ) { mbFormView = bSet; } // <-- - inline BOOL IsPagePrevBookview() const { return bBookview; } - inline void SetPagePrevBookview(BOOL bSet) { bBookview = bSet; } + inline BOOL IsPagePrevBookview() const { return mbBookview; } + inline void SetPagePrevBookview(BOOL bSet) { mbBookview = bSet; } + + inline BOOL getBrowseMode() const { return mbBrowseMode; } + inline void setBrowseMode(BOOL bSet) { mbBrowseMode = bSet; } BOOL IsAutoCompleteWords() const; diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 78909e69e7ce..ea3a4a1501b7 100755 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -35,6 +35,7 @@ #include #include #include +#include // swmod 080115 #include #include @@ -98,7 +99,8 @@ namespace vcl // benoetigt werden. // Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt #define VSHELLFLAG_ISPREVIEW ((long)0x1) - +#define VSHELLFLAG_SHARELAYOUT ((long)0x2)//swmod 080125 flag +typedef boost::shared_ptr SwRootFrmPtr; class SW_DLLPUBLIC ViewShell : public Ring { @@ -170,6 +172,8 @@ class SW_DLLPUBLIC ViewShell : public Ring SdrPaintWindow* mpTargetPaintWindow; OutputDevice* mpBufferedOut; + SwRootFrmPtr pLayout; //swmod 080116 + //Initialisierung, wird von den verschiedenen Konstruktoren gerufen. SW_DLLPRIVATE void Init( const SwViewOption *pNewOpt ); @@ -277,7 +281,7 @@ public: //Invalidierung der ersten Sichtbaren Seite fuer alle Shells im Ring. void SetFirstVisPageInvalid(); - SwRootFrm *GetLayout() const; + SwRootFrm *GetLayout() const;//swmod 080116 sal_Bool IsNewLayout() const; //Wurde das Layout geladen oder neu //erzeugt? @@ -285,6 +289,10 @@ public: void CalcLayout(); //Durchformatierung des Layouts erzwingen. + sal_uInt16 GetPageCount() const; + + const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const; + inline SwDoc *GetDoc() const { return pDoc; } //niemals 0. /** Provides access to the document setting interface diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index cd2d1f850090..bc91e94064a7 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -121,17 +121,6 @@ interface BaseTextDocument StateMethod = GetState ; ] - SID_BROWSER_MODE - [ - ExecMethod = Execute; - StateMethod = GetState; - ] - - FN_PRINT_LAYOUT - [ - ExecMethod = Execute; - StateMethod = GetState; - ] } diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index b45e4a305328..bb42f71b5054 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -98,6 +98,16 @@ interface BaseTextEditView ExecMethod = ExecDraw ; StateMethod = GetDrawState ; ] + SID_BROWSER_MODE + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + FN_PRINT_LAYOUT + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] FN_REDLINE_PROTECT [ ExecMethod = Execute; diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index e0d3945e0a51..713a58f1b247 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -66,10 +66,10 @@ using lang::IndexOutOfBoundsException; // SwAccessiblePreview // -SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap* pInitMap ) : - SwAccessibleContext( pInitMap, AccessibleRole::DOCUMENT, - pInitMap->GetShell()->getIDocumentLayoutAccess()->GetRootFrm() ), - mxParent( pInitMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ), +SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap *_pMap ) : + SwAccessibleContext( _pMap, AccessibleRole::DOCUMENT, + _pMap->GetShell()->GetLayout() ),//swmod 071107//swmod 071225 + mxParent( _pMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ), mpChildWin( 0 ) { } diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index 47b4007c1496..66f41e2d7ec1 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -356,7 +356,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const if( bInPagePreview ) pParent = pFly->FindPageFrm(); else - pParent = pFly->FindRootFrm(); + pParent = pFly->getRootFrm(); } } else @@ -392,7 +392,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const if( bInPagePreview ) pParent = pContact->GetAnchorFrm()->FindPageFrm(); else - pParent = pContact->GetAnchorFrm()->FindRootFrm(); + pParent = pContact->GetAnchorFrm()->getRootFrm(); } } } diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index bf06a19d83b0..333adb0f3275 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -69,7 +69,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh ) bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() ); if( ND_TEXTNODE & nNdTyp ) - nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nCntnt, + nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)rNd, nCntnt, !rShell.ActionPend() ); else { @@ -124,7 +124,7 @@ SwCallLink::~SwCallLink() { // nur wenn mit Left/right getravellt, dann Text-Hints pruefen // und sich nicht der Frame geaendert hat (Spalten!) - if( nLeftFrmPos == SwCallLink::GetFrm( (SwTxtNode&)*pCNd, nAktCntnt, + if( nLeftFrmPos == SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)*pCNd, nAktCntnt, !rShell.ActionPend() ) && (( nCmp = nCntnt ) + 1 == nAktCntnt || // Right nCntnt -1 == ( nCmp = nAktCntnt )) ) // Left @@ -191,7 +191,7 @@ SwCallLink::~SwCallLink() const SwFrm* pFrm; const SwFlyFrm *pFlyFrm; - if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,FALSE) ) && + if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,FALSE) ) && 0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() ) { const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx(); @@ -204,9 +204,9 @@ SwCallLink::~SwCallLink() } } -long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ) +long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ) { - SwTxtFrm* pFrm = (SwTxtFrm*)rNd.GetFrm(0,0,bCalcFrm), *pNext = pFrm; + SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm; if ( pFrm && !pFrm->IsHiddenNow() ) { if( pFrm->HasFollow() ) diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx index f85e0c5db123..dcedf0b13137 100644 --- a/sw/source/core/crsr/callnk.hxx +++ b/sw/source/core/crsr/callnk.hxx @@ -31,6 +31,7 @@ class SwCrsrShell; class SwTxtNode; +class SwRootFrm; class SwCallLink { @@ -48,7 +49,7 @@ public: bool bAktSelection ); ~SwCallLink(); - static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ); + static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ); }; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 9af115269cd8..6a5d6bdb7590 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -186,8 +186,8 @@ SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const const SwCntntNode* pCNd; if( pTblCrsr->GetPoint()->nNode.GetIndex() && pTblCrsr->GetMark()->nNode.GetIndex() && - 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->GetFrm()) + 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->getLayoutFrm( GetLayout() ) && + 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( GetLayout() ) ) { SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr; GetLayout()->MakeTblCrsrs( *pTC ); @@ -215,7 +215,7 @@ void SwCrsrShell::StartAction() nAktNdTyp = rNd.GetNodeType(); bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark(); if( ND_TEXTNODE & nAktNdTyp ) - nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, TRUE ); + nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, TRUE ); else nLeftFrmPos = 0; } @@ -307,6 +307,7 @@ if( GetWin() ) USHORT nParm = SwCrsrShell::CHKRANGE; if ( !bIdleEnd ) nParm |= SwCrsrShell::SCROLLWIN; + if( !IsViewLocked() ) UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen { @@ -583,7 +584,7 @@ BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage ) SwCrsrSaveState aSaveState( *pCurCrsr ); Point& rPt = pCurCrsr->GetPtPos(); SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()-> - GetFrm( &rPt, pCurCrsr->GetPoint() ); + getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), FALSE ); if( pFrm && TRUE == ( bRet = GetFrmInPage( pFrm, fnWhichPage, fnPosPage, pCurCrsr ) ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | @@ -629,7 +630,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt ) SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); if( pCNd ) { - pFrm = pCNd->GetFrm( &rPt, 0, FALSE )->GetUpper(); + pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, FALSE )->GetUpper(); while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() ) pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm() : pFrm->GetUpper(); @@ -715,10 +716,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) else if( aPos.nNode.GetNode().IsCntntNode() ) { // im gleichen Frame gelandet? - SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aCharRect.Pos(), 0, FALSE ); - SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aPt, 0, FALSE ); + SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm( + GetLayout(), &aCharRect.Pos(), 0, FALSE ); + SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm( + GetLayout(), &aPt, 0, FALSE ); if( pNew == pOld ) return bRet; } @@ -1248,7 +1249,7 @@ void SwCrsrShell::UpdateCrsrPos() Size aOldSz( GetDocSize() ); SwCntntNode *pCNode = pShellCrsr->GetCntntNode(); SwCntntFrm *pFrm = pCNode ? - pCNode->GetFrm( &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ) :0; + pCNode->getLayoutFrm( GetLayout(), &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ) :0; if( !pFrm || (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) ) { SwCrsrMoveState aTmpState( MV_NONE ); @@ -1385,7 +1386,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) } SwCntntFrm *pTblFrm = pPos->nNode.GetNode().GetCntntNode()-> - GetFrm( &aTmpPt, pPos ); + getLayoutFrm( GetLayout(), &aTmpPt, pPos, FALSE ); ASSERT( pTblFrm, "Tabelle Crsr nicht im Content ??" ); @@ -1402,7 +1403,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) // Second check if mark is in repeated headline: if ( !bInRepeatedHeadline ) { - SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() ); + SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )-> + getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), FALSE ); ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" ); if ( pMarkTblFrm ) @@ -1615,8 +1617,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) BOOL bAgainst; do { bAgainst = FALSE; - pFrm = pShellCrsr->GetCntntNode()->GetFrm( - &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ); + pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), + &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ); // ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout // erzeugt werden, weil ja mal hier einer vorhanden war !! if ( !pFrm ) @@ -1624,8 +1626,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) do { CalcLayout(); - pFrm = pShellCrsr->GetCntntNode()->GetFrm( - &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ); + pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), + &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ); } while( !pFrm ); } else if ( Imp()->IsIdleAction() ) @@ -1811,7 +1813,7 @@ void SwCrsrShell::RefreshBlockCursor() ASSERT( pBlockCrsr, "Don't call me without a block cursor" ); SwShellCrsr &rBlock = pBlockCrsr->getShellCrsr(); Point aPt = rBlock.GetPtPos(); - SwCntntFrm* pFrm = rBlock.GetCntntNode()->GetFrm( &aPt, rBlock.GetPoint() ); + SwCntntFrm* pFrm = rBlock.GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, rBlock.GetPoint(), FALSE ); Point aMk; if( pBlockCrsr->getEndPoint() && pBlockCrsr->getStartPoint() ) { @@ -2129,13 +2131,13 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const const USHORT* pST = &nStartAction; ++(*((USHORT*)pST)); const Size aOldSz( GetDocSize() ); - pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() ); + pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() ); --(*((USHORT*)pST)); if( aOldSz != GetDocSize() ) ((SwCrsrShell*)this)->SizeChgNotify(); } else - pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE); + pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE); } return pRet; } @@ -2315,7 +2317,7 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt ) pSectNd->GetSection().IsProtectFlag())) ) return FALSE; - SwCntntFrm *pFrm = pTxtNd->GetFrm( &aPt, &aPos ); + SwCntntFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, &aPos ); if ( Imp()->IsIdleAction() ) pFrm->PrepareCrsr(); SwRect aTmp( aCharRect ); @@ -2768,7 +2770,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode(); const SwCntntFrm * pFrm; - if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),FALSE)) && + if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),FALSE)) && !IsReadOnlyAvailable() && pFrm->IsProtected() && nNdIdx < rNds.GetEndOfExtras().GetIndex() ) { @@ -2884,7 +2886,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() ) { // Teste mal auf Fly - kann auch noch geschuetzt sein!! - if( 0 == (pFrm = pCNd->GetFrm(0,0,FALSE)) || + if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,FALSE)) || ( !IsReadOnlyAvailable() && pFrm->IsProtected() ) || ( bOnlyText && pCNd->IsNoTxtNode() ) ) { @@ -2916,7 +2918,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) // falls Cursor im versteckten Bereich ist, auf jedenfall schon mal // verschieben!! - if( !pCNd || !pCNd->GetFrm(0,0,FALSE) ) + if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,FALSE) ) { SwCrsrMoveState aTmpState( MV_NONE ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); @@ -3305,7 +3307,7 @@ String SwCrsrShell::GetCrsrDescr() const SwRect SwCrsrShell::GetRectOfCurrentChar() { - SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->GetFrm( 0, pCurCrsr->GetPoint(), FALSE ); + SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), 0, pCurCrsr->GetPoint(), FALSE ); SwRect aRet; SwCrsrMoveState aTmpState( MV_NONE ); aTmpState.bRealHeight = TRUE; @@ -3494,7 +3496,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, SwCrsrMoveState aState; aState.bRealWidth = TRUE; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), FALSE); + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), FALSE); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 249500b95f98..2641b323b166 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -94,7 +94,7 @@ BOOL SwCrsrShell::GotoNextNum() // dann versuche den Cursor auf die Position zu setzen, // auf halber Heohe vom Char-SRectangle Point aPt( pCurCrsr->GetPtPos() ); - SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt, + SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, pCurCrsr->GetPoint() ); pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() ); pFrm->Calc(); @@ -134,7 +134,7 @@ BOOL SwCrsrShell::GotoPrevNum() // dann versuche den Cursor auf die Position zu setzen, // auf halber Heohe vom Char-SRectangle Point aPt( pCurCrsr->GetPtPos() ); - SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt, + SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, pCurCrsr->GetPoint() ); pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() ); pFrm->Calc(); @@ -278,7 +278,7 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader ) const SwFrm* pFrm; Point aPt( pCurCrsr->GetPtPos() ); - if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, FALSE ) )) + if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) )) { // dann kann der Cursor ja auch hinein gesetzt werden SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -329,7 +329,7 @@ BOOL SwCrsrShell::GotoNextTOXBase( const String* pName ) const SwCntntFrm* pCFrm; if( pCNd && pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() && - 0 != ( pCFrm = pCNd->GetFrm() ) && + 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { pFnd = pCNd; @@ -379,7 +379,7 @@ BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName ) const SwCntntFrm* pCFrm; if( pCNd && pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() && - 0 != ( pCFrm = pCNd->GetFrm() ) && + 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { pFnd = pCNd; @@ -432,7 +432,7 @@ BOOL SwCrsrShell::GotoTOXMarkBase() const SwCntntFrm* pCFrm; if( pCNd && pCNd->EndOfSectionIndex() < pSectNd->EndOfSectionIndex() && - 0 != ( pCFrm = pCNd->GetFrm() ) && + 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -480,7 +480,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() ) // auch beim Einsammeln wird nur der erste Frame benutzt! - aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm( + aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) ); { @@ -500,7 +500,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) const SwCntntFrm* pCFrm; SwNodeIndex aIdx( *pTBox->GetSttNd() ); const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); - if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, FALSE ) ) && + if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ) && (IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { _SetGetExpFld aCmp( *pTBox ); @@ -551,7 +551,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() ) // auch beim Einsammeln wird nur der erste Frame benutzt! aCurGEF.SetBodyPos( *rPos.nNode.GetNode(). - GetCntntNode()->GetFrm( &aPt, &rPos, FALSE ) ); + GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) ); { const SfxPoolItem* pItem; @@ -565,7 +565,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) RES_TXTATR_TOXMARK, n ) ) && 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) && ( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() && - 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, FALSE )) && + 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE )) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj. @@ -643,7 +643,7 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, { SwCntntFrm* pCFrm; const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); - if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, FALSE )) && + if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE )) && ( bInReadOnly || !pCFrm->IsProtected() )) { _SetGetExpFld* pNew = new _SetGetExpFld( @@ -728,7 +728,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, { // auch beim Einsammeln wird nur der erste Frame benutzt! Point aPt; - aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, FALSE ) ); + aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) ); } BOOL bFound = aSrtLst.Seek_Entry( &aSrch, &nPos ); @@ -1113,7 +1113,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG; // rCntntAtPos.pFndTxtAttr = pTxtAttr; - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); } } @@ -1133,7 +1133,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( pFld ) { - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); if( bSetCrsr ) @@ -1231,7 +1231,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.pFndTxtAttr = pTxtAttr; rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr(); - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); } } @@ -1299,7 +1299,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.pFndTxtAttr = pTxtAttr; rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr(); - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); } } @@ -1336,7 +1336,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR; rCntntAtPos.pFndTxtAttr = pTxtAttr; - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); } } @@ -1352,7 +1352,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.pFndTxtAttr = 0; bRet = TRUE; - if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) + if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); } } @@ -1383,7 +1383,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, #endif ) { - SwFrm* pF = pTxtNd->GetFrm( &aPt ); + SwFrm* pF = pTxtNd->getLayoutFrm( GetLayout(), &aPt ); if( pF ) { // dann aber den CellFrame @@ -1591,7 +1591,7 @@ BOOL SwContentAtPos::IsInProtectSect() const const SwCntntFrm* pFrm; return pNd && ( pNd->IsInProtectSect() || - ( 0 != ( pFrm = pNd->GetFrm(0,0,FALSE)) && + ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,FALSE)) && pFrm->IsProtected() )); } bool SwContentAtPos::IsInRTLText()const @@ -2101,7 +2101,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) { const SwCntntNode* pCNd = aCurPos.GetNodeFromCntnt()->GetCntntNode(); SwCntntFrm* pFrm; - if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt )) ) + if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt )) ) aCurPos.SetBodyPos( *pFrm ); } @@ -2123,7 +2123,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) _SetGetExpFld aPos( aTmpPos.nNode, rAttr ); SwCntntFrm* pFrm; if( pTxtNd->GetIndex() < nBodySttNdIdx && - 0 != ( pFrm = pTxtNd->GetFrm( &aPt )) ) + 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt )) ) aPos.SetBodyPos( *pFrm ); if( bNext diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index fcdcd99241f4..9ffa1f720f30 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -91,7 +91,7 @@ BOOL SwCrsrShell::GoStartSentence() BOOL SwCrsrShell::SelectWord( const Point* pPt ) { - return pCurCrsr->SelectWord( pPt ); + return pCurCrsr->SelectWord( this, pPt ); } diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index ec30b5aefbe0..a79203c13ece 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -640,7 +640,7 @@ USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos ) const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark; if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) && - 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, FALSE )) && + 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, FALSE )) && 0 != ( pPg = pCFrm->FindPageFrm() )) return pPg->GetPhyPageNum(); return 0; @@ -683,7 +683,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const const SwCntntFrm *pFrm; if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() )) - pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), FALSE ); + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), FALSE ); else pFrm = 0; @@ -711,7 +711,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode ) { if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() )) - pFrm = pNd->GetFrm( &aTmpPt, GetMark(), FALSE ); + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), FALSE ); else pFrm = 0; @@ -868,7 +868,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, { if( ( - 0 == ( pFrm = pNd->GetFrm()) || + 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) || ( !bInReadOnly && pFrm->IsProtected() ) || (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) ) || @@ -905,7 +905,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, { // nur in der AutoTextSection koennen Node stehen, die // nicht angezeigt werden !! - if( 0 == ( pFrm = pNd->GetFrm()) || + if( 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) || ( !bInReadOnly && pFrm->IsProtected() ) || ( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow() ) ) diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index d8286d007395..8c536698288b 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -31,10 +31,8 @@ #include #include - #include #include - #include #include #include @@ -53,14 +51,13 @@ #include #include #include +#include #include #include #include #include #include // ...Percent() -#ifndef _STATSTR_HRC #include // ResId fuer Statusleiste -#endif #include // SwRedline @@ -351,7 +348,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) const SwNode* pNd = &GetPoint()->nNode.GetNode(); if( pNd->IsCntntNode() && !dynamic_cast(this) ) { - const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->GetFrm(); + const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ); if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() && 0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) ) { @@ -368,7 +365,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) if( !pFrm ) { bGoNxt = !bGoNxt; - pFrm = ((SwCntntNode*)pNd)->GetFrm(); + pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ); while ( pFrm && 0 == pFrm->Frm().Height() ) { pFrm = bGoNxt ? pFrm->GetNextCntntFrm() @@ -425,7 +422,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) const SwTableNode* pPtNd = pNd->FindTableNode(); if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode() && - !((SwCntntNode*)pNd)->GetFrm() && !dynamic_cast(this) ) + !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) && !dynamic_cast(this) ) { DeleteMark(); RestoreSavePos(); @@ -696,7 +693,7 @@ BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const const SwPosition* pPos = bPoint ? GetPoint() : GetMark(); const SwNode* pNd = &pPos->nNode.GetNode(); - if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->GetFrm() && + if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) && !dynamic_cast(this) ) { return FALSE; @@ -1176,9 +1173,9 @@ BOOL SwCursor::GoPrevWord() return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -BOOL SwCursor::SelectWord( const Point* pPt ) +BOOL SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt ) { - return SelectWordWT( WordType::ANYWORD_IGNOREWHITESPACES, pPt ); + return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt ); } BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const @@ -1354,20 +1351,20 @@ BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType ) return bRet; } -BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) +BOOL SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt ) { SwCrsrSaveState aSave( *this ); BOOL bRet = FALSE; BOOL bForward = TRUE; DeleteMark(); - SwRootFrm* pLayout; - if( pPt && 0 != (pLayout = GetDoc()->GetRootFrm()) ) + const SwRootFrm* pLayout = pViewShell->GetLayout(); + if( pPt && 0 != pLayout ) { // set the cursor to the layout position Point aPt( *pPt ); pLayout->GetCrsrOfst( GetPoint(), aPt ); - } + } //swmod 071107//swmod 071225 const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) @@ -1515,7 +1512,7 @@ SwCursor::DoSetBidiLevelLeftRight( // for visual cursor travelling (used in bidi layout) // we first have to convert the logic to a visual position Point aPt; - pSttFrm = rTNd.GetFrm( &aPt, GetPoint() ); + pSttFrm = rTNd.getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); if( pSttFrm ) { BYTE nCrsrLevel = GetCrsrBidiLevel(); @@ -1654,7 +1651,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() ) { Point aPt; - const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).GetFrm( &aPt, GetPoint() ); + const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); if ( pEndFrm ) { if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() ) @@ -1723,7 +1720,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, Point aPt; if( pPt ) aPt = *pPt; - SwCntntFrm* pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + SwCntntFrm* pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); if( pFrm ) { @@ -1761,7 +1758,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, const SwNode* pEndNd = pTblNd->EndOfSectionNode(); GetPoint()->nNode = *pEndNd; pTblCrsr->Move( fnMoveBackward, fnGoNode ); - pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); } } @@ -1770,7 +1767,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, : pFrm->UnitDown( this, nUpDownX, bInReadOnly ) ) && CheckNodesRange( aOldPos.nNode, GetPoint()->nNode, bChkRange )) { - pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); --nCnt; } @@ -1781,7 +1778,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, { // dann versuche den Cursor auf die Position zu setzen, // auf halber Heohe vom Char-Rectangle - pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); SwCrsrMoveState eTmpState( MV_UPDOWN ); eTmpState.bSetInReadOnly = bInReadOnly; SwRect aTmpRect; @@ -1814,7 +1811,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI ) { Point aPt; - SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); // calculate cursor bidi level if ( pFrm ) @@ -1828,7 +1825,7 @@ BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const { BOOL bRet = FALSE; Point aPt; - SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); + SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() ); if( pFrm ) { SwPaM aPam( *GetPoint() ); diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 3edf3718eabe..82c9b56a2489 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -95,7 +95,7 @@ BOOL SwCrsrShell::GotoFtnTxt() _GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode() : NULL; if( pTxtNd ) { - const SwFrm *pFrm = pTxtNd->GetFrm( &_GetCrsr()->GetSttPos(), + const SwFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &_GetCrsr()->GetSttPos(), _GetCrsr()->Start() ); const SwFtnBossFrm* pFtnBoss; sal_Bool bSkip = pFrm && pFrm->IsInFtn(); diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index d9a887e61ad9..e76994ba09fe 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -194,7 +194,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) const SwShellCrsr *pCrsr = _GetCrsr(); const SwFrm* pStartFrm = pFrm; const SwCntntNode *pCNd = pCrsr->GetCntntNode( FALSE ); - const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0; + const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0; if ( bRow ) { @@ -381,7 +381,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) if ( !pCNd ) return false; - SwCntntFrm* pFrm = pCNd->GetFrm(); + SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ); if ( 0 == pFrm || pCNd->FindTableNode() != pTblNd || (!bInReadOnly && pFrm->IsProtected() ) ) @@ -413,7 +413,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) return false; // check if we have found a suitable table cell: - pFrm = pCNd->GetFrm(); + pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ); if ( 0 != pFrm && pCNd->FindTableNode() == pTblNd && (bInReadOnly || !pFrm->IsProtected() ) ) @@ -455,7 +455,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) if ( !pCNd ) return false; - SwCntntFrm* pFrm = pCNd->GetFrm(); + SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ); if( 0 == pFrm || pCNd->FindTableNode() != pTblNd || (!bInReadOnly && pFrm->IsProtected() )) @@ -476,7 +476,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) if ( !pCNd ) return false; - pFrm = pCNd->GetFrm(); + pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ); if( 0 != pFrm && pCNd->FindTableNode() == pTblNd && (bInReadOnly || !pFrm->IsProtected() ) ) @@ -747,7 +747,7 @@ String SwCrsrShell::GetBoxNms() const if( IsTableMode() ) { SwCntntNode *pCNd = pTblCrsr->Start()->nNode.GetNode().GetCntntNode(); - pFrm = pCNd ? pCNd->GetFrm() : 0; + pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0; if( !pFrm ) return sNm; @@ -769,7 +769,7 @@ String SwCrsrShell::GetBoxNms() const } SwCntntNode* pCNd = pPos->nNode.GetNode().GetCntntNode(); - pFrm = pCNd ? pCNd->GetFrm() : 0; + pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0; if( pFrm ) { diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx index a4e0d6f79785..065855acb49d 100644 --- a/sw/source/core/crsr/unocrsr.cxx +++ b/sw/source/core/crsr/unocrsr.cxx @@ -252,9 +252,9 @@ void SwUnoTableCrsr::MakeBoxSels() const SwCntntNode* pCNd; bool bMakeTblCrsrs = true; if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() && - 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->GetFrm() ) - bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this ); + 0 != ( pCNd = GetCntntNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) && + 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) ) + bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this ); //swmod 080218 if ( !bMakeTblCrsrs ) { diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 16bf730b33a7..6f9f488fcb3d 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -454,7 +454,7 @@ void SwVisCrsr::_SetPosAndShow() if( rNode.IsTxtNode() ) { const SwTxtNode& rTNd = *rNode.GetTxtNode(); - const SwFrm* pFrm = rTNd.GetFrm( 0, 0, FALSE ); + const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, FALSE ); if ( pFrm ) { const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo(); @@ -745,11 +745,11 @@ void SwShellCrsr::FillRects() // die neuen Rechtecke berechnen if( HasMark() && GetPoint()->nNode.GetNode().IsCntntNode() && - GetPoint()->nNode.GetNode().GetCntntNode()->GetFrm() && + GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) && (GetMark()->nNode == GetPoint()->nNode || (GetMark()->nNode.GetNode().IsCntntNode() && - GetMark()->nNode.GetNode().GetCntntNode()->GetFrm() ) )) - GetDoc()->GetRootFrm()->CalcFrmRects( *this, GetShell()->IsTableMode() ); + GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) )) + GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() ); //swmod 071107//swmod 071225 } @@ -822,7 +822,7 @@ short SwShellCrsr::MaxReplaceArived() // eine SSelection kann erzeugt werden SvUShorts aArr; USHORT nActCnt; - ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(), + ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ), *pSh = pShell; do { for( nActCnt = 0; pSh->ActionPend(); ++nActCnt ) @@ -839,7 +839,7 @@ short SwShellCrsr::MaxReplaceArived() for( nActCnt = aArr[n]; nActCnt--; ) pSh->StartAction(); pSh = (ViewShell*)pSh->GetNext(); - } + } //swmod 071107//swmod 071225 } else // ansonsten aus dem Basic, und dann auf RET_YES schalten @@ -952,7 +952,7 @@ void SwShellTableCrsr::FillRects() if( !pCNd ) continue; - SwFrm* pFrm = pCNd->GetFrm( &GetSttPos() ); + SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetSttPos() ); while( pFrm && !pFrm->IsCellFrm() ) pFrm = pFrm->GetUpper(); @@ -988,7 +988,7 @@ BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const if( !pCNd ) continue; - SwFrm* pFrm = pCNd->GetFrm( &GetPtPos() ); + SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetPtPos() ); while( pFrm && !pFrm->IsCellFrm() ) pFrm = pFrm->GetUpper(); ASSERT( pFrm, "Node nicht in einer Tabelle" ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 7f2b92979f57..fd5b7ab1dc12 100755 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -108,6 +108,7 @@ #include #include #include +#include #include // _SetGetExpFld #include // SwPostItField #include @@ -196,7 +197,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const // <-- // COMPATIBILITY FLAGS END - case BROWSE_MODE: return mbBrowseMode; + case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked! case HTML_MODE: return mbHTMLMode; case GLOBAL_DOCUMENT: return mbIsGlobalDoc; case GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks; @@ -319,8 +320,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) // <-- // COMPATIBILITY FLAGS END - case BROWSE_MODE: - mbBrowseMode = value; + case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable + mbLastBrowseMode = value; break; case HTML_MODE: mbHTMLMode = value; @@ -360,7 +361,7 @@ const i18n::ForbiddenCharacters* } void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang, - /*[in]*/ const i18n::ForbiddenCharacters& rFChars ) + /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars ) { if( !xForbiddenCharsTable.isValid() ) { @@ -377,12 +378,14 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang, pDrawModel->ReformatAllTextObjects(); } - if( pLayout && !mbInReading ) + SwRootFrm* pTmpRoot = GetCurrentLayout(); + if( pTmpRoot && !mbInReading ) { - pLayout->StartAllAction(); - pLayout->InvalidateAllCntnt(); - pLayout->EndAllAction(); - } + pTmpRoot->StartAllAction(); + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE)); + pTmpRoot->EndAllAction(); + }//swmod 080310 SetModified(); } @@ -446,12 +449,14 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n ) pDrawModel->ReformatAllTextObjects(); } - if( pLayout && !mbInReading ) + SwRootFrm* pTmpRoot = GetCurrentLayout(); + if( pTmpRoot && !mbInReading ) { - pLayout->StartAllAction(); - pLayout->InvalidateAllCntnt(); - pLayout->EndAllAction(); - } + pTmpRoot->StartAllAction(); + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE)); + pTmpRoot->EndAllAction(); + }//swmod 080310 SetModified(); } } @@ -1198,15 +1203,12 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm ) void SwDoc::CalculatePagesForPrinting( + const SwRootFrm& rLayout, /* out */ SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, sal_Int32 nDocPageCount ) { - DBG_ASSERT( pLayout, "no layout present" ); - if (!pLayout) - return; - const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 ); const bool bPrintSelection = nContent == 2; @@ -1223,7 +1225,7 @@ void SwDoc::CalculatePagesForPrinting( aMulti.SetTotalRange( Range( 0, RANGE_MAX ) ); aMulti.Select( aPages ); - const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower(); + const SwPageFrm *pStPage = dynamic_cast( rLayout.Lower() ); const SwFrm *pEndPage = pStPage; USHORT nFirstPageNo = 0; @@ -1420,7 +1422,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData( { // get the correct number of current pages for the post-it document rData.m_pPostItShell->CalcLayout(); - const sal_Int32 nPages = rData.m_pPostItDoc->GetPageCount(); + const sal_Int32 nPages = rData.m_pPostItShell->GetPageCount(); aPostItLastStartPageNum[ nPhyPageNum ] = nPages; } } @@ -1428,7 +1430,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData( // format post-it doc to get correct number of pages rData.m_pPostItShell->CalcLayout(); - const sal_Int32 nPostItDocPageCount = rData.m_pPostItDoc->GetPageCount(); + const sal_Int32 nPostItDocPageCount = rData.m_pPostItShell->GetPageCount(); if (nPostItMode == POSTITS_ONLY || nPostItMode == POSTITS_ENDDOC) { @@ -1547,6 +1549,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData( void SwDoc::CalculatePagePairsForProspectPrinting( + const SwRootFrm& rLayout, /* out */ SwRenderData &rData, const SwPrintUIOptions &rOptions, sal_Int32 nDocPageCount ) @@ -1575,11 +1578,10 @@ void SwDoc::CalculatePagePairsForProspectPrinting( } StringRangeEnumerator aRange( aPageRange, 1, nDocPageCount, 0 ); - DBG_ASSERT( pLayout, "no layout present" ); - if (!pLayout || aRange.size() <= 0) + if ( aRange.size() <= 0) return; - const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower(); + const SwPageFrm *pStPage = dynamic_cast( rLayout.Lower() ); sal_Int32 i = 0; for ( i = 1; pStPage && i < nDocPageCount; ++i ) pStPage = (SwPageFrm*)pStPage->GetNext(); @@ -1589,7 +1591,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // currently for prospect printing all pages are valid to be printed // thus we add them all to the respective map and set for later use sal_Int32 nPageNum = 0; - const SwPageFrm *pPageFrm = (SwPageFrm*)pLayout->Lower(); + const SwPageFrm *pPageFrm = dynamic_cast( rLayout.Lower() ); while( pPageFrm && nPageNum < nDocPageCount ) { DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" ); @@ -1692,32 +1694,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // thus we are done here. } - -sal_uInt16 SwDoc::GetPageCount() const -{ - return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; -} - -const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const -{ - Size aSize; - if( GetRootFrm() && nPageNum ) - { - const SwPageFrm* pPage = static_cast - (GetRootFrm()->Lower()); - - while( --nPageNum && pPage->GetNext() ) - pPage = static_cast( pPage->GetNext() ); - - if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) - pPage = static_cast( pPage->GetNext() ); - - aSize = pPage->Frm().SSize(); - } - return aSize; -} - - /************************************************************************* * void UpdateDocStat( const SwDocStat& rStat ); *************************************************************************/ @@ -1762,7 +1738,7 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) } } - rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; + rStat.nPage = GetCurrentLayout() ? GetCurrentLayout()->GetPageNum() : 0; //swmod 080218 rStat.bModified = FALSE; SetDocStat( rStat ); @@ -2069,46 +2045,35 @@ BOOL lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* ) void SwDoc::SpellItAgainSam( BOOL bInvalid, BOOL bOnlyWrong, BOOL bSmartTags ) { - ASSERT( GetRootFrm(), "SpellAgain: Where's my RootFrm?" ); + std::set aAllLayouts = GetAllLayouts();//swmod 080307 + ASSERT( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" ); if( bInvalid ) { - SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower(); - while ( pPage ) - { - if ( bSmartTags ) - pPage->InvalidateSmartTags(); - - pPage->InvalidateSpelling(); - pPage = (SwPageFrm*)pPage->GetNext(); - } - GetRootFrm()->SetNeedGrammarCheck( true ); - + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::AllInvalidateSmartTagsOrSpelling),bSmartTags));//swmod 080305 + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::SetNeedGrammarCheck), true) ); if ( bSmartTags ) GetNodes().ForEach( lcl_CheckSmartTagsAgain, &bOnlyWrong ); - GetNodes().ForEach( lcl_SpellAndGrammarAgain, &bOnlyWrong ); } - GetRootFrm()->SetIdleFlags(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080307 } void SwDoc::InvalidateAutoCompleteFlag() { - if( GetRootFrm() ) + SwRootFrm* pTmpRoot = GetCurrentLayout(); + if( pTmpRoot ) { - SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower(); - while ( pPage ) - { - pPage->InvalidateAutoCompleteWords(); - pPage = (SwPageFrm*)pPage->GetNext(); - } + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));//swmod 080305 for( ULONG nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd ) { SwTxtNode* pTxtNode = GetNodes()[ nNd ]->GetTxtNode(); if ( pTxtNode ) pTxtNode->SetAutoCompleteWordDirty( true ); } - GetRootFrm()->SetIdleFlags(); - } + + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080228 + } //swmod 080219 } const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 0080694722ba..ca3ab77a2d5c 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1286,7 +1286,7 @@ void _SaveCntntIdx(SwDoc* pDoc, if( pNode ) { - SwFrm* pFrm = pNode->GetFrm(); + SwFrm* pFrm = pNode->getLayoutFrm( pDoc->GetCurrentLayout() ); #if OSL_DEBUG_LEVEL > 1 static BOOL bViaDoc = FALSE; if( bViaDoc ) diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index 85b59cc556df..4ef5891271a3 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -132,7 +132,7 @@ IMPL_LINK( SwDoc, DoUpdateAllCharts, Timer *, EMPTYARG ) return 0; } -void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const +void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const { String aName( rTbl.GetFrmFmt()->GetName() ); SwOLENode *pONd; @@ -144,7 +144,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const SwFrm* pFrm; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && aName.Equals( pONd->GetChartTblName() ) && - 0 != ( pFrm = pONd->GetFrm() ) ) + 0 != ( pFrm = pONd->getLayoutFrm( rVSh.GetLayout() ) ) ) { SwChartDataProvider *pPCD = GetChartDataProvider(); if (pPCD) @@ -248,7 +248,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable ) aIdx++; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ && - 0 != (pONd->GetFrm()) /* chart frame is not hidden */ ) + 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ ) { uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index e567a52085be..87ec511c62dd 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -439,9 +439,9 @@ void SwDoc::CorrRel(const SwNodeIndex& rOldNode, SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const { // Layout und OLE-Shells sollten vorhanden sein! - if( pLayout && pLayout->GetCurrShell() ) + if( pCurrentView ) { - ViewShell *pSh = pLayout->GetCurrShell(), *pVSh = pSh; + register ViewShell *pSh = pCurrentView, *pVSh = pSh; if( ppSh ) *ppSh = pSh; @@ -453,7 +453,7 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const } while( pVSh != ( pSh = (ViewShell*)pSh->GetNext() )); } else if( ppSh ) - *ppSh = 0; + *ppSh = 0; //swmod 071029//swmod 071225 return 0; } diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 0b56578e0536..1f05a93f1abd 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -202,6 +202,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." ); SwPageDesc *pDesc = aPageDescs[i]; + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 BOOL bDoesUndo = DoesUndo(); if (DoesUndo()) @@ -397,9 +398,12 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) } } - if ( (bUseOn || bFollow) && GetRootFrm() ) + if ( (bUseOn || bFollow) && pTmpRoot) //Layot benachrichtigen! - GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() ); + { + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080304 + } //Jetzt noch die Seiten-Attribute uebernehmen. ::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() ); @@ -447,28 +451,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) |* |*************************************************************************/ -void lcl_RemoveFrms( SwFrmFmt& rFmt, BOOL& rbFtnsRemoved ) -{ - SwClientIter aIter( rFmt ); - SwFrm *pFrm; - for( pFrm = (SwFrm*)aIter.First(TYPE(SwFrm)); pFrm; - pFrm = (SwFrm*)aIter.Next() ) - if ( !rbFtnsRemoved && pFrm->IsPageFrm() && - ((SwPageFrm*)pFrm)->IsFtnPage() ) - { - rFmt.getIDocumentLayoutAccess()->GetRootFrm()->RemoveFtns( 0, FALSE, TRUE ); - rbFtnsRemoved = TRUE; - } - else - { - pFrm->Cut(); - delete pFrm; - } -} - // #i7983# void SwDoc::PreDelPageDesc(SwPageDesc * pDel) { + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 if (0 == pDel) return; @@ -501,8 +487,11 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) pLast == pEndNoteInfo->GetPageDescDep() ) { aPageDescs[0]->Add( pLast ); - if ( GetRootFrm() ) - GetRootFrm()->CheckFtnPageDescs( !bFtnInf ); + if ( pTmpRoot ) + { + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), !bFtnInf));//swmod 080228 + } } } @@ -515,24 +504,12 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) //die Attribute wiederum reichen die Meldung an die Absaetze weiter. //Layot benachrichtigen! - if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer) - GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() ); + if( pTmpRoot ) // ist nicht immer vorhanden!! (Orginizer) + { + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080228 } } - - if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer) - { - //Wenn jetzt noch irgendwelche Seiten auf die FrmFmt'e (Master und Left) - //Zeigen (z.B. irgendwelche Fussnotenseiten), so muessen die Seiten - //vernichtet werden. - - // Wenn wir auf Endnotenseiten stossen, schmeissen wir alle Fussnoten weg, - // anders kann die Reihenfolge der Seiten (FollowsPageDescs usw.) - // nicht garantiert werden. - BOOL bFtnsRemoved = FALSE; - - ::lcl_RemoveFrms( pDel->GetMaster(), bFtnsRemoved ); - ::lcl_RemoveFrms( pDel->GetLeft(), bFtnsRemoved ); } } @@ -667,7 +644,7 @@ void SwDoc::PrtDataChanged() ASSERT( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) || 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" ) // <-- - + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 SwWait *pWait = 0; BOOL bEndAction = FALSE; @@ -675,16 +652,16 @@ void SwDoc::PrtDataChanged() GetDocShell()->UpdateFontList(); BOOL bDraw = TRUE; - if ( GetRootFrm() ) + if ( pTmpRoot ) { - ViewShell *pSh = GetRootFrm()->GetCurrShell(); - if( !get(IDocumentSettingAccess::BROWSE_MODE) || - ( pSh && pSh->GetViewOptions()->IsPrtFormat() ) ) + ViewShell *pSh = GetCurrentViewShell(); + if( !pSh->GetViewOptions()->getBrowseMode() || + pSh->GetViewOptions()->IsPrtFormat() ) { if ( GetDocShell() ) pWait = new SwWait( *GetDocShell(), TRUE ); - GetRootFrm()->StartAllAction(); + pTmpRoot->StartAllAction(); bEndAction = TRUE; bDraw = FALSE; @@ -695,7 +672,9 @@ void SwDoc::PrtDataChanged() } pFntCache->Flush(); - GetRootFrm()->InvalidateAllCntnt(); + + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));//swmod 080304 if ( pSh ) { @@ -704,11 +683,11 @@ void SwDoc::PrtDataChanged() pSh->InitPrt( pPrt ); pSh = (ViewShell*)pSh->GetNext(); } - while ( pSh != GetRootFrm()->GetCurrShell() ); + while ( pSh != GetCurrentViewShell() ); } } - } + } //swmod 080218 if ( bDraw && pDrawModel ) { const sal_Bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING); @@ -723,7 +702,7 @@ void SwDoc::PrtDataChanged() PrtOLENotify( TRUE ); if ( bEndAction ) - GetRootFrm()->EndAllAction(); + pTmpRoot->EndAllAction(); //swmod 080218 delete pWait; } @@ -737,18 +716,18 @@ extern SvPtrarr *pGlobalOLEExcludeList; void SwDoc::PrtOLENotify( BOOL bAll ) { SwFEShell *pShell = 0; - if ( GetRootFrm() && GetRootFrm()->GetCurrShell() ) + if ( GetCurrentViewShell() ) { - ViewShell *pSh = GetRootFrm()->GetCurrShell(); + ViewShell *pSh = GetCurrentViewShell(); if ( !pSh->ISA(SwFEShell) ) do { pSh = (ViewShell*)pSh->GetNext(); } while ( !pSh->ISA(SwFEShell) && - pSh != GetRootFrm()->GetCurrShell() ); + pSh != GetCurrentViewShell() ); if ( pSh->ISA(SwFEShell) ) pShell = (SwFEShell*)pSh; - } + } //swmod 071107//swmod 071225 if ( !pShell ) { //Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber @@ -788,7 +767,7 @@ void SwDoc::PrtOLENotify( BOOL bAll ) { ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY, 0, pNodes->Count(), GetDocShell()); - GetRootFrm()->StartAllAction(); + GetCurrentLayout()->StartAllAction(); //swmod 080218 for( USHORT i = 0; i < pNodes->Count(); ++i ) { @@ -844,7 +823,7 @@ void SwDoc::PrtOLENotify( BOOL bAll ) } } delete pNodes; - GetRootFrm()->EndAllAction(); + GetCurrentLayout()->EndAllAction(); //swmod 080218 ::EndProgress( GetDocShell() ); } } @@ -874,7 +853,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) { ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY, 0, aOLENodes.Count(), GetDocShell()); - GetRootFrm()->StartAllAction(); + GetCurrentLayout()->StartAllAction(); //swmod 080218 SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR ); for( USHORT i = 0; i < aOLENodes.Count(); ++i ) @@ -905,7 +884,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) pOLENd->Modify( &aMsgHint, &aMsgHint ); } } - GetRootFrm()->EndAllAction(); + GetCurrentLayout()->EndAllAction(); //swmod 080218 ::EndProgress( GetDocShell() ); } } diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 1a10428d5a58..312115566374 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -548,7 +548,7 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn, if( RES_FLYFRMFMT == pFmt->Which() ) { - if( pFmt->getIDocumentLayoutAccess()->GetRootFrm() ) + if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225 { // Schauen, ob es ein SdrObject dafuer gibt if( aIter.First( TYPE( SwFlyFrm) ) ) @@ -650,7 +650,8 @@ void SwDoc::InitDrawModel() nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID(); } - pDrawModel->InsertPage( pDrawModel->AllocPage( FALSE ) ); + SdrPage* pMasterPage = pDrawModel->AllocPage( FALSE ); + pDrawModel->InsertPage( pMasterPage ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" ); @@ -675,10 +676,24 @@ void SwDoc::InitDrawModel() pDrawModel->SetRefDevice( pRefDev ); pDrawModel->SetNotifyUndoActionHdl( LINK( this, SwDoc, AddDrawUndo )); - if ( pLayout ) + if ( pCurrentView ) { - pLayout->SetDrawPage( pDrawModel->GetPage( 0 ) ); - pLayout->GetDrawPage()->SetSize( pLayout->Frm().SSize() ); + ViewShell* pViewSh = pCurrentView; + do + { + SwRootFrm* pRoot = pViewSh->GetLayout(); + if( pRoot && !pRoot->GetDrawPage() ) + { + // Disable "multiple layout" for the moment: + // use pMasterPage instead of a new created SdrPage + // pDrawModel->AllocPage( FALSE ); + // pDrawModel->InsertPage( pDrawPage ); + SdrPage* pDrawPage = pMasterPage; + pRoot->SetDrawPage( pDrawPage ); + pDrawPage->SetSize( pRoot->Frm().SSize() ); + } + pViewSh = (ViewShell*)pViewSh->GetNext(); + }while( pViewSh != pCurrentView ); } } @@ -844,14 +859,14 @@ SdrModel* SwDoc::_MakeDrawModel() { ASSERT( !pDrawModel, "_MakeDrawModel: Why?" ); InitDrawModel(); - if ( pLayout && pLayout->GetCurrShell() ) + if ( pCurrentView ) { - ViewShell* pTmp = pLayout->GetCurrShell(); + ViewShell* pTmp = pCurrentView; do { pTmp->MakeDrawView(); pTmp = (ViewShell*) pTmp->GetNext(); - } while ( pTmp != pLayout->GetCurrShell() ); + } while ( pTmp != pCurrentView ); //Broadcast, damit die FormShell mit der DrawView verbunden werden kann if( GetDocShell() ) @@ -859,7 +874,7 @@ SdrModel* SwDoc::_MakeDrawModel() SfxSimpleHint aHnt( SW_BROADCAST_DRAWVIEWS_CREATED ); GetDocShell()->Broadcast( aHnt ); } - } + } //swmod 071029//swmod 071225 return pDrawModel; } diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index c9ee5b00e181..34cf23aed8ce 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -210,7 +210,7 @@ void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx, pFmt, pFmt->GetDoc()->GetSpzFrmFmts()->Count() ); pFmt->SetFmtAttr( aAnchor ); SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode(); - if( pCNd && pCNd->GetFrm( 0, 0, sal_False ) ) + if( pCNd && pCNd->getLayoutFrm( pFmt->GetDoc()->GetCurrentLayout(), 0, 0, sal_False ) ) pFmt->MakeFrms(); } } @@ -407,7 +407,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd, } else { - pSrch->DelFrms(); + pSrch->DelFrms(0); rFtnArr.Remove( nPos ); if( bSaveFtn ) rSaveArr.Insert( pSrch ); @@ -435,7 +435,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd, } else { - pSrch->DelFrms(); + pSrch->DelFrms(0); rFtnArr.Remove( nPos ); if( bSaveFtn ) rSaveArr.Insert( pSrch ); @@ -1881,7 +1881,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, switch( pNd->GetNodeType() ) { case ND_TEXTNODE: - if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) ) + if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetCurrentLayout() )) ) { // geschutze Cellen/Flys ueberspringen, ausgeblendete //ebenfalls @@ -2111,7 +2111,7 @@ sal_Bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs ) SwHyphArgs *pHyphArgs = (SwHyphArgs*)pArgs; if( pNode ) { - SwCntntFrm* pCntFrm = pNode->GetFrm(); + SwCntntFrm* pCntFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout() ); if( pCntFrm && !((SwTxtFrm*)pCntFrm)->IsHiddenNow() ) { sal_uInt16 *pPageSt = pHyphArgs->GetPageSt(); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index ebac34bf3540..7c2da903419d 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -567,7 +567,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) { // steht im Sonderbereich, wird teuer !! Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !! - pFrm = rTxtNd.GetFrm( &aPt ); + pFrm = rTxtNd.getLayoutFrm( GetCurrentLayout(), &aPt ); if( pFrm ) { SwPosition aPos( *pTblNd ); @@ -638,7 +638,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( !pCNd ) pCNd = GetNodes().GoNext( &aCNdIdx ); - if( pCNd && 0 != (pFrm = pCNd->GetFrm( &aPt )) ) + if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetCurrentLayout(), &aPt )) ) { SwPosition aPos( *pCNd ); if( GetBodyTxtNode( *this, aPos, *pFrm ) ) @@ -2521,7 +2521,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich ) // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) Point aPt; - const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, FALSE ); + const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE ); _SetGetExpFld* pNew = NULL; BOOL bIsInBody = FALSE; @@ -2587,7 +2587,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) Point aPt; - const SwCntntFrm* pFrm = pCNd->GetFrm( &aPt, 0, FALSE ); + const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE ); if( !pFrm ) break; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 68c525ad74e1..307de496314e 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -175,7 +175,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, const SwFrmFmt* pFlyFmt ) { Point aRet; - if( rDoc.GetRootFrm() ) + if( rDoc.GetCurrentViewShell() ) //swmod 071107//swmod 071225 switch( rAnch.GetAnchorId() ) { case FLY_AS_CHAR: @@ -193,7 +193,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, { const SwPosition *pPos = rAnch.GetCntntAnchor(); const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode(); - const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, FALSE ) : 0; + const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, FALSE ) : 0; if( pOld ) aRet = pOld->Frm().Pos(); } @@ -213,7 +213,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, case FLY_AT_PAGE: { USHORT nPgNum = rAnch.GetPageNum(); - const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower(); + const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); for( USHORT i = 1; (i <= nPgNum) && pPage; ++i, pPage = (const SwPageFrm*)pPage->GetNext() ) if( i == nPgNum ) @@ -652,7 +652,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, const sal_Bool _bSameOnly, const sal_Bool _bPosCorr ) { - ASSERT( GetRootFrm(), "Ohne Layout geht gar nichts" ); + ASSERT( GetCurrentLayout(), "Ohne Layout geht gar nichts" ); //swmod 080218 if ( !_rMrkList.GetMarkCount() || _rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() ) @@ -750,11 +750,11 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, SwPosition aPos( GetNodes() ); Point aPoint( aPt ); aPoint.X() -= 1; - GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState ); + GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); // OD 20.06.2003 #108784# - consider that drawing objects // can be in header/footer. Thus, by left-top-corner pTxtFrm = aPos.nNode.GetNode(). - GetCntntNode()->GetFrm( &aPt, 0, FALSE ); + GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE ); } const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt ); pNewAnchorFrm = pTmp->FindFlyFrm(); @@ -772,7 +772,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, } case FLY_AT_PAGE: { - pNewAnchorFrm = GetRootFrm()->Lower(); + pNewAnchorFrm = GetCurrentLayout()->Lower(); while ( pNewAnchorFrm && !pNewAnchorFrm->Frm().IsInside( aPt ) ) pNewAnchorFrm = pNewAnchorFrm->GetNext(); if ( !pNewAnchorFrm ) @@ -811,7 +811,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // es muss ein TextNode gefunden werden, denn nur dort // ist ein inhaltsgebundenes DrawObjekt zu verankern SwCrsrMoveState aState( MV_SETONLYTEXT ); - GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState ); + GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080218 } else { diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index d971ac0c51fe..810e9fb2310a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -2171,6 +2171,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, BOOL bCopyPoolIds ) { BOOL bNotifyLayout = FALSE; + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 rDstDesc.SetLandscape( rSrcDesc.GetLandscape() ); rDstDesc.SetNumType( rSrcDesc.GetNumType() ); @@ -2234,9 +2235,11 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, else rDstDesc.GetLeft().SetFmtAttr( rDstDesc.GetMaster().GetFooter() ); - if( bNotifyLayout && GetRootFrm() ) - //Layot benachrichtigen! - GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() ); + if( bNotifyLayout && pTmpRoot ) + { + std::set aAllLayouts = GetAllLayouts();//swmod 080225 + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080226 + } //Wenn sich FussnotenInfo veraendert, so werden die Seiten //angetriggert. diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 61bab9fdd525..092b05783977 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -255,6 +255,7 @@ SwFtnInfo::SwFtnInfo(SwTxtFmtColl *pFmt) : void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) { + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 if( !(GetFtnInfo() == rInfo) ) { const SwFtnInfo &rOld = GetFtnInfo(); @@ -279,15 +280,19 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) *pFtnInfo = rInfo; - if ( GetRootFrm() ) + if (pTmpRoot) { + std::set aAllLayouts = GetAllLayouts();//swmod 080304 if ( bFtnPos ) - GetRootFrm()->RemoveFtns(); + //pTmpRoot->RemoveFtns(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllRemoveFtns));//swmod 080305 else { - GetRootFrm()->UpdateFtnNums(); + //pTmpRoot->UpdateFtnNums(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 080304 if ( bFtnDesc ) - GetRootFrm()->CheckFtnPageDescs( FALSE ); + //pTmpRoot->CheckFtnPageDescs( FALSE ); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), FALSE));//swmod 080304 if ( bExtra ) { //Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns @@ -302,7 +307,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) } } } - } + } //swmod 080219 if( FTNNUM_PAGE != rInfo.eNum ) GetFtnIdxs().UpdateAllFtn(); else if( bFtnChrFmts ) @@ -324,6 +329,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) { + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 if( !(GetEndNoteInfo() == rInfo) ) { if( DoesUndo() ) @@ -345,10 +351,14 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) *pEndNoteInfo = rInfo; - if ( GetRootFrm() ) + if ( pTmpRoot ) { if ( bFtnDesc ) - GetRootFrm()->CheckFtnPageDescs( TRUE ); + //pTmpRoot->CheckFtnPageDescs( TRUE ); + { + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), TRUE));//swmod 080304 + } if ( bExtra ) { //Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns @@ -362,7 +372,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr()); } } - } + } //swmod 080219 if( bNumChg ) GetFtnIdxs().UpdateAllFtn(); else if( bFtnChrFmts ) @@ -387,6 +397,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, sal_uInt16 nNumber, bool bIsEndNote ) { SwFtnIdxs& rFtnArr = GetFtnIdxs(); + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End(); const ULONG nSttNd = pStt->nNode.GetIndex(); @@ -485,8 +496,12 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, if ( !bTypeChgd ) rFtnArr.UpdateAllFtn(); } - else if( GetRootFrm() ) - GetRootFrm()->UpdateFtnNums(); + else if( pTmpRoot ) + // + { + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums)); + } //swmod 080304pTmpRoot->UpdateFtnNums(); //swmod 080219 SetModified(); } else diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index ceb7d6e3463c..63a278cdc0c7 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -726,8 +726,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, } // Frames anlegen - if( GetRootFrm() ) - pFmt->MakeFrms(); // ??? + if( GetCurrentViewShell() ) + pFmt->MakeFrms(); // ??? //swmod 071108//swmod 071225 if( DoesUndo() ) { @@ -1003,7 +1003,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, SwDrawContact* pContact = new SwDrawContact( pFmt, &rDrawObj ); // ggfs. Frames anlegen - if( GetRootFrm() ) + if( GetCurrentViewShell() ) { pFmt->MakeFrms(); // --> OD 2005-02-09 #i42319# - follow-up of #i35635# @@ -1119,11 +1119,11 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, // kein Layout oder nur ein Teil, dann wars das // Seitenbezogen Flys nur, wenn vollstaendig "gewuenscht" wird ! - if( !GetRootFrm() || pCmpRange ) + if( !GetCurrentViewShell() || pCmpRange ) //swmod 071108//swmod 071225 return; pFPos = 0; - SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->GetLower(); + SwPageFrm *pPage = (SwPageFrm*)GetCurrentLayout()->GetLower(); //swmod 080218 while( pPage ) { if( pPage->GetSortedObjs() ) @@ -1860,11 +1860,12 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) pModLogFile = new ::rtl::Logfile( "First DoIdleJobs" ); #endif - if( GetRootFrm() && GetRootFrm()->GetCurrShell() && + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 + if( pTmpRoot && !SfxProgress::GetActiveProgress( pDocShell ) ) { ViewShell *pSh, *pStartSh; - pSh = pStartSh = GetRootFrm()->GetCurrShell(); + pSh = pStartSh = GetCurrentViewShell(); do { if( pSh->ActionPend() ) { @@ -1875,10 +1876,9 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) pSh = (ViewShell*)pSh->GetNext(); } while( pSh != pStartSh ); - if (GetRootFrm()->IsNeedGrammarCheck()) + if( pTmpRoot->IsNeedGrammarCheck() ) { BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell(); - sal_Bool bIsAutoGrammar = sal_False; SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii( UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; @@ -1886,12 +1886,20 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) if (bIsOnlineSpell && bIsAutoGrammar) StartGrammarChecking( *this ); } - - sal_uInt16 nFldUpdFlag; - if( GetRootFrm()->IsIdleFormat() ) - GetRootFrm()->GetCurrShell()->LayoutIdle(); - else if( ( AUTOUPD_FIELD_ONLY == - ( nFldUpdFlag = static_cast(getFieldUpdateFlags(true)) ) + SwFldUpdateFlags nFldUpdFlag; + std::set aAllLayouts = GetAllLayouts();//swmod 080320 + std::set::iterator pLayIter = aAllLayouts.begin(); + for ( ;pLayIter != aAllLayouts.end();pLayIter++ ) + { + if ((*pLayIter)->IsIdleFormat()) + { + (*pLayIter)->GetCurrShell()->LayoutIdle(); + break; + } + } + BOOL bAllValid = pLayIter == aAllLayouts.end() ? 1 : 0; + if( bAllValid && ( AUTOUPD_FIELD_ONLY == + ( nFldUpdFlag = getFieldUpdateFlags(true) ) || AUTOUPD_FIELD_AND_CHARTS == nFldUpdFlag ) && GetUpdtFlds().IsFieldsDirty() && !GetUpdtFlds().IsInUpdateFlds() && @@ -1903,7 +1911,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) // chaos::Action-Klammerung! GetUpdtFlds().SetInUpdateFlds( sal_True ); - GetRootFrm()->StartAllAction(); + pTmpRoot->StartAllAction(); // no jump on update of fields #i85168# const sal_Bool bOldLockView = pStartSh->IsViewLocked(); @@ -1914,14 +1922,14 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) UpdateTblFlds(NULL); // Tabellen UpdateRefFlds(NULL); // Referenzen - GetRootFrm()->EndAllAction(); + pTmpRoot->EndAllAction(); pStartSh->LockView( bOldLockView ); GetUpdtFlds().SetInUpdateFlds( sal_False ); GetUpdtFlds().SetFieldsDirty( sal_False ); } - } + } //swmod 080219 #ifdef TIMELOG if( pModLogFile && 1 != (long)pModLogFile ) delete pModLogFile, ((long&)pModLogFile) = 1; @@ -1934,7 +1942,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) IMPL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem*, EMPTYARG ) { ViewShell *pSh, *pStartSh; - pSh = pStartSh = pThis->GetRootFrm()->GetCurrShell(); + pSh = pStartSh = pThis->GetCurrentViewShell(); //swmod 071108//swmod 071225 if( pStartSh ) do { if( pSh->GetWin() ) @@ -2171,9 +2179,9 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const // Redlines auch an Start- und Endnodes haengen, muss der Index nicht // unbedingt der eines Content-Nodes sein. SwNode* pNd = &rIdx.GetNode(); - if( pNd->IsCntntNode() && pLayout ) + if( pNd->IsCntntNode() && pCurrentView )//swmod 071029//swmod 071225 { - const SwFrm *pFrm = pNd->GetCntntNode()->GetFrm(); + const SwFrm *pFrm = pNd->GetCntntNode()->getLayoutFrm( GetCurrentLayout() ); if( pFrm ) { const SwFrm *pUp = pFrm->GetUpper(); @@ -2286,9 +2294,36 @@ sal_Bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) con return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; } -const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; } -SwRootFrm* SwDoc::GetRootFrm() { return pLayout; } -void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; } +//const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; } +//SwRootFrm* SwDoc::GetRootFrm() { return pLayout; } +//void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; } //swmod 071029//swmod 071225 +void SwDoc::SetCurrentViewShell( ViewShell* pNew ) { pCurrentView = pNew; }//swmod 071227 SwLayouter* SwDoc::GetLayouter() { return pLayouter; } const SwLayouter* SwDoc::GetLayouter() const { return pLayouter; } void SwDoc::SetLayouter( SwLayouter* pNew ) { pLayouter = pNew; } +const ViewShell *SwDoc::GetCurrentViewShell() const { return pCurrentView;} //swmod 080219 +ViewShell *SwDoc::GetCurrentViewShell() { return pCurrentView;} //swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later. +const SwRootFrm *SwDoc::GetCurrentLayout() const { + if(GetCurrentViewShell()) + return GetCurrentViewShell()->GetLayout(); + return 0; +} +SwRootFrm *SwDoc::GetCurrentLayout(){ + + if(GetCurrentViewShell()) + return GetCurrentViewShell()->GetLayout(); + return 0; +} +std::set SwDoc::GetAllLayouts(){ + std::set aAllLayouts; + ViewShell *pStart = GetCurrentViewShell(); + ViewShell *pTemp = pStart; + do { + if (pTemp->GetLayout()) { + aAllLayouts.insert(pTemp->GetLayout()); + pTemp = (ViewShell*)pTemp->GetNext(); + } + } while(pTemp!=pStart); + return aAllLayouts; +}//swmod 070825 + diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index fe4044dd58ac..44697c7d8a38 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -238,7 +238,8 @@ SwDoc::SwDoc() : pGrfFmtCollTbl( new SwGrfFmtColls() ), pTOXTypes( new SwTOXTypes() ), pDefTOXBases( new SwDefTOXBase_Impl() ), - pLayout( 0 ), // Rootframe des spezifischen Layouts. + //pLayout( 0 ), // Rootframe des spezifischen Layouts. //swmod 071029 + pCurrentView( 0 ), //swmod 071225 pDrawModel( 0 ), pUndos( new SwUndos( 0, 20 ) ), pUpdtFlds( new SwDocUpdtFld() ), @@ -301,6 +302,7 @@ SwDoc::SwDoc() : mbColumnSelection( false ), // i#78591# mbProtectForm(false), + mbLastBrowseMode( false ), n32DummyCompatabilityOptions1(0), n32DummyCompatabilityOptions2(0), mbStartIdleTimer(sal_False) @@ -317,7 +319,7 @@ SwDoc::SwDoc() : mbNewDoc = mbCopyIsMove = mbNoDrawUndoObj = - mbBrowseMode = + //mbBrowseMode =//swmod 080130 mbInReading = mbInXMLImport = mbUpdateTOX = @@ -526,7 +528,7 @@ SwDoc::~SwDoc() // damit die Fussnotenattribute die Fussnotennodes in Frieden lassen. mbDtor = TRUE; - DELETEZ( pLayout ); + //DELETEZ( pCurrentView ); //swmod 080110//test if i can commit delete pRedlineTbl; delete pUnoCrsrTbl; @@ -829,7 +831,7 @@ void SwDoc::ClearDoc() // den ersten immer wieder neu anlegen (ohne Attribute/Vorlagen/...) SwTxtNode* pFirstNd = GetNodes().MakeTxtNode( aSttIdx, pDfltTxtFmtColl ); - if( pLayout ) + if( pCurrentView ) //swmod 071029//swmod 071225 { // set the layout to the dummy pagedesc pFirstNd->SetAttr( SwFmtPageDesc( pDummyPgDsc )); @@ -881,14 +883,14 @@ void SwDoc::ClearDoc() pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 ); pCharFmtTbl->DeleteAndDestroy( 1, pCharFmtTbl->Count()-1 ); - if( pLayout ) + if( pCurrentView ) { // search the FrameFormat of the root frm. This is not allowed to delete - pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pLayout->GetFmt() ) ); + pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pCurrentView->GetLayout()->GetFmt() ) ); pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 ); - pFrmFmtTbl->Insert( pLayout->GetFmt(), pFrmFmtTbl->Count() ); + pFrmFmtTbl->Insert( pCurrentView->GetLayout()->GetFmt(), pFrmFmtTbl->Count() ); } - else + else //swmod 071029//swmod 071225 pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 ); xForbiddenCharsTable.unbind(); @@ -991,7 +993,7 @@ void SwDoc::UpdateLinks( BOOL bUI ) SfxMedium* pMedium = GetDocShell()->GetMedium(); SfxFrame* pFrm = pMedium ? pMedium->GetLoadTargetFrame() : 0; Window* pDlgParent = pFrm ? &pFrm->GetWindow() : 0; - if( GetRootFrm() && !GetEditShell( &pVSh ) && !pVSh ) + if( GetCurrentViewShell() && !GetEditShell( &pVSh ) && !pVSh ) //swmod 071108//swmod 071225 { ViewShell aVSh( *this, 0, 0 ); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 71dc70106245..861162b6d486 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2754,8 +2754,8 @@ void SwRedlineTbl::Remove( USHORT nP, USHORT nL ) _SwRedlineTbl::Remove( nP, nL ); ViewShell* pSh; - if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() && - 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) ) + if( pDoc && !pDoc->IsInDtor() && + 0 != ( pSh = pDoc->GetCurrentViewShell()) ) //swmod 071108//swmod 071225 pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) ); } @@ -2768,8 +2768,8 @@ void SwRedlineTbl::DeleteAndDestroy( USHORT nP, USHORT nL ) _SwRedlineTbl::DeleteAndDestroy( nP, nL ); ViewShell* pSh; - if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() && - 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) ) + if( pDoc && !pDoc->IsInDtor() && + 0 != ( pSh = pDoc->GetCurrentViewShell() ) ) //swmod 071108//swmod 071225 pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) ); } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 58b3e084cf7a..dd8485ece497 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -271,7 +271,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, if( pTOXMark != &rCurTOXMark && 0 != ( pMark = pTOXMark->GetTxtTOXMark()) && 0 != ( pTOXSrc = pMark->GetpTxtNd() ) && - 0 != ( pCFrm = pTOXSrc->GetFrm( &aPt, 0, FALSE )) && + 0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE )) && ( bInReadOnly || !pCFrm->IsProtected() )) { CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() ); @@ -810,7 +810,7 @@ BOOL SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, BOOL bAtStart ) const --------------------------------------------------------------------*/ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, - const bool _bNewTOX ) + const bool _bNewTOX )//swmodtest 080307 { const SwSectionNode* pSectNd; if( !SwTOXBase::GetRegisteredIn()->GetDepends() || @@ -1090,9 +1090,13 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" )); pDoc->GetNodes().Delete( aInsPos, 1 ); aN2L.RestoreUpperFrms( pDoc->GetNodes(), nIdx, nIdx + 1 ); - if(pDoc->GetRootFrm()) - SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetRootFrm()->Lower() ); - + std::set aAllLayouts = pDoc->GetAllLayouts(); + for ( std::set::iterator pLayoutIter = aAllLayouts.begin(); pLayoutIter != aAllLayouts.end(); pLayoutIter++) + { + SwFrm::CheckPageDescs( (SwPageFrm*)(*pLayoutIter)->Lower() ); + }//swmod 080310 + //if(pDoc->GetCurrentLayout()) + //SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetCurrentLayout()->Lower() ); //swmod 080218 SetProtect( SwTOXBase::IsProtected() ); } @@ -1226,7 +1230,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl, // if selected use marks from the same chapter only if( pTOXSrc->GetNodes().IsDocNodes() && pTOXSrc->GetTxt().Len() && pTOXSrc->GetDepends() && - pTOXSrc->GetFrm() && + pTOXSrc->getLayoutFrm( pDoc->GetCurrentLayout() ) && (!IsFromChapter() || ::lcl_FindChapterNode( *pTOXSrc, 0 ) == pOwnChapterNode ) && !pTOXSrc->HasHiddenParaField() && !SwScriptInfo::IsInHiddenRange( *pTOXSrc, *pTxtMark->GetStart() ) ) @@ -1290,7 +1294,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode ) if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() && //USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei USHORT( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei - pTxtNd->GetFrm() && + pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && !pTxtNd->HasHiddenParaField() && !pTxtNd->HasHiddenCharAttribute( true ) && ( !IsFromChapter() || @@ -1332,7 +1336,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode ) { ::SetProgressState( 0, pDoc->GetDocShell() ); - if( pTxtNd->GetTxt().Len() && pTxtNd->GetFrm() && + if( pTxtNd->GetTxt().Len() && pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && pTxtNd->GetNodes().IsDocNodes() && ( !IsFromChapter() || pOwnChapterNode == ::lcl_FindChapterNode( *pTxtNd, 0 ) ) ) @@ -1365,7 +1369,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode ) const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); ::SetProgressState( 0, pDoc->GetDocShell() ); - if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() && + if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) && rTxtNode.GetNodes().IsDocNodes() && ( !IsFromChapter() || ::lcl_FindChapterNode( rTxtNode, 0 ) == pOwnChapterNode ) ) @@ -1408,12 +1412,12 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl ) // const SwTxtNode* pChapterCompareNode = 0; - if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() && + if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) && rTxtNode.GetNodes().IsDocNodes() /*&& (!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */) { //#106485# the body node has to be used! - SwCntntFrm *pFrm = rTxtNode.GetFrm(); + SwCntntFrm *pFrm = rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ); SwPosition aFldPos(rTxtNode); const SwTxtNode* pTxtNode = 0; if(pFrm && !pFrm->IsInDocBody()) @@ -1562,7 +1566,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType, } } - if( pCNd->GetFrm() && ( !IsFromChapter() || + if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && ( !IsFromChapter() || ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode )) { SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType, @@ -1603,7 +1607,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode ) while( 0 != ( pCNd = rNds.GoNext( &aCntntIdx ) ) && aCntntIdx.GetIndex() < pTblNd->EndOfSectionIndex() ) { - if( pCNd->GetFrm() && (!IsFromChapter() || + if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && (!IsFromChapter() || ::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode )) { SwTOXTable * pNew = new SwTOXTable( *pCNd ); @@ -1744,7 +1748,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx, long nRightMargin; if( pPageDesc ) { - const SwFrm* pFrm = pTOXNd->GetFrm( 0, 0, TRUE ); + const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, TRUE ); if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) || pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() ) // dann muss man ueber den PageDesc gehen @@ -1836,7 +1840,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx, pTOXSource->pNd->IsCntntNode() ) // <-- { - const SwCntntFrm* pFrm = pTOXSource->pNd->GetFrm(); + const SwCntntFrm* pFrm = pTOXSource->pNd->getLayoutFrm( pDoc->GetCurrentLayout() ); if( pFrm ) { SwChapterFieldType aFldTyp; @@ -2011,7 +2015,7 @@ void SwTOXBaseSection::UpdatePageNum() SwTOXSource& rTOXSource = pSortBase->aTOXSources[j]; if( rTOXSource.pNd ) { - SwCntntFrm* pFrm = rTOXSource.pNd->GetFrm(); + SwCntntFrm* pFrm = rTOXSource.pNd->getLayoutFrm( pDoc->GetCurrentLayout() ); ASSERT( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found"); if( !pFrm ) continue; diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx index 3def8b968a60..8ffcac046be4 100644 --- a/sw/source/core/doc/ftnidx.cxx +++ b/sw/source/core/doc/ftnidx.cxx @@ -220,6 +220,8 @@ void SwFtnIdxs::UpdateAllFtn() SwUpdFtnEndNtAtEnd aNumArr; + SwRootFrm* pTmpRoot = pDoc->GetCurrentLayout();//swmod 080305 + std::set aAllLayouts = pDoc->GetAllLayouts(); //Fuer normale Fussnoten werden Chapter- und Dokumentweise Nummerierung //getrennt behandelt. Fuer Endnoten gibt es nur die Dokumentweise //Nummerierung. @@ -292,8 +294,10 @@ void SwFtnIdxs::UpdateAllFtn() } } - if( pDoc->GetRootFrm() && FTNNUM_PAGE == rFtnInfo.eNum ) - pDoc->GetRootFrm()->UpdateFtnNums(); + //if( pDoc->GetCurrentLayout() && FTNNUM_PAGE == rFtnInfo.eNum ) + // pDoc->GetCurrentLayout()->UpdateFtnNums(); + if( pTmpRoot && FTNNUM_PAGE == rFtnInfo.eNum ) + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 0 } SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, USHORT* pFndPos ) const diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index e762de8489e3..9f8d9288ea9c 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -54,6 +54,7 @@ #include "poolfmt.hxx" #include "viewsh.hxx" #include "tabfrm.hxx" +#include "viewopt.hxx" #include "htmltbl.hxx" #include "ndindex.hxx" @@ -369,7 +370,7 @@ USHORT SwHTMLTableLayout::GetBrowseWidthByVisArea( const SwDoc& rDoc ) USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc ) { // Wenn ein Layout da ist, koennen wir die Breite dort herholen. - const SwRootFrm *pRootFrm = rDoc.GetRootFrm(); + const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout(); //swmod 080218 if( pRootFrm ) { const SwFrm *pPageFrm = pRootFrm->GetLower(); @@ -1811,16 +1812,16 @@ void SwHTMLTableLayout::_Resize( USHORT nAbsAvail, BOOL bRecalc ) if( bRecalc ) AutoLayoutPass1(); - SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetRootFrm(); + SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetCurrentViewShell()->GetLayout(); if ( pRoot && pRoot->IsCallbackActionEnabled() ) - pRoot->StartAllAction(); + pRoot->StartAllAction(); //swmod 071108//swmod 071225 // Sonst koennen die Breiten gesetzt werden, wobei zuvor aber jewils // noch der Pass 2 laufen muss. SetWidths( TRUE, nAbsAvail ); if ( pRoot && pRoot->IsCallbackActionEnabled() ) - pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger) + pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225 } IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG ) @@ -1857,7 +1858,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc, // und nicht die der VisArea uebergeben. Wenn wir nicht in einem Rahmen // stehen, muss die Tabelle allerdings fuer die VisArea berechnet werden, // weil sond die Umschaltung von relativ nach absolut nicht funktioniert. - if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( pDoc->GetCurrentViewShell() && pDoc->GetCurrentViewShell()->GetViewOptions()->getBrowseMode() ) { USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc ); if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() ) diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index c0c3e296f7b1..7e2d6164c637 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -36,19 +36,22 @@ #include "poolfmt.hxx" #include "rootfrm.hxx" #include "viewsh.hxx" - +#include void SwDoc::SetLineNumberInfo( const SwLineNumberInfo &rNew ) { - if ( GetRootFrm() && + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 + if ( pTmpRoot && (rNew.IsCountBlankLines() != pLineNumberInfo->IsCountBlankLines() || rNew.IsRestartEachPage() != pLineNumberInfo->IsRestartEachPage()) ) { - GetRootFrm()->StartAllAction(); + std::set aAllLayouts = GetAllLayouts();//swmod 080225 + pTmpRoot->StartAllAction(); // FME 2007-08-14 #i80120# Invalidate size, because ChgThisLines() // is only (onny may only be) called by the formatting routines - GetRootFrm()->InvalidateAllCntnt( INV_LINENUM | INV_SIZE ); - GetRootFrm()->EndAllAction(); - } + //pTmpRoot->InvalidateAllCntnt( INV_LINENUM | INV_SIZE ); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_LINENUM | INV_SIZE));//swmod 080226 + pTmpRoot->EndAllAction(); + } //swmod 080219 *pLineNumberInfo = rNew; SetModified(); } @@ -143,11 +146,13 @@ void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { SwClient::Modify( pOld, pNew ); SwDoc *pDoc = ((SwCharFmt*)GetRegisteredIn())->GetDoc(); - SwRootFrm* pRoot = pDoc->GetRootFrm(); - if( pRoot && pRoot->GetCurrShell() ) + SwRootFrm* pRoot = pDoc->GetCurrentLayout(); + if( pRoot ) { pRoot->StartAllAction(); - pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() ); + std::set aAllLayouts = pDoc->GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllAddPaintRect));//swmod 080305 + //pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() ); pRoot->EndAllAction(); } } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index bb10e9c1941b..e3ec73f17a1e 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -162,8 +162,8 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText, *************************************************************************/ -SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode) - : SwCntntFrm(pNode) +SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib ) + : SwCntntFrm( pNode, pSib ) { InitCtor(); } @@ -192,9 +192,9 @@ void SwNoTxtFrm::InitCtor() *************************************************************************/ -SwCntntFrm *SwNoTxtNode::MakeFrm() +SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib ) { - return new SwNoTxtFrm(this); + return new SwNoTxtFrm(this, pSib); } /************************************************************************* @@ -247,7 +247,7 @@ void lcl_ClearArea( const SwFrm &rFrm, { // OD 2004-04-23 #116347# rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR ); - rOut.SetFillColor( rFrm.GetShell()->Imp()->GetRetoucheColor()); + rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor()); rOut.SetLineColor(); for( USHORT i = 0; i < aRegion.Count(); ++i ) rOut.DrawRect( aRegion[i].SVRect() ); @@ -271,7 +271,7 @@ void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ if ( Frm().IsEmpty() ) return; - const ViewShell* pSh = GetShell(); + const ViewShell* pSh = getRootFrm()->GetCurrShell(); if( !pSh->GetViewOptions()->IsGraphic() ) { StopAnimation(); @@ -826,7 +826,7 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out /// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic. void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const { - ViewShell* pShell = GetShell(); + ViewShell* pShell = getRootFrm()->GetCurrShell(); SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode(); SwGrfNode* pGrfNd = rNoTNd.GetGrfNode(); @@ -1068,7 +1068,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons BOOL SwNoTxtFrm::IsTransparent() const { - const ViewShell* pSh = GetShell(); + const ViewShell* pSh = getRootFrm()->GetCurrShell(); if ( !pSh || !pSh->GetViewOptions()->IsGraphic() ) return TRUE; diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index e5cfc065db2a..fd7f0ad6ed7b 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -1294,7 +1294,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) case RES_POOLFRM_FRAME: { - if ( get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( get(IDocumentSettingAccess::HTML_MODE) ) { aSet.Put( SwFmtAnchor( FLY_AS_CHAR )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) ); diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index e40b82d673b7..aed1ceef2772 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -341,7 +341,7 @@ SwDataChanged::~SwDataChanged() { // JP 09.04.96: nur wenn das Layout vorhanden ist ( also waehrend der // Eingabe) - if( pDoc->GetRootFrm() ) + if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers(); diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 0bea7c73f65b..ac9e6957707b 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -54,7 +54,7 @@ SwURLStateChanged::~SwURLStateChanged() void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) { - if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetRootFrm() ) + if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { // diese URL wurde veraendert: const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject(); diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 306560272c6f..651533c618ca 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -802,7 +802,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd ) // Werden die Nodes nicht geloescht mussen sie bei den Seiten // abmeldet (Frms loeschen) werden, denn sonst bleiben sie // stehen (Undo loescht sie nicht!) - pSrch->DelFrms(); + pSrch->DelFrms(0); ++nPos; } @@ -812,7 +812,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd ) // Werden die Nodes nicht geloescht mussen sie bei den Seiten // abmeldet (Frms loeschen) werden, denn sonst bleiben sie // stehen (Undo loescht sie nicht!) - pSrch->DelFrms(); + pSrch->DelFrms(0); } } } @@ -937,7 +937,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, // Hier bietet sich als Optimierung an, vorhandene Frames nicht zu // zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen. BOOL bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() && - GetDoc()->GetRootFrm(); + GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 SwNode2Layout *pNode2Layout = NULL; if( bInsFrm ) { @@ -1117,10 +1117,10 @@ SwSectionNode::~SwSectionNode() } -SwFrm *SwSectionNode::MakeFrm() +SwFrm *SwSectionNode::MakeFrm( SwFrm *pSib ) { m_pSection->m_Data.SetHiddenFlag(false); - return new SwSectionFrm( *m_pSection ); + return new SwSectionFrm( *m_pSection, pSib ); } //Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom @@ -1130,7 +1130,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) { // also nehme meinen nachfolgenden oder vorhergehenden ContentFrame: SwNodes& rNds = GetNodes(); - if( rNds.IsDocNodes() && rNds.GetDoc()->GetRootFrm() ) + if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { if( GetSection().IsHidden() || IsCntntHidden() ) { @@ -1152,7 +1152,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." ); - pNew = rIdx.GetNode().GetCntntNode()->MakeFrm(); + pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm ); SwSectionNode* pS = rIdx.GetNode().FindSectionNode(); // --> OD 2008-06-23 #156927# @@ -1175,7 +1175,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) bool bInitNewSect = false; if( pS ) { - SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection() ); + SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection(), pFrm ); // OD 14.11.2002 #104684# - prepare of new section frame. bInitNewSect = true; SwLayoutFrm* pUp = pSct; @@ -1192,7 +1192,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pNew->IsTxtFrm() ) { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1219,7 +1219,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pNew->IsTxtFrm() ) { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1361,7 +1361,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c // dann kopiere auch noch die Links/Server if( pNewSect->IsLinkType() ) // den Link eintragen - pNewSect->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT + pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108//swmod 071225 : CREATE_NONE ); // falls als Server aus dem Undo kopiert wird, wieder eintragen @@ -1442,12 +1442,9 @@ void SwSectionNode::NodesArrChgd() { ASSERT( pDoc == GetDoc(), "verschieben in unterschiedliche Documente?" ); - if (m_pSection->IsLinkType()) - { - m_pSection->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT - : CREATE_NONE ); - } - + if( m_pSection->IsLinkType() ) // den Link austragen + m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108 + : CREATE_NONE );//swmod 071225 if (m_pSection->IsServer()) { pDoc->GetLinkManager().InsertServer( m_pSection->GetObject() ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index b213eb1d075d..4d37b66f4f43 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -952,7 +952,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, // JP 28.10.96: vom 1. Node die Positionen des Trenners besorgen, // damit die Boxen entsprechend eingestellt werden - SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->GetFrm() ); + SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->getLayoutFrm( pTxtNd->GetDoc()->GetCurrentLayout() ) ); if( aFInfo.IsOneLine() ) // nur dann sinnvoll! { const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer(); @@ -2450,9 +2450,9 @@ SwTableNode::~SwTableNode() delete pTable; } -SwTabFrm *SwTableNode::MakeFrm() +SwTabFrm *SwTableNode::MakeFrm( SwFrm* pSib ) { - return new SwTabFrm( *pTable ); + return new SwTabFrm( *pTable, pSib ); } //Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom @@ -2474,7 +2474,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { - pNew = pNode->MakeFrm(); + pNew = pNode->MakeFrm( pFrm ); // wird ein Node vorher oder nachher mit Frames versehen if ( bBefore ) // der neue liegt vor mir @@ -2501,7 +2501,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) SwNode2Layout aNode2Layout( *pNd, GetIndex() ); while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, *this )) ) { - SwTabFrm* pNew = MakeFrm(); + SwTabFrm* pNew = MakeFrm( pUpper ); pNew->Paste( pUpper, pFrm ); // --> OD 2005-12-01 #i27138# // notify accessibility paragraphs objects about changed @@ -2509,7 +2509,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -2549,7 +2549,7 @@ void SwTableNode::DelFrms() // Relation CONTENT_FLOWS_FROM for current next paragraph will change // and relation CONTENT_FLOWS_TO for current previous paragraph will change. { - ViewShell* pViewShell( pFrm->GetShell() ); + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -2604,7 +2604,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, if( pShCrsr ) aPt = pShCrsr->GetPtPos(); - const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, FALSE ); + const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); do { pTmpFrm = pTmpFrm->GetUpper(); } while ( !pTmpFrm->IsCellFrm() ); @@ -2829,7 +2829,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly, if( pShCrsr ) aPt = pShCrsr->GetPtPos(); - const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, FALSE ); + const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); do { pTmpFrm = pTmpFrm->GetUpper(); } while ( !pTmpFrm->IsCellFrm() ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index c561f10d0a3f..985ef3cdbc57 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -125,8 +125,8 @@ void lcl_GetStartEndCell( const SwCursor& rCrsr, SwCntntNode* pPointNd = rCrsr.GetCntntNode(); SwCntntNode* pMarkNd = rCrsr.GetCntntNode(FALSE); - SwFrm* pPointFrm = pPointNd ? pPointNd->GetFrm( &aPtPos ) : 0; - SwFrm* pMarkFrm = pMarkNd ? pMarkNd->GetFrm( &aMkPos ) : 0; + SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->GetCurrentLayout(), &aPtPos ) : 0; + SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->GetCurrentLayout(), &aMkPos ) : 0; prStart = pPointFrm ? pPointFrm->GetUpper() : 0; prEnd = pMarkFrm ? pMarkFrm->GetUpper() : 0; @@ -801,7 +801,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm(); + SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->BordersChanged( @@ -898,7 +898,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm(); + SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->BordersChanged( @@ -1158,7 +1158,7 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew ) SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm(); + SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->Resize( diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index f1ab04ed0c09..4a6b87893474 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -449,14 +449,14 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const else pNd = GetCntntNode(); - const SwFrm* pFrm; - if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, FALSE ) ) ) - { if( !pSh ) // dann die Shell vom Doc besorgen: GetDoc()->GetEditShell( &pSh ); if( pSh ) + { + const SwFrm* pFrm; + if( pNd && 0 != ( pFrm = pNd->getLayoutFrm( pSh->GetLayout(), 0, 0, FALSE ) ) ) { if ( pFrm->IsInTab() ) pFrm = pFrm->FindTabFrm(); @@ -494,7 +494,7 @@ BOOL SwNode::IsProtect() const if( 0 != ( pSttNd = FindTableBoxStartNode() ) ) { SwCntntFrm* pCFrm; - if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->GetFrm() )) + if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->getLayoutFrm( GetDoc()->GetCurrentLayout() ) )) return pCFrm->IsProtected(); const SwTableBox* pBox = pSttNd->FindTableNode()->GetTable(). @@ -563,7 +563,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, { const SwFrm* pFrm; const SwPageFrm* pPage; - if( pNode && 0 != ( pFrm = pNode->GetFrm( 0, 0, bCalcLay ) ) && + if( pNode && 0 != ( pFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout(), 0, 0, bCalcLay ) ) && 0 != ( pPage = pFrm->FindPageFrm() ) ) { pPgDesc = pPage->GetPageDesc(); @@ -862,8 +862,8 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const const SwCntntNode* pCNd = GetCntntNode(); Point aPt( 0, 0 ); - const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, FALSE ), - * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, FALSE ) : 0; + const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ), + * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ) : 0; const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0; if( pPgFrm && pMyFrm && pPgFrm->Frm().Top() > pMyFrm->Frm().Top() ) @@ -1157,20 +1157,19 @@ BOOL SwCntntNode::InvalidateNumRule() return 0 != pRule; } - -SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint, - const SwPosition *pPos, - const BOOL bCalcFrm ) const +SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot, + const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) const { - return (SwCntntFrm*) ::GetFrmOfModify( *(SwModify*)this, FRM_CNTNT, + return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, pPoint, pPos, bCalcFrm ); } + SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint, const BOOL bCalcFrm ) const { SwRect aRet; - SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( *(SwModify*)this, + SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this, FRM_CNTNT, pPoint, 0, bCalcFrm ); if( pFrm ) aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm(); @@ -1181,7 +1180,7 @@ SwRect SwCntntNode::FindPageFrmRect( const BOOL bPrtArea, const Point* pPoint, const BOOL bCalcFrm ) const { SwRect aRet; - SwFrm* pFrm = ::GetFrmOfModify( *(SwModify*)this, + SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, FRM_CNTNT, pPoint, 0, bCalcFrm ); if( pFrm && 0 != ( pFrm = pFrm->FindPageFrm() )) aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm(); @@ -1353,7 +1352,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, rNode )) ) { - pNew = rNode.MakeFrm(); + pNew = rNode.MakeFrm( pUpper ); pNew->Paste( pUpper, pFrm ); // --> OD 2005-12-01 #i27138# // notify accessibility paragraphs objects about changed @@ -1362,7 +1361,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pNew->IsTxtFrm() ) { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1400,7 +1399,7 @@ void SwCntntNode::DelFrms() // and relation CONTENT_FLOWS_TO for current previous paragraph will change. if ( pFrm->IsTxtFrm() ) { - ViewShell* pViewShell( pFrm->GetShell() ); + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -2049,7 +2048,7 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos, // --> OD 2007-01-10 #i72024# // No format of the frame, because this can cause recursive layout actions - SwFrm* pFrm = GetFrm( &aPt, &rPos, FALSE ); + SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, FALSE ); // <-- if ( pFrm ) diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index cce0919e1e1a..62fa380097d3 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -255,7 +255,7 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode ) return static_cast(pFrm); } - pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection()); + pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection(), rpFrm); pUpper->Paste( rpFrm->GetUpper(), bMaster ? rpFrm : rpFrm->GetNext() ); static_cast(pUpper)->Init(); @@ -299,7 +299,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) pNxt = pNxt->GetNext(); else pNxt = pUp->Lower(); - pNew = ((SwCntntNode*)pNd)->MakeFrm(); + pNew = ((SwCntntNode*)pNd)->MakeFrm( pUp ); pNew->Paste( pUp, pNxt ); (*pUpperFrms)[n-2] = pNew; } @@ -314,7 +314,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) pNxt = pNxt->GetNext(); else pNxt = pUp->Lower(); - pNew = ((SwTableNode*)pNd)->MakeFrm(); + pNew = ((SwTableNode*)pNd)->MakeFrm( pUp ); ASSERT( pNew->IsTabFrm(), "Table exspected" ); pNew->Paste( pUp, pNxt ); ((SwTabFrm*)pNew)->RegistFlys(); @@ -358,7 +358,7 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos, const SwPosition *pPos, const BOOL bCalcFrm ) const { - return pIter ? ::GetFrmOfModify( pIter->GetModify(), USHRT_MAX, + return pIter ? ::GetFrmOfModify( 0, pIter->GetModify(), USHRT_MAX, pDocPos, pPos, bCalcFrm ) : 0; } diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index d2c979535dbb..0a1157ad2274 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -395,7 +395,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, if( bNewFrms ) bNewFrms = &GetDoc()->GetNodes() == (const SwNodes*)&rNds && - GetDoc()->GetRootFrm(); + GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 if( bNewFrms ) { // Frames besorgen: @@ -2398,7 +2398,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx, SwNode* pFrmNd = 0; // habe wir gar kein Layout, vergiss es - if( GetDoc()->GetRootFrm() ) + if( GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { SwNode* pSttNd = &rFrmIdx.GetNode(); diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 2e19d482fc70..0b16cccb1dfa 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1207,9 +1207,8 @@ void SwDrawContact::Changed( const SdrObject& rObj, // OD 2004-06-01 #i26791# - no event handling, if existing // is in contruction SwDoc* pDoc = GetFmt()->GetDoc(); - if ( pDoc->GetRootFrm() && - pDoc->GetRootFrm()->GetCurrShell() && - pDoc->GetRootFrm()->GetCurrShell()->IsInConstructor() ) + if ( pDoc->GetCurrentViewShell() && + pDoc->GetCurrentViewShell()->IsInConstructor() ) { return; } @@ -1225,7 +1224,8 @@ void SwDrawContact::Changed( const SdrObject& rObj, //Action aufsetzen, aber nicht wenn gerade irgendwo eine Action laeuft. ViewShell *pSh = 0, *pOrg; - if ( pDoc->GetRootFrm() && pDoc->GetRootFrm()->IsCallbackActionEnabled() ) + SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317 + if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() ) { pDoc->GetEditShell( &pOrg ); pSh = pOrg; @@ -1239,13 +1239,13 @@ void SwDrawContact::Changed( const SdrObject& rObj, } while ( pSh && pSh != pOrg ); if ( pSh ) - pDoc->GetRootFrm()->StartAllAction(); + pTmpRoot->StartAllAction(); } SdrObjUserCall::Changed( rObj, eType, rOldBoundRect ); _Changed( rObj, eType, &rOldBoundRect ); //Achtung, ggf. Suizid! if ( pSh ) - pDoc->GetRootFrm()->EndAllAction(); + pTmpRoot->EndAllAction(); } // --> OD 2006-01-18 #129959# @@ -1920,11 +1920,8 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)pRegisteredIn; - SwRootFrm* pRoot = pDrawFrmFmt->getIDocumentLayoutAccess()->GetRootFrm(); - if ( !pRoot ) - { + if( !pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) return; - } // OD 16.05.2003 #108784# - remove 'virtual' drawing objects from writer // layout and from drawing page, and remove 'master' drawing object from @@ -1941,6 +1938,10 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) case FLY_AT_PAGE: { USHORT nPgNum = pAnch->GetPageNum(); + ViewShell *pShell = pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell(); + if( !pShell ) + break; + SwRootFrm* pRoot = pShell->GetLayout(); SwPageFrm *pPage = static_cast(pRoot->Lower()); for ( USHORT i = 1; i < nPgNum && pPage; ++i ) diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 75111933e0ec..80303f49de13 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -53,6 +53,7 @@ #include "ndnotxt.hxx" #include "grfatr.hxx" #include "pagefrm.hxx" +#include "rootfrm.hxx" using namespace ::com::sun::star; @@ -473,7 +474,7 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt() void SwVirtFlyDrawObj::wrap_DoPaintObject() const { - ViewShell* pShell = pFlyFrm->GetShell(); + ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell(); // Only paint when we have a current shell and a DrawingLayer paint is in progress. // This avcoids evtl. problems with renderers which do processing stuff, @@ -829,9 +830,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef, const SwFrm *pRel = GetFlyFrm()->IsFlyLayFrm() ? GetFlyFrm()->GetAnchorFrm() : GetFlyFrm()->GetAnchorFrm()->GetUpper(); - const ViewShell *pSh = GetFlyFrm()->GetShell(); + const ViewShell *pSh = GetFlyFrm()->getRootFrm()->GetCurrShell(); if ( pSh && pRel->IsBodyFrm() && - pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + pSh->GetViewOptions()->getBrowseMode() && pSh->VisArea().HasArea() ) { nRelWidth = pSh->GetBrowseWidth(); diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 694599181b81..0db338657a24 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -118,7 +118,7 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg ) const SdrPageGridFrameList* SwDPage::GetGridFrameList( const SdrPageView* pPV, const Rectangle *pRect ) const { - ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetRootFrm()->GetCurrShell(); + ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225 if ( pSh ) { while ( pSh->Imp()->GetPageView() != pPV ) diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index f7242d1d8132..83a2e29a2be7 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -1074,8 +1074,9 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView ) void SwDrawView::DeleteMarked() { SwDoc* pDoc = Imp().GetShell()->GetDoc(); - if ( pDoc->GetRootFrm() ) - pDoc->GetRootFrm()->StartAllAction(); + SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317 + if ( pTmpRoot ) + pTmpRoot->StartAllAction(); pDoc->StartUndo(UNDO_EMPTY, NULL); // OD 18.06.2003 #108784# - replace marked -objects by its // reference objects. @@ -1096,20 +1097,7 @@ void SwDrawView::DeleteMarked() ::FrameNotify( Imp().GetShell(), FLY_DRAG_END ); } pDoc->EndUndo(UNDO_EMPTY, NULL); - if( pDoc->GetRootFrm() ) - pDoc->GetRootFrm()->EndAllAction(); + if( pTmpRoot ) + pTmpRoot->EndAllAction(); //swmod 080218 } -/******** -JP 02.10.98: sollte als Fix fuer 57153 gelten, hatte aber Nebenwirkungen, - wie Bug 57475 -const SdrMarkList& SwDrawView::GetMarkedObjectList() const -{ - FlushComeBackTimer(); - return FmFormView::GetMarkedObjectList(); -} -*************/ - - - - diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 639bab3c10c5..b98f77386086 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -270,7 +270,7 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const { // besorge mal den Frame - const SwCntntFrm *pFrm = rTxtNd.GetFrm(); + const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( pEditShell->GetLayout() ); ASSERT( pFrm, "zum Autoformat muss das Layout vorhanden sein" ); if( aFlags.bAFmtByInput && !pFrm->IsValid() ) { diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 37ba5e5ced31..860cf58cf350 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -360,7 +360,7 @@ BOOL SwEditShell::IsMoveLeftMargin( BOOL bRight, BOOL bModulus ) const long nNext = rLS.GetTxtLeft() + nDefDist; if( bModulus ) nNext = ( nNext / nDefDist ) * nDefDist; - SwFrm* pFrm = pCNd->GetFrm(); + SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() ); if ( pFrm ) { const USHORT nFrmWidth = static_cast( pFrm->IsVertical() ? diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index a996ed802a42..8a0ead2da3ce 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -90,7 +90,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, BOOL* pUndo ) } // geschuetze Boxen ueberspringen ! if( !pNd->IsCntntNode() || - !((SwCntntNode*)pNd)->GetFrm()->IsProtected() ) + !((SwCntntNode*)pNd)->getLayoutFrm( GetLayout() )->IsProtected() ) { // alles loeschen GetDoc()->DeleteAndJoin( aDelPam ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 7af79fde80a8..f47579a9110a 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -151,7 +151,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints ) // seems to be an empty paragraph. Point aPt; SwCntntFrm* pFrm = - ((SwTxtNode&)rNode).GetFrm( &aPt, pTmpCrsr->GetPoint(), + ((SwTxtNode&)rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(), sal_False ); SwScriptInfo aScriptInfo; @@ -421,7 +421,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly ) SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode(); StartAllAction(); pNd->SetContour( pPoly ); - SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper(); + SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); @@ -437,7 +437,7 @@ void SwEditShell::ClearAutomaticContour() { StartAllAction(); pNd->SetContour( NULL, FALSE ); - SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper(); + SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); @@ -479,7 +479,7 @@ BOOL SwEditShell::HasOLEObj( const String &rName ) const SwNode& rNd = aIdx.GetNode(); if( rNd.IsOLENode() && rName == ((SwOLENode&)rNd).GetChartTblName() && - ((SwOLENode&)rNd).GetFrm() ) + ((SwOLENode&)rNd).getLayoutFrm( GetLayout() ) ) return TRUE; aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); @@ -737,7 +737,7 @@ Graphic SwEditShell::GetIMapGraphic() const } else { - SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->GetFrm()->FindFlyFrm(); + SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm(); if(pFlyFrm) aRet = pFlyFrm->GetFmt()->MakeGraphic(); } @@ -904,7 +904,7 @@ void SwEditShell::SetNumberingRestart() switch( pNd->GetNodeType() ) { case ND_TEXTNODE: - if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) ) + if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetLayout() )) ) { //jump over hidden frames - ignore protection! if( !((SwTxtFrm*)pCntFrm)->IsHiddenNow() ) @@ -972,7 +972,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos ) else { if( 0 != ( pCNd = pPam->GetCntntNode() ) && - 0 != ( pCntFrm = pCNd->GetFrm() ) ) + 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) ) { const SwStartNode *pTmp; if( pCntFrm->IsInFly() ) // Fly @@ -1000,7 +1000,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos ) while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( &aStart, TRUE, FALSE )) && ( !bActPos || aStart <= rPtIdx ) ) { - if( 0 != ( pCntFrm = pCNd->GetFrm() ) && pCntFrm->IsTxtFrm() ) + if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() ) { xub_StrLen nActPos = bActPos && aStart == rPtIdx ? pPam->GetPoint()->nContent.GetIndex() : USHRT_MAX; diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 02dc1de62901..58fb72ae16f1 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1080,7 +1080,7 @@ uno::Reference< XSpellAlternatives > SwCrsrMoveState aState; aState.bRealWidth = TRUE; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), FALSE); + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; @@ -1224,7 +1224,7 @@ bool SwEditShell::GetGrammarCorrection( SwCrsrMoveState aState; aState.bRealWidth = TRUE; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), FALSE); + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index ba3c2e9c7966..e04ff5d4b8b7 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -104,7 +104,7 @@ const SwSection* SwEditShell::GetAnySection( BOOL bOutOfTab, const Point* pPt ) Point aPt( *pPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); - pFrm = pNd->GetFrm( pPt ); + pFrm = pNd->getLayoutFrm( GetLayout(), pPt ); } else pFrm = GetCurrFrm( FALSE ); diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index a27b09f5d4ff..58bc6965c40b 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -266,10 +266,16 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell, if( pShell->ISA( SwFEShell ) ) { SwFEShell* pFEShell = static_cast( pShell ); + bool bFirst = true; for( USHORT i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) - pFEShell->SelectObj( Point(), - (i==0) ? 0 : SW_ADD_SELECT, - pSdrMarkList->GetMark( i )->GetMarkedSdrObj() ); + { + SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj(); + if( pObj ) + { + pFEShell->SelectObj( Point(), bFirst ? 0 : SW_ADD_SELECT, pObj ); + bFirst = false; + } + } // the old implementation would always unselect // objects, even if no new ones were selected. If this diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 630f8dc18e34..2c6fe50625ac 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -373,7 +373,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode(); SwPosition aFldPos(rFldTxtNode); SwDoc& rDoc = *(SwDoc*)rFldTxtNode.GetDoc(); - SwCntntFrm *pFrm = rFldTxtNode.GetFrm(); + SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.GetCurrentLayout() ); const SwTxtNode* pTxtNode = 0; if(pFrm && !pFrm->IsInDocBody()) pTxtNode = GetBodyTxtNode( rDoc, aFldPos, *pFrm ); @@ -381,7 +381,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) //body the directly available text node will be used if(!pTxtNode) pTxtNode = &rFldTxtNode; - if( pTxtNode->GetTxt().Len() && pTxtNode->GetFrm() && + if( pTxtNode->GetTxt().Len() && pTxtNode->getLayoutFrm( rDoc.GetCurrentLayout() ) && pTxtNode->GetNodes().IsDocNodes() ) { SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode, diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index aa46869bca1a..ffe6e6af32b7 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -741,7 +741,7 @@ const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox ) SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx ); ASSERT( pCNd, "Box hat keinen TextNode" ); Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !! - return pCNd->GetFrm( &aPt, NULL, FALSE ); + return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, FALSE ); } long lcl_GetLongBoxNum( String& rStr ) diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index c9811352b062..f208ac71dbb3 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -319,7 +319,7 @@ void SwDDEFieldType::_RefCntChgd() { refLink->SetVisible( pDoc->IsVisibleLinks() ); pDoc->GetLinkManager().InsertDDELink( refLink ); - if( pDoc->GetRootFrm() ) + if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 UpdateNow(); } else diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index c10a8b18c5cb..1756690d1384 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -176,7 +176,7 @@ BOOL SwDDETable::NoDDETable() pNewTbl->GetTabLines().Insert( &GetTabLines(),0 ); // move die Lines GetTabLines().Remove( 0, GetTabLines().Count() ); - if( pDoc->GetRootFrm() ) + if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 ((SwDDEFieldType*)aDepend.GetRegisteredIn())->DecRefCnt(); pTblNd->SetNewTable( pNewTbl ); // setze die Tabelle diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index fba7115075e8..862a073d9884 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -796,8 +796,8 @@ String SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const case DS_WORD: nVal = rDStat.nWord; break; case DS_CHAR: nVal = rDStat.nChar; break; case DS_PAGE: - if( pDoc->GetRootFrm() ) - ((SwDocStat &)rDStat).nPage = pDoc->GetRootFrm()->GetPageNum(); + if( pDoc->GetCurrentLayout() )//swmod 080218 + ((SwDocStat &)rDStat).nPage = pDoc->GetCurrentLayout()->GetPageNum(); //swmod 080218 nVal = rDStat.nPage; if( SVX_NUM_PAGEDESC == nFmt ) nFmt = (sal_uInt32)nNumberingType; @@ -2337,7 +2337,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) Point aPt; - const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False ); + const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rTxtNd.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); _SetGetExpFld* pNew; @@ -2402,8 +2402,8 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, { // dann bestimme mal den entsp. Offset Point aPt; - const SwCntntFrm* pFrm = pTxtNode->GetFrm( &aPt, 0, sal_False ); - const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False ); + const SwCntntFrm* pFrm = pTxtNode->getLayoutFrm( pTxtNode->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); + const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pRefTxtFld->GetTxtNode().GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); const SwPageFrm* pPgFrm = 0; sal_uInt16 nDiff = ( pFrm && pRefFrm ) ? (pPgFrm = pFrm->FindPageFrm())->GetPhyPageNum() - @@ -2496,7 +2496,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, const SwRefPageSetField* pSetFld = (SwRefPageSetField*)pRefTxtFld->GetFld().GetFld(); Point aPt; - const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False ) : 0; + const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, sal_False ) : 0; if( pSetFld->IsOn() && pRefFrm ) { // dann bestimme mal den entsp. Offset diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 8b03b7e54664..4ca163c25dcb 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -111,8 +111,8 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr ) BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos, const SwTxtNode& rBehindNd, USHORT nSttPos ) { - const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.GetFrm(0,0,FALSE), - *pFrm = (SwTxtFrm*)rBehindNd.GetFrm(0,0,FALSE); + const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE), + *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE); while( pFrm && !pFrm->IsInside( nSttPos ) ) pFrm = (SwTxtFrm*)pFrm->GetFollow(); @@ -401,7 +401,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_PAGE: case REF_PAGE_PGDESC: { - const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->GetFrm(0,0,FALSE), + const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,FALSE), *pSave = pFrm; while( pFrm && !pFrm->IsInside( nStt ) ) pFrm = (SwTxtFrm*)pFrm->GetFollow(); @@ -423,7 +423,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_CHAPTER: { // ein bischen trickreich: suche irgend einen Frame - const SwFrm* pFrm = pTxtNd->GetFrm(); + const SwFrm* pFrm = pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ); if( pFrm ) { SwChapterFieldType aFldTyp; diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 9fe5c9a22204..7b232295548f 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -267,7 +267,7 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly, { BOOL bRet = TRUE; rAnchor.SetAnchor( &rPos ); - SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, FALSE ); + SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, FALSE ); SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm(); if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) ) { diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index fe73c36016a0..4d90a916feee 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -238,14 +238,14 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const FOREACHPAM_START(this) if( 0 != (pCNd = PCURCRSR->GetCntntNode() ) && - 0 != ( pPtFrm = pCNd->GetFrm( &aNulPt, 0, FALSE )) ) + 0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) ) pPtFrm = pPtFrm->FindPageFrm(); else pPtFrm = 0; if( PCURCRSR->HasMark() && 0 != (pCNd = PCURCRSR->GetCntntNode( FALSE ) ) && - 0 != ( pMkFrm = pCNd->GetFrm( &aNulPt, 0, FALSE )) ) + 0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) ) pMkFrm = pMkFrm->FindPageFrm(); else pMkFrm = pPtFrm; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 0dc721a62f12..426bf5bea70e 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -108,7 +108,7 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor, else { const SwCntntNode *pCntNd = rNode.GetCntntNode(); - const SwCntntFrm* pCFrm = pCntNd ? pCntNd->GetFrm( &rPt, 0, sal_False ) : 0; + const SwCntntFrm* pCFrm = pCntNd ? pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False ) : 0; const SwPageFrm *pPg = pCFrm ? pCFrm->FindPageFrm() : 0; rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 ); @@ -171,9 +171,9 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, SwCrsrMoveState aState( MV_SETONLYTEXT ); SwPosition aPos( rDoc.GetNodes() ); aTmpPnt.X() -= 1; //nicht im Fly landen!! - rDoc.GetRootFrm()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); + rDoc.GetCurrentLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); //swmod 071108//swmod 071225 pNewAnch = ::FindAnchor( - aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False ), + aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( rFrm.getRootFrm(), 0, 0, sal_False ), aTmpPnt )->FindFlyFrm(); if( pNewAnch && &rFrm != pNewAnch && !pNewAnch->IsProtected() ) @@ -290,7 +290,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const return 0; SdrObject *pO = rMrkList.GetMark( 0 )->GetMarkedSdrObj(); - return pO->ISA(SwVirtFlyDrawObj) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0; + return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0; } return 0; } @@ -354,7 +354,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly() // OD 01.07.2003 #108784# - determine text frame by left-top-corner // of object //pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False ); - pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aTmpPos, 0, sal_False ); + pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False ); } const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos ); const SwFlyFrm *pFly = pTmp->FindFlyFrm(); @@ -485,7 +485,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() ); Point aTmpPnt( rAbsPos ); GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); - pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm(0,&aPos,FALSE ); + pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,FALSE ); } const SwFrm *pNewAnch; if( pTxtFrm ) @@ -927,8 +927,8 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmpPt( rInsertPosition ); - getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState ); - const SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False ); + GetLayout()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState ); + const SwFrm* pFrm = aPam.GetCntntNode()->getLayoutFrm( GetLayout(), 0, 0, sal_False ); const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(), rInsertPosition.Y() - pFrm->Frm().Top() ); rDrawObj.SetRelativePos( aRelPos ); @@ -996,7 +996,7 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset ) SwFrmFmt* pFmt; long nNewPage; - SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm(); + SwRootFrm* pTmpRootFrm = GetLayout();//swmod 080317 sal_uInt16 nMaxPage = pTmpRootFrm->GetPageNum(); sal_Bool bTmpAssert = sal_False; for( sal_uInt16 n = 0; n < rFillArr.Count(); ++n ) @@ -1744,7 +1744,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromAnyObj( const Point& rPt ) const Point aPt( rPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); - SwFrm* pFrm = pNd->GetFrm( &rPt )->FindFlyFrm(); + SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, FALSE )->FindFlyFrm(); pRet = pFrm ? ((SwLayoutFrm*)pFrm)->GetFmt() : 0; } return pRet; @@ -1863,6 +1863,8 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const for( sal_uInt32 i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i ) { SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); + if( !pObj ) + continue; ObjCntType eTmp = GetObjCntType( *pObj ); if( !i ) { diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 070a031e83d3..c78fb22d7421 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -80,7 +80,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject > ((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj ) { bExist = TRUE; - SwFrm *pFrm = ((SwOLENode*)pNd)->GetFrm(); + SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() ); if ( pFrm ) pFly = pFrm->FindFlyFrm(); break; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index d6d13316a1e9..e4a668ec3a99 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -108,7 +108,7 @@ SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh ) if ( pLst && pLst->GetMarkCount() == 1 ) { SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj(); - if ( pO->ISA(SwVirtFlyDrawObj) ) + if ( pO && pO->ISA(SwVirtFlyDrawObj) ) return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm(); } return 0; @@ -601,7 +601,7 @@ bool SwFEShell::IsSelContainsControl() const // if we have one marked object, get the SdrObject and check // whether it contains a control const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - bRet = CheckControlLayer( pSdrObject ); + bRet = pSdrObject && CheckControlLayer( pSdrObject ); } return bRet; } @@ -957,6 +957,8 @@ short SwFEShell::GetLayerId() const for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); + if( !pObj ) + continue; if ( nRet == SHRT_MAX ) nRet = pObj->GetLayer(); else if ( nRet != pObj->GetLayer() ) @@ -994,6 +996,8 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId ) for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); + if( !pObj ) + continue; // OD 21.08.2003 #i18447# - no change of layer for controls // or group objects containing controls. const bool bControlObj = ::CheckControlLayer( pObj ); @@ -1658,12 +1662,12 @@ BOOL SwFEShell::ImpEndCreate() SwPosition aPos( GetDoc()->GetNodes() ); SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 ); - getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState ); + GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080317 //JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt if( !aPos.nNode.GetNode().IsProtect() ) { - pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, &aPos ); + pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, &aPos ); SwRect aTmp; pAnch->GetCharRect( aTmp, aPos ); @@ -1711,7 +1715,7 @@ BOOL SwFEShell::ImpEndCreate() // die naechste nicht READONLY Position suchen? bAtPage = true; - pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, FALSE ); + pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, FALSE ); if( !bAtPage ) { diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index ad2e077e5d7c..399c2f5ee8cf 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -1167,7 +1167,7 @@ USHORT lcl_GetRowNumber( const SwPosition& rPos ) const SwCntntFrm *pFrm; if( 0 != ( pNd = rPos.nNode.GetNode().GetCntntNode() )) - pFrm = pNd->GetFrm( &aTmpPt, &rPos, FALSE ); + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, FALSE ); else pFrm = 0; diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 02baddd201bd..5c3c18988501 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -124,10 +124,17 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, Point aPt( *pPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); - pFrm = pNd->GetFrm( pPt ); + pFrm = pNd->getLayoutFrm( GetLayout(), pPt ); } else + { + const bool bOldCallbackActionEnabled = GetLayout()->IsCallbackActionEnabled(); + if( bOldCallbackActionEnabled ) + GetLayout()->SetCallbackActionEnabled( FALSE ); pFrm = GetCurrFrm(); + if( bOldCallbackActionEnabled ) + GetLayout()->SetCallbackActionEnabled( TRUE ); + } } if( !pFrm ) @@ -264,7 +271,7 @@ USHORT SwFEShell::GetFrmType( const Point *pPt, BOOL bStopAtFly ) const Point aPt( *pPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); - pFrm = pNd->GetFrm( pPt ); + pFrm = pNd->getLayoutFrm( GetLayout(), pPt ); } else pFrm = GetCurrFrm( FALSE ); @@ -423,7 +430,7 @@ void SwFEShell::SetNewPageOffset( USHORT nOffset ) void SwFEShell::SetPageOffset( USHORT nOffset ) { const SwPageFrm *pPage = GetCurrFrm( FALSE )->FindPageFrm(); - const SwRootFrm* pLayout = GetLayout(); + const SwRootFrm* pDocLayout = GetLayout(); while ( pPage ) { const SwFrm *pFlow = pPage->FindFirstBodyCntnt(); @@ -434,7 +441,7 @@ void SwFEShell::SetPageOffset( USHORT nOffset ) const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc(); if ( rPgDesc.GetNumOffset() ) { - pLayout->SetVirtPageNum( TRUE ); + pDocLayout->SetVirtPageNum( TRUE ); lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this ); break; } @@ -521,6 +528,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj(); + if( pDrawObj ) aDrawObjs.push_back( pDrawObj ); } } diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 8cabf285e12b..9f48c725dc4b 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -194,7 +194,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes ) if( rTblCrsr.IsChgd() || !rTblCrsr.GetBoxesCount() ) { SwTableCursor* pTCrsr = (SwTableCursor*)&rTblCrsr; - pTCrsr->GetDoc()->GetRootFrm()->MakeTblCrsrs( *pTCrsr ); + pTCrsr->GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *pTCrsr ); //swmod 080218 } if( rTblCrsr.GetBoxesCount() ) @@ -289,10 +289,10 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes, } const SwCntntNode *pCntNd = rCrsr.GetCntntNode(); const SwLayoutFrm *pStart = pCntNd ? - pCntNd->GetFrm( &aPtPos )->GetUpper() : 0; + pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper() : 0; pCntNd = rCrsr.GetCntntNode(FALSE); const SwLayoutFrm *pEnd = pCntNd ? - pCntNd->GetFrm( &aMkPos )->GetUpper() : 0; + pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper() : 0; if( pStart && pEnd ) GetTblSel( pStart, pEnd, rBoxes, 0, eSearchType ); } @@ -501,10 +501,10 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, // OD 07.11.2003 #i22135# - Also the content of the table could be // invisible - e.g. in a hidden section // Robust: check, if content was found (e.g. empty table cells) - if ( !pCNd || pCNd->GetFrm() == NULL ) + if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL ) return FALSE; - const SwLayoutFrm *pStart = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0; + const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0; ASSERT( pStart, "ohne Frame geht gar nichts" ); aIdx = rEndNd; @@ -513,12 +513,12 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, pCNd = aIdx.GetNodes().GoNextSection( &aIdx, FALSE, FALSE ); // OD 07.11.2003 #i22135# - Robust: check, if content was found and if it's visible - if ( !pCNd || pCNd->GetFrm() == NULL ) + if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL ) { return FALSE; } - const SwLayoutFrm *pEnd = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0; + const SwLayoutFrm *pEnd = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0; ASSERT( pEnd, "ohne Frame geht gar nichts" ); @@ -774,9 +774,9 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) if ( rShell.IsTableMode() ) pCrsr = rShell.pTblCrsr; - const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->GetFrm( + const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->getLayoutFrm( rShell.GetLayout(), &pCrsr->GetPtPos() )->GetUpper(), - *pEnd = pCrsr->GetCntntNode(FALSE)->GetFrm( + *pEnd = pCrsr->GetCntntNode(FALSE)->getLayoutFrm( rShell.GetLayout(), &pCrsr->GetMkPos() )->GetUpper(); const SwLayoutFrm* pSttCell = pStart; @@ -1014,9 +1014,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, // das die 1. Headline mit drin ist. // Point aPt( rShell.GetCharRect().Pos() ); Point aPt( 0, 0 ); - const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm( - &aPt )->GetUpper(), - *pEnd = rPam.GetCntntNode(FALSE)->GetFrm( + + const SwCntntNode* pCntNd = rPam.GetCntntNode(); + const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), + &aPt )->GetUpper(); + pCntNd = rPam.GetCntntNode(FALSE); + const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); SwSelUnions aUnions; @@ -1525,9 +1528,11 @@ USHORT CheckMergeSel( const SwPaM& rPam ) // richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert, // das die 1. Headline mit drin ist. Point aPt; - const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm( - &aPt )->GetUpper(), - *pEnd = rPam.GetCntntNode(FALSE)->GetFrm( + const SwCntntNode* pCntNd = rPam.GetCntntNode(); + const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), + &aPt )->GetUpper(); + pCntNd = rPam.GetCntntNode(FALSE); + const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); GetTblSel( pStart, pEnd, aBoxes, 0 ); return CheckMergeSel( aBoxes ); @@ -2082,9 +2087,12 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv, aPtPos = pShCrsr->GetPtPos(); aMkPos = pShCrsr->GetMkPos(); } - const SwLayoutFrm *pStart = rCrsr.GetCntntNode()->GetFrm( - &aPtPos )->GetUpper(), - *pEnd = rCrsr.GetCntntNode(FALSE)->GetFrm( + + const SwCntntNode* pCntNd = rCrsr.GetCntntNode(); + const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), + &aPtPos )->GetUpper(); + pCntNd = rCrsr.GetCntntNode(FALSE); + const SwLayoutFrm *pEnd = rCrsr.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper(); SWRECTFN( pStart->GetUpper() ) @@ -2143,7 +2151,7 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv, void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling ) { - SwRowFrm *pRow = new SwRowFrm( rLine ); + SwRowFrm *pRow = new SwRowFrm( rLine, pUpper ); if ( pUpper->IsTabFrm() && ((SwTabFrm*)pUpper)->IsFollow() ) { SwTabFrm* pTabFrm = (SwTabFrm*)pUpper; @@ -2430,8 +2438,7 @@ void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers ) const USHORT nRepeat = rTable.GetRowsToRepeat(); for ( USHORT nIdx = 0; nIdx < nRepeat; ++nIdx ) { - SwRowFrm* pHeadline = new SwRowFrm( - *rTable.GetTabLines()[ nIdx ] ); + SwRowFrm* pHeadline = new SwRowFrm( *rTable.GetTabLines()[ nIdx ], &rTabFrm ); pHeadline->SetRepeatedHeadline( true ); pHeadline->Paste( &rTabFrm, pLower ); pHeadline->RegistFlys(); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index bcbdc826dd66..772f776d92c2 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -213,7 +213,7 @@ BOOL SwGrfNode::ReRead( if( refLink.Is() ) { - if( GetFrm() ) + if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) ) { SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE ); Modify( &aMsgHint, &aMsgHint ); @@ -597,7 +597,7 @@ BOOL SwGrfNode::RestorePersistentData() IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration(); refLink->SetVisible( pIDLA->IsVisibleLinks() ); pIDLA->GetLinkManager().InsertDDELink( refLink ); - if( getIDocumentLayoutAccess()->GetRootFrm() ) + if( getIDocumentLayoutAccess()->GetCurrentLayout() ) //swmod 080218 refLink->Update(); } return TRUE; diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx index 9bd12a45205f..1ab39ff1578c 100644 --- a/sw/source/core/inc/bodyfrm.hxx +++ b/sw/source/core/inc/bodyfrm.hxx @@ -41,7 +41,7 @@ protected: ~SwBodyFrm(); #endif public: - SwBodyFrm( SwFrmFmt* ); + SwBodyFrm( SwFrmFmt*, SwFrm* ); DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm) }; diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index fb479fc86549..2f2b81e6ebe9 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -43,7 +43,7 @@ protected: virtual void Format( const SwBorderAttrs *pAttrs = 0 ); public: - SwCellFrm( const SwTableBox &, bool bInsertContent = true ); + SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true ); ~SwCellFrm(); virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index 6d915bc72a8b..5050c5172606 100644 --- a/sw/source/core/inc/cntfrm.hxx +++ b/sw/source/core/inc/cntfrm.hxx @@ -68,7 +68,7 @@ protected: virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); - SwCntntFrm( SwCntntNode * const ); + SwCntntFrm( SwCntntNode * const, SwFrm* ); public: virtual ~SwCntntFrm(); diff --git a/sw/source/core/inc/colfrm.hxx b/sw/source/core/inc/colfrm.hxx index 4d8a54528aa5..90bb547c3333 100644 --- a/sw/source/core/inc/colfrm.hxx +++ b/sw/source/core/inc/colfrm.hxx @@ -33,7 +33,7 @@ class SwColumnFrm: public SwFtnBossFrm { public: - SwColumnFrm( SwFrmFmt* ); + SwColumnFrm( SwFrmFmt*, SwFrm* ); ~SwColumnFrm(); DECL_FIXEDMEMPOOL_NEWDEL(SwColumnFrm) diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index cadac60cb8ca..a346fd5a9e2d 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -58,7 +58,6 @@ class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject { //darf Locken. Definiert in frmtool.cxx friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * ); - friend void AppendAllObjs( const SwSpzFrmFmts * ); friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld, const SwRect* pOldPrt ); @@ -131,7 +130,7 @@ protected: Size CalcRel( const SwFmtFrmSize &rSz ) const; SwTwips CalcAutoWidth() const; - SwFlyFrm( SwFlyFrmFmt*, SwFrm *pAnchor ); + SwFlyFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); /** method to assure that anchored object is registered at the correct page frame diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index 105d1f117f9e..a648c1175138 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -68,7 +68,7 @@ protected: virtual void NotifyBackground( SwPageFrm *pPage, const SwRect& rRect, PrepareHint eHint); - SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor ); + SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); public: // --> OD 2004-06-29 #i28701# @@ -130,7 +130,7 @@ public: // --> OD 2004-06-29 #i28701# TYPEINFO(); - SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor ); + SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); SwFlyLayFrm( SwFlyLayFrm& ); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); @@ -159,7 +159,7 @@ public: // --> OD 2004-06-29 #i28701# TYPEINFO(); - SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor ); + SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); @@ -198,7 +198,7 @@ public: // --> OD 2004-06-29 #i28701# TYPEINFO(); - SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor ); + SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); virtual ~SwFlyInCntFrm(); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 552555e925f9..1cf116a66b4c 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -277,6 +277,7 @@ class SwFrm: public SwClient const sal_uInt32 mnFrmId; // <-- + SwRootFrm *mpRoot; SwLayoutFrm *pUpper; SwFrm *pNext; SwFrm *pPrev; @@ -403,6 +404,9 @@ protected: void ColLock() { bColLocked = TRUE; } void ColUnlock() { bColLocked = FALSE; } + // Only used by SwRootFrm Ctor to get 'this' into mpRoot... + void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; } + SwPageFrm *InsertPage( SwPageFrm *pSibling, BOOL bFtn ); void PrepareMake(); void OptPrepareMake(); @@ -425,7 +429,7 @@ protected: SwModify *GetDep() { return pRegisteredIn; } const SwModify *GetDep() const { return pRegisteredIn; } - SwFrm( SwModify* ); + SwFrm( SwModify*, SwFrm* ); void CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse ); @@ -614,10 +618,6 @@ public: inline BOOL HasFixSize() const { return bFixSize; } inline void SetFixSize( BOOL bNew ) { bFixSize = bNew; } - //Kann 0 liefern, pruefen auch ob die Shell zum richtigen Dokument - //gehoert. Impl in frmsh.hxx - ViewShell *GetShell() const; - //Prueft alle Seiten ab der Uebergebenen und korrigiert ggf. static void CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields = TRUE ); @@ -625,7 +625,7 @@ public: SwFrm *GetNext() { return pNext; } SwFrm *GetPrev() { return pPrev; } SwLayoutFrm *GetUpper() { return pUpper; } - SwRootFrm *FindRootFrm(); + SwRootFrm *getRootFrm(){ return mpRoot; } SwPageFrm *FindPageFrm(); SwFrm *FindColFrm(); SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE ); @@ -638,6 +638,7 @@ public: const SwFrm *GetNext() const { return pNext; } const SwFrm *GetPrev() const { return pPrev; } const SwLayoutFrm *GetUpper() const { return pUpper; } + const SwRootFrm *getRootFrm() const { return mpRoot; } inline SwTabFrm *FindTabFrm(); inline SwFtnFrm *FindFtnFrm(); inline SwFlyFrm *FindFlyFrm(); @@ -648,7 +649,6 @@ public: // <-- inline SwFrm *FindPrev(); inline const SwPageFrm *FindPageFrm() const; - inline const SwRootFrm *FindRootFrm() const; inline const SwFtnBossFrm *FindFtnBossFrm( BOOL bFtn = FALSE ) const; inline const SwFrm *FindColFrm() const; inline const SwFrm *FindFooterOrHeader() const; @@ -1077,10 +1077,6 @@ inline const SwPageFrm *SwFrm::FindPageFrm() const { return ((SwFrm*)this)->FindPageFrm(); } -inline const SwRootFrm *SwFrm::FindRootFrm() const -{ - return ((SwFrm*)this)->FindRootFrm(); -} inline const SwFrm *SwFrm::FindColFrm() const { return ((SwFrm*)this)->FindColFrm(); diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 94befc1dca59..dcc24294ca4b 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -37,6 +37,7 @@ class SwPageFrm; class SwFlyFrm; class SwCntntFrm; +class SwRootFrm; class SwDoc; class SwAttrSet; class SdrObject; @@ -138,7 +139,7 @@ const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ); // JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm // gerufen -SwFrm* GetFrmOfModify( SwModify const&, USHORT const nFrmType, const Point* = 0, +SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, USHORT const nFrmType, const Point* = 0, const SwPosition *pPos = 0, const BOOL bCalcFrm = FALSE ); diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx index 8b9ea8348395..49c803609020 100644 --- a/sw/source/core/inc/ftnboss.hxx +++ b/sw/source/core/inc/ftnboss.hxx @@ -70,7 +70,7 @@ protected: void InsertFtn( SwFtnFrm * ); static void ResetFtn( const SwFtnFrm *pAssumed ); public: - inline SwFtnBossFrm( SwFrmFmt* pFmt) : SwLayoutFrm( pFmt ) {} + inline SwFtnBossFrm( SwFrmFmt* pFmt, SwFrm* pSib ) : SwLayoutFrm( pFmt, pSib ) {} SwLayoutFrm *FindBodyCont(); inline const SwLayoutFrm *FindBodyCont() const; diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx index f8db9fabdf2d..7dc72c081f56 100644 --- a/sw/source/core/inc/ftnfrm.hxx +++ b/sw/source/core/inc/ftnfrm.hxx @@ -43,7 +43,7 @@ class SwFtnFrm; class SwFtnContFrm: public SwLayoutFrm { public: - SwFtnContFrm( SwFrmFmt* ); + SwFtnContFrm( SwFrmFmt*, SwFrm* ); const SwFtnFrm* FindFootNote() const; @@ -79,7 +79,7 @@ protected: public: - SwFtnFrm( SwFrmFmt*, SwCntntFrm*, SwTxtFtn* ); + SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* ); virtual void Cut(); virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx index ff25552abc27..95cbe84ebe68 100644 --- a/sw/source/core/inc/hffrm.hxx +++ b/sw/source/core/inc/hffrm.hxx @@ -39,7 +39,7 @@ protected: void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs); inline BOOL GetEatSpacing() const; // in hffrm.cxx public: - SwHeadFootFrm(SwFrmFmt * pFrm, USHORT aType); + SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, USHORT aType); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); virtual SwTwips GrowFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); @@ -50,7 +50,7 @@ public: class SwHeaderFrm: public SwHeadFootFrm { public: - SwHeaderFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_HEADER) {}; + SwHeaderFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_HEADER) {}; DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm) }; @@ -58,7 +58,7 @@ public: class SwFooterFrm: public SwHeadFootFrm { public: - SwFooterFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_FOOTER) {}; + SwFooterFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_FOOTER) {}; DECL_FIXEDMEMPOOL_NEWDEL(SwFooterFrm) }; diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx index 28216e326b41..76abd86f1538 100644 --- a/sw/source/core/inc/layfrm.hxx +++ b/sw/source/core/inc/layfrm.hxx @@ -102,7 +102,7 @@ public: const SwCrsrMoveState *pCMS = 0, const BOOL bDefaultExpand = TRUE ) const; - SwLayoutFrm( SwFrmFmt* ); + SwLayoutFrm( SwFrmFmt*, SwFrm* ); ~SwLayoutFrm(); virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index 7782a6b90d98..b2e6f45f6c67 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -52,7 +52,7 @@ class SwNoTxtFrm: public SwCntntFrm protected: virtual void MakeAll(); public: - SwNoTxtFrm( SwNoTxtNode * const ); + SwNoTxtFrm( SwNoTxtNode * const, SwFrm* ); ~SwNoTxtFrm(); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index bc2fef9b8be4..9c0b8af55e95 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -195,7 +195,7 @@ protected: public: DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm) - SwPageFrm( SwFrmFmt*, SwPageDesc* ); + SwPageFrm( SwFrmFmt*, SwFrm*, SwPageDesc* ); ~SwPageFrm(); //public, damit die ViewShell beim Umschalten vom BrowseMode darauf diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index ee894a0ef539..b6660978c5dd 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -165,6 +165,11 @@ public: //MasterObjekte aus der Page entfernen (von den Ctoren gerufen). static void RemoveMasterObjs( SdrPage *pPg ); + void AllCheckPageDescs() const;//swmod 080226 + void AllInvalidateAutoCompleteWords() const;//swmod 080305 + void AllAddPaintRect() const; + void AllRemoveFtns() ;//swmod 080305 + void AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const;//swmod 080307 //Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen) static BOOL FlushVout(); //Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx index 7f772e10913f..18ce78dc41ff 100644 --- a/sw/source/core/inc/rowfrm.hxx +++ b/sw/source/core/inc/rowfrm.hxx @@ -56,7 +56,7 @@ protected: virtual void MakeAll(); public: - SwRowFrm( const SwTableLine &, bool bInsertContent = true ); + SwRowFrm( const SwTableLine &, SwFrm*, bool bInsertContent = true ); ~SwRowFrm(); virtual void Cut(); diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 3f677ec51932..f32d5cdba1e3 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -60,7 +60,7 @@ protected: virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat ); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); public: - SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt! + SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt! SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows ~SwSectionFrm(); diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index 3f55c6bdf0ec..f5f8975c228e 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -113,7 +113,7 @@ protected: //Aendert nur die Framesize, nicht die PrtArea-SSize virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); public: - SwTabFrm( SwTable & ); //Immer nach dem erzeugen _und_ pasten das + SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das //Regist Flys rufen! SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows ~SwTabFrm(); diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 5a8783df261b..42593b174314 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -337,7 +337,7 @@ public: inline const SwTxtNode *GetTxtNode() const { return (SwTxtNode*)SwCntntFrm::GetNode(); } - SwTxtFrm(SwTxtNode * const); + SwTxtFrm(SwTxtNode * const, SwFrm* ); virtual ~SwTxtFrm(); // SwCntntFrm: der "kurze Dienstweg" fuer die Frames. diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 37ec80632153..cc645e674e70 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2544,7 +2544,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint, else { sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX; - pFrm = ::GetFrmOfModify( *(SwModify*)this, nFrmType, pPoint, + pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, nFrmType, pPoint, 0, bCalcFrm ); } @@ -2578,7 +2578,7 @@ SdrObject* SwFrmFmt::FindRealSdrObject() if( RES_FLYFRMFMT == Which() ) { Point aNullPt; - SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( *this, FRM_FLY, + SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( 0, *this, FRM_FLY, &aNullPt, 0, sal_False ); return pFly ? pFly->GetVirtDrawObj() : 0; } @@ -2701,8 +2701,8 @@ SwFlyFrmFmt::~SwFlyFrmFmt() void SwFlyFrmFmt::MakeFrms() { // gibts ueberhaupt ein Layout ?? - if( !GetDoc()->GetRootFrm() ) - return; + if( !GetDoc()->GetCurrentViewShell() ) + return; //swmod 071108//swmod 071225 SwModify *pModify = 0; // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes. @@ -2764,7 +2764,7 @@ void SwFlyFrmFmt::MakeFrms() case FLY_AT_PAGE: { sal_uInt16 nPgNum = aAnchorAttr.GetPageNum(); - SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower(); + SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetCurrentLayout()->Lower(); //swmod 080218 if( !nPgNum && aAnchorAttr.GetCntntAnchor() ) { SwCntntNode *pCNd = @@ -2858,16 +2858,16 @@ void SwFlyFrmFmt::MakeFrms() switch( aAnchorAttr.GetAnchorId() ) { case FLY_AT_FLY: - pFly = new SwFlyLayFrm( this, pFrm ); + pFly = new SwFlyLayFrm( this, pFrm, pFrm ); break; case FLY_AT_PARA: case FLY_AT_CHAR: - pFly = new SwFlyAtCntFrm( this, pFrm ); + pFly = new SwFlyAtCntFrm( this, pFrm, pFrm ); break; case FLY_AS_CHAR: - pFly = new SwFlyInCntFrm( this, pFrm ); + pFly = new SwFlyInCntFrm( this, pFrm, pFrm ); break; default: ASSERT( !this, "Neuer Ankertyp" ) @@ -2884,7 +2884,7 @@ void SwFlyFrmFmt::MakeFrms() SwFlyFrm* SwFlyFrmFmt::GetFrm( const Point* pPoint, const sal_Bool bCalcFrm ) const { - return (SwFlyFrm*)::GetFrmOfModify( *(SwModify*)this, FRM_FLY, + return (SwFlyFrm*)::GetFrmOfModify( 0, *(SwModify*)this, FRM_FLY, pPoint, 0, bCalcFrm ); } diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 28287c957ad1..4db476eab8b6 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -33,6 +33,7 @@ #include "viewsh.hxx" #include "doc.hxx" #include "viewimp.hxx" +#include "viewopt.hxx" #include "swtypes.hxx" #include "dflyobj.hxx" #include "dcontact.hxx" @@ -179,9 +180,9 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & ) //determine space left in new upper frame nSpace = (aRect.*fnRectX->fnGetHeight)(); - + const ViewShell *pSh = pNewUpper->getRootFrm()->GetCurrShell(); if ( IsInFtn() || - pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) || + (pSh && pSh->GetViewOptions()->getBrowseMode()) || pNewUpper->IsCellFrm() || ( pNewUpper->IsInSct() && ( pNewUpper->IsSctFrm() || ( pNewUpper->IsColBodyFrm() && @@ -732,8 +733,8 @@ void SwPageFrm::MakeAll() pAttrs = pAccess->Get(); } //Bei der BrowseView gelten feste Einstellungen. - ViewShell *pSh = GetShell(); - if ( pSh && GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + ViewShell *pSh = getRootFrm()->GetCurrShell(); + if ( pSh && pSh->GetViewOptions()->getBrowseMode() ) { const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); const long nTop = pAttrs->CalcTopLine() + aBorder.Height(); @@ -986,11 +987,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) const long nRight = ((SwBorderAttrs&)rAttrs).CalcRight( this ); (this->*fnRect->fnSetXMargins)( nLeft, nRight ); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); SwTwips nWidthArea; if( pSh && 0!=(nWidthArea=(pSh->VisArea().*fnRect->fnGetWidth)()) && GetUpper()->IsPageBodyFrm() && // nicht dagegen bei BodyFrms in Columns - pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + pSh->GetViewOptions()->getBrowseMode() ) { //Nicht ueber die Kante des sichbaren Bereiches hinausragen. //Die Seite kann breiter sein, weil es Objekte mit "ueberbreite" diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index f64752a18708..3a295a80cbb0 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -58,11 +58,11 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes ); |* Letzte Aenderung AMA 30. Oct 98 |* |*************************************************************************/ -SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt ): - SwFtnBossFrm( pFmt ) +SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt, SwFrm* pSib ): + SwFtnBossFrm( pFmt, pSib ) { nType = FRMC_COLUMN; - SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt() ); + SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt(), pSib ); pColBody->InsertBehind( this, 0 ); // ColumnFrms jetzt mit BodyFrm SetMaxFtnHeight( LONG_MAX ); } @@ -174,7 +174,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount ) } for ( USHORT i = 0; i < nCount; ++i ) { - SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt() ); + SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt(), pCont ); pTmpCol->SetMaxFtnHeight( nMax ); pTmpCol->InsertBefore( pCont, NULL ); pNeighbourCol = (SwLayoutFrm*)pNeighbourCol->GetNext(); @@ -186,7 +186,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount ) for ( USHORT i = 0; i < nCount; ++i ) { SwFrmFmt *pFmt = pDoc->MakeFrmFmt( aEmptyStr, pDoc->GetDfltFrmFmt()); - SwColumnFrm *pTmp = new SwColumnFrm( pFmt ); + SwColumnFrm *pTmp = new SwColumnFrm( pFmt, pCont ); pTmp->SetMaxFtnHeight( nMax ); pTmp->Paste( pCont ); } @@ -248,7 +248,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew, // SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen // und im normalen Textfluss unterbringen. if( IsPageBodyFrm() ) - pDoc->GetRootFrm()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE ); + pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE ); //swmod 080218 pSave = ::SaveCntnt( this ); //Wenn Spalten existieren, jetzt aber eine Spaltenanzahl von diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 8a1e8fe9ea7a..dfdc76263efc 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -468,22 +468,6 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const |* Letzte Aenderung MA 05. Sep. 93 |* |*************************************************************************/ -SwRootFrm* SwFrm::FindRootFrm() -{ - // MIB: A layout frame is always registerd at a SwFrmFmt and a content - // frame alyways at a SwCntntNode. For any other case we won't find - // a root frame. - // Casting the GetDep() result instead of the frame itself (that has - // been done before) makes it save to use that method in constructors - // and destructors. - ASSERT( GetDep(), "frame is not registered any longer" ); - ASSERT( IsLayoutFrm() || IsCntntFrm(), "invalid frame type" ); - SwDoc *pDoc = IsLayoutFrm() - ? static_cast < SwFrmFmt * >( GetDep() )->GetDoc() - : static_cast < SwCntntNode * >( GetDep() )->GetDoc(); - return pDoc->GetRootFrm(); -} - SwPageFrm* SwFrm::FindPageFrm() { SwFrm *pRet = this; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index d0015b12114d..4c35ff65ea27 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -30,11 +30,13 @@ #include "pam.hxx" #include "swtable.hxx" #include "frame.hxx" +#include "rootfrm.hxx" #include "pagefrm.hxx" #include "flyfrm.hxx" #include "viewsh.hxx" #include "doc.hxx" #include "viewimp.hxx" +#include "viewopt.hxx" #include "dflyobj.hxx" #include "frmtool.hxx" #include "dcontact.hxx" @@ -604,7 +606,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling ) ASSERT( rThis.GetUpper(), "Wo kommen wir denn her?" ); //Sparsamer benachrichtigen wenn eine Action laeuft. - ViewShell *pSh = rThis.GetShell(); + ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); const SwViewImp *pImp = pSh ? pSh->Imp() : 0; const BOOL bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete(); @@ -1042,12 +1044,13 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) return pLayLeaf; SwPageFrm *pNew = pLayLeaf->FindPageFrm(); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); // #111704# The pagedesc check does not make sense for frames in fly frames if ( pNew != FindPageFrm() && !bNewPg && !IsInFly() && // --> FME 2005-05-10 #i46683# // Do not consider page descriptions in browse mode (since // MoveBwd ignored them) - !pNew->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + !(pSh && pSh->GetViewOptions()->getBrowseMode() ) ) // <-- { if( WrongPageDesc( pNew ) ) @@ -1173,7 +1176,8 @@ BOOL SwFlowFrm::IsPrevObjMove() const // und fuer diesen ggf. Umbrechen. //!!!!!!!!!!!Hack!!!!!!!!!!! - if ( rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) return FALSE; SwFrm *pPre = rThis.FindPrev(); @@ -1252,9 +1256,11 @@ BOOL SwFlowFrm::IsPrevObjMove() const BOOL SwFlowFrm::IsPageBreak( BOOL bAct ) const { if ( !IsFollow() && rThis.IsInDocBody() && - ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) && // i66968 - !rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) ) // i66968 { + const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) + return FALSE; const SwAttrSet *pSet = rThis.GetAttrSet(); //Vorgaenger ermitteln @@ -2113,7 +2119,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways ) rThis.Prepare( PREP_BOSS_CHGD, 0, FALSE ); if( !bSamePage ) { - ViewShell *pSh = rThis.GetShell(); + ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); if ( pSh && !pSh->Imp()->IsUpdateExpFlds() ) pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher erledigt! @@ -2125,7 +2131,9 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways ) } } // OD 30.10.2002 #97265# - no in online layout - if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); + + if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) ) { // --> OD 2009-12-31 #i106452# // check page description not only in situation with sections. @@ -2593,7 +2601,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat ) { //Kann sein, dass ich einen Container bekam. SwFtnFrm *pOld = rThis.FindFtnFrm(); - SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(), + SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(), pOld, pOld->GetRef(), pOld->GetAttr() ); if ( pOld->GetMaster() ) { @@ -2674,7 +2682,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat ) if( pNewPage != pOldPage ) { rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, FALSE ); - ViewShell *pSh = rThis.GetShell(); + ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); if ( pSh && !pSh->Imp()->IsUpdateExpFlds() ) pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher eledigt! @@ -2684,7 +2692,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat ) pNewPage->InvalidateWordCount(); // OD 30.10.2002 #97265# - no in online layout - if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) ) { if ( bCheckPageDescs && pNewPage->GetNext() ) { diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index cd590d73ddcc..79ea87a6aef8 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -77,6 +77,7 @@ #include "pam.hxx" #include "frmatr.hxx" #include "viewimp.hxx" +#include "viewopt.hxx" #include "errhdl.hxx" #include "dcontact.hxx" #include "dflyobj.hxx" @@ -111,8 +112,8 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject); |* |*************************************************************************/ -SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : - SwLayoutFrm( pFmt ), +SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : + SwLayoutFrm( pFmt, pSib ), // OD 2004-03-22 #i26791# SwAnchoredObject(), // OD 2004-05-27 #i26791# - moved to @@ -149,11 +150,16 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : bInvalidVert = 0; bDerivedVert = 0; bDerivedR2L = 0; - if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir - || pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir ) + bVertical = 0; + else + { + const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) bVertical = 0; else bVertical = 1; + } bVert = bVertical; bInvalidR2L = 0; if( FRMDIR_HORI_RIGHT_TOP == nDir ) @@ -288,7 +294,7 @@ SwFlyFrm::~SwFlyFrm() // anchor will do that. if( IsAccessibleFrm() && GetFmt() && (IsFlyInCntFrm() || !GetAnchorFrm()) ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() ) { ViewShell *pVSh = pRootFrm->GetCurrShell(); @@ -428,7 +434,7 @@ void SwFlyFrm::FinitDrawObj() //Bei den SdrPageViews abmelden falls das Objekt dort noch selektiert ist. if ( !GetFmt()->GetDoc()->IsInDtor() ) { - ViewShell *p1St = GetShell(); + ViewShell *p1St = getRootFrm()->GetCurrShell(); if ( p1St ) { ViewShell *pSh = p1St; @@ -524,10 +530,13 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) } // invalidate accessible relation set (accessibility wrapper) - ViewShell* pSh = pMaster->GetShell(); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell(); + if( pSh ) + { + SwRootFrm* pLayout = pMaster->getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow ); - + } } void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) @@ -567,10 +576,14 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) pFollow->GetFmt()->GetDoc(), ++nIndex ); // invalidate accessible relation set (accessibility wrapper) - ViewShell* pSh = pMaster->GetShell(); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell(); + if( pSh ) + { + SwRootFrm* pLayout = pMaster->getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow ); } +} /************************************************************************* |* @@ -772,7 +785,7 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTxtFrm() ) ClrContourCache( GetVirtDrawObj() ); SwRootFrm *pRoot; - if ( nInvFlags & 0x20 && 0 != (pRoot = FindRootFrm()) ) + if ( nInvFlags & 0x20 && 0 != (pRoot = getRootFrm()) ) pRoot->InvalidateBrowseWidth(); // --> OD 2004-06-28 #i28701# if ( nInvFlags & 0x80 ) @@ -794,7 +807,7 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, { BOOL bClear = TRUE; const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); switch( nWhich ) { case RES_VERT_ORIENT: @@ -846,8 +859,12 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, const SvxProtectItem *pP = (SvxProtectItem*)pNew; GetVirtDrawObj()->SetMoveProtect( pP->IsPosProtected() ); GetVirtDrawObj()->SetResizeProtect( pP->IsSizeProtected() ); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + if( pSh ) + { + SwRootFrm* pLayout = getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this ); + } break; } @@ -958,8 +975,8 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, case RES_LR_SPACE: { rInvFlags |= 0x41; - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) - GetFmt()->GetDoc()->GetRootFrm()->InvalidateBrowseWidth(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) + getRootFrm()->InvalidateBrowseWidth(); SwRect aNew( GetObjRectWithSpaces() ); SwRect aOld( aFrm ); if ( RES_UL_SPACE == nWhich ) @@ -1000,11 +1017,15 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, pIDDMA->GetHeavenId() : pIDDMA->GetHellId(); GetVirtDrawObj()->SetLayer( nId ); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + if( pSh ) + { + SwRootFrm* pLayout = getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) { pSh->Imp()->DisposeAccessibleFrm( this ); pSh->Imp()->AddAccessibleFrm( this ); } + } // --> OD 2004-06-28 #i28701# - perform reorder of object lists // at anchor frame and at page frame. rInvFlags |= 0x80; @@ -2194,7 +2215,7 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove ) pToRemove->GetFmt() && !pToRemove->IsFlyInCntFrm() ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() ) { ViewShell *pVSh = pRootFrm->GetCurrShell(); @@ -2261,9 +2282,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj ) } // Notify accessible layout. - ViewShell* pSh = GetShell(); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + ViewShell* pSh = getRootFrm()->GetCurrShell(); + if( pSh ) { + SwRootFrm* pLayout = getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) pSh->Imp()->AddAccessibleObj( _rNewObj.GetDrawObj() ); } } @@ -2271,9 +2294,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj ) void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj ) { // Notify accessible layout. - ViewShell* pSh = GetShell(); - if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) + ViewShell* pSh = getRootFrm()->GetCurrShell(); + if( pSh ) { + SwRootFrm* pLayout = getRootFrm(); + if( pLayout && pLayout->IsAnyShellAccessible() ) pSh->Imp()->DisposeAccessibleObj( _rToRemoveObj.GetDrawObj() ); } @@ -2493,10 +2518,10 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const if( pRel ) // LAYER_IMPL { long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX; - const ViewShell *pSh = GetShell(); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( ( pRel->IsBodyFrm() || pRel->IsPageFrm() ) && - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - pSh && pSh->VisArea().HasArea() ) + pSh && pSh->GetViewOptions()->getBrowseMode() && + pSh->VisArea().HasArea() ) { nRelWidth = pSh->GetBrowseWidth(); nRelHeight = pSh->VisArea().Height(); diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 4d9b654fb79c..7f3dc5e2a027 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -29,7 +29,6 @@ #include "precompiled_sw.hxx" #include #include "pagefrm.hxx" -#include "rootfrm.hxx" #include "cntfrm.hxx" #include "flyfrm.hxx" #include "txtfrm.hxx" @@ -83,8 +82,8 @@ using namespace ::com::sun::star; |* |*************************************************************************/ -SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : - SwFlyFreeFrm( pFmt, pAnch ) +SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : + SwFlyFreeFrm( pFmt, pSib, pAnch ) { bAtCnt = TRUE; bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId()); @@ -194,7 +193,7 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) if ( !pCntnt ) { SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode(); - pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, FALSE ); + pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, FALSE ); ASSERT( pCntnt, "Neuen Anker nicht gefunden" ); } //Flys haengen niemals an einem Follow sondern immer am diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 61fb9163c6f1..2d64357e0e20 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -52,8 +52,8 @@ void DeepCalc( const SwFrm *pFrm ); |* Letzte Aenderung MA 09. Apr. 99 |* |*************************************************************************/ -SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : - SwFlyFrm( pFmt, pAnch ) +SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : + SwFlyFrm( pFmt, pSib, pAnch ) { bInCnt = bInvalidLayout = bInvalidCntnt = TRUE; SwTwips nRel = pFmt->GetVertOrient().GetPos(); diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 63d067c175b4..26445d82a9e0 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -74,8 +74,8 @@ using namespace ::com::sun::star; |* |*************************************************************************/ -SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : - SwFlyFrm( pFmt, pAnch ), +SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : + SwFlyFrm( pFmt, pSib, pAnch ), pPage( 0 ), // --> OD 2004-11-15 #i34753# mbNoMakePos( false ), @@ -548,8 +548,8 @@ bool SwFlyFreeFrm::IsFormatPossible() const |* |*************************************************************************/ -SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : - SwFlyFreeFrm( pFmt, pAnch ) +SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) : + SwFlyFreeFrm( pFmt, pSib, pAnch ) { bLayout = TRUE; } @@ -600,7 +600,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) if ( FLY_AT_PAGE == pAnch->GetAnchorId() ) { USHORT nPgNum = pAnch->GetPageNum(); - SwRootFrm *pRoot = FindRootFrm(); + SwRootFrm *pRoot = getRootFrm(); SwPageFrm *pTmpPage = (SwPageFrm*)pRoot->Lower(); for ( USHORT i = 1; (i <= nPgNum) && pTmpPage; ++i, pTmpPage = (SwPageFrm*)pTmpPage->GetNext() ) @@ -622,7 +622,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) { SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode ); SwCntntFrm *pCntnt = GetFmt()->GetDoc()->GetNodes().GoNext( &aIdx )-> - GetCntntNode()->GetFrm( 0, 0, FALSE ); + GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, FALSE ); if( pCntnt ) { SwFlyFrm *pTmp = pCntnt->FindFlyFrm(); @@ -653,7 +653,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) { if ( !pNew->GetVirtDrawObj()->IsInserted() ) - FindRootFrm()->GetDrawPage()->InsertObject( + getRootFrm()->GetDrawPage()->InsertObject( (SdrObject*)pNew->GetVirtDrawObj(), pNew->GetVirtDrawObj()->GetReferencedObj().GetOrdNumDirect() ); @@ -765,7 +765,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove ) { const UINT32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum(); - FindRootFrm()->GetDrawPage()->RemoveObject( nOrdNum ); + getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum ); pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum ); if ( GetUpper() ) @@ -1036,7 +1036,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt ) AppendFly( pFly ); else { ASSERT( pFmt, ":-( kein Format fuer Fly uebergeben." ); - pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this ); + pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this, this ); AppendFly( pFly ); ::RegistFlys( this, pFly ); } diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index c724ad8779db..ae27eb8ed805 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -58,7 +58,7 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, { pNdIdx = new SwNodeIndex( rIdx ); } - else if( pFmt->GetDoc()->GetRootFrm() ) + else if( pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { SwClientIter aIter( (SwFmt&)*pFmt ); if( RES_FLYFRMFMT == pFmt->Which() ) diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 395009122063..7da50d2d0dae 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -56,6 +56,7 @@ #include "doc.hxx" #include "fesh.hxx" #include "viewimp.hxx" +#include "viewopt.hxx" #include "pam.hxx" #include "dflyobj.hxx" #include "dcontact.hxx" @@ -275,7 +276,7 @@ SwFrmNotify::~SwFrmNotify() { if( pFrm->IsAccessibleFrm() ) { - SwRootFrm *pRootFrm = pFrm->FindRootFrm(); + SwRootFrm *pRootFrm = pFrm->getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -410,7 +411,7 @@ SwFrmNotify::~SwFrmNotify() } else if( pFrm->IsTxtFrm() && bValidSize != pFrm->GetValidSizeFlag() ) { - SwRootFrm *pRootFrm = pFrm->FindRootFrm(); + SwRootFrm *pRootFrm = pFrm->getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -607,13 +608,16 @@ SwLayNotify::~SwLayNotify() if ( pLay->IsTabFrm() ) //Damit _nur_ der Shatten bei Groessenaenderungen gemalt wird. ((SwTabFrm*)pLay)->SetComplete(); - else if ( !pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || + else + { + const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); + if( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) || !(pLay->GetType() & (FRM_BODY | FRM_PAGE)) ) //Damit die untergeordneten sauber retouchiert werden. //Problembsp: Flys an den Henkeln packen und verkleinern. //Nicht fuer Body und Page, sonst flackerts beim HTML-Laden. pLay->SetCompletePaint(); - + } } //Lower benachrichtigen wenn sich die Position veraendert hat. const BOOL bPrtPos = POS_DIFF( aPrt, pLay->Prt() ); @@ -728,7 +732,7 @@ SwFlyNotify::~SwFlyNotify() SwFlyFrm *pFly = GetFly(); if ( pFly->IsNotifyBack() ) { - ViewShell *pSh = pFly->GetShell(); + ViewShell *pSh = pFly->getRootFrm()->GetCurrShell(); SwViewImp *pImp = pSh ? pSh->Imp() : 0; if ( !pImp || !pImp->IsAction() || !pImp->GetLayAction().IsAgain() ) { @@ -945,7 +949,7 @@ SwCntntNotify::~SwCntntNotify() { //Aktive PlugIn's oder OLE-Objekte sollten etwas von der Veraenderung //mitbekommen, damit sie Ihr Window entsprechend verschieben. - ViewShell *pSh = pCnt->GetShell(); + ViewShell *pSh = pCnt->getRootFrm()->GetCurrShell(); if ( pSh ) { SwOLENode *pNd; @@ -1182,9 +1186,9 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, { SwFlyFrm *pFly; if( bFlyAtFly ) - pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm ); + pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm ); else - pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm ); + pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm ); pFly->Lock(); pFrm->AppendFly( pFly ); pFly->Unlock(); @@ -1196,18 +1200,27 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, } } -BOOL MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt ) +bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib ) { SwClientIter aIter( *pFmt ); if ( RES_FLYFRMFMT == pFmt->Which() ) - return 0 != aIter.First( TYPE(SwFlyFrm) ); + { + const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; + const SwFlyFrm* pTmpFrm; + for( pTmpFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm )); pTmpFrm; + pTmpFrm = (SwFlyFrm*)aIter.Next() ) + { + if(! pRoot || pRoot == pTmpFrm->getRootFrm() ) + return true; + } + } else { SwDrawContact *pContact; if ( 0 != (pContact = (SwDrawContact*)aIter.First( TYPE(SwDrawContact)))) return pContact->GetAnchorFrm() != 0; } - return FALSE; + return false; } /** helper method to determine, if a , which has an object connected, @@ -1219,9 +1232,6 @@ BOOL MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt ) */ bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt ) { - ASSERT( lcl_ObjConnected( &_rFmt ), - "::lcl_InHeaderOrFooter(..) - has no connected object" ); - bool bRetVal = false; const SwFmtAnchor& rAnch = _rFmt.GetAnchor(); @@ -1234,7 +1244,7 @@ bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt ) return bRetVal; } -void AppendAllObjs( const SwSpzFrmFmts *pTbl ) +void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib ) { //Verbinden aller Objekte, die in der SpzTbl beschrieben sind mit dem //Layout. @@ -1262,7 +1272,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl ) //will ich hier nicht. bRemove = TRUE; } - else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt )) || + else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) || ::lcl_InHeaderOrFooter( *pFmt ) ) { // OD 23.06.2003 #108784# - correction: for objects in header @@ -1272,7 +1282,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl ) //keine abhaengigen Existieren, andernfalls, oder wenn das //MakeFrms keine abhaengigen erzeugt, entfernen. pFmt->MakeFrms(); - bRemove = ::lcl_ObjConnected( pFmt ); + bRemove = ::lcl_ObjConnected( pFmt, pSib ); } if ( bRemove ) { @@ -1308,9 +1318,9 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, SwFrm *pPrv ) { pDoc->BlockIdling(); - SwRootFrm* pLayout = pDoc->GetRootFrm(); - const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False; - if(pLayout) + SwRootFrm* pLayout = pLay->getRootFrm(); + const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : FALSE; + if( bOldCallbackActionEnabled ) pLayout->SetCallbackActionEnabled( FALSE ); //Bei der Erzeugung des Layouts wird bPages mit TRUE uebergeben. Dann @@ -1390,8 +1400,8 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, if ( pNd->IsCntntNode() ) { SwCntntNode* pNode = (SwCntntNode*)pNd; - pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode ) : - pNode->MakeFrm(); + pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode, pLay ) : + pNode->MakeFrm( pLay ); if( pPageMaker ) pPageMaker->CheckInsert( nIndex ); @@ -1403,7 +1413,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pFrm->IsTxtFrm() ) { - ViewShell* pViewShell( pFrm->GetShell() ); + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); // no notification, if is in construction if ( pViewShell && !pViewShell->IsInConstructor() && pViewShell->GetLayout() && @@ -1443,7 +1453,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, pDoc->UpdateTblFlds( &aMsgHnt ); pTblNode->GetTable().GCLines(); - pFrm = pTblNode->MakeFrm(); + pFrm = pTblNode->MakeFrm( pLay ); if( pPageMaker ) pPageMaker->CheckInsert( nIndex ); @@ -1455,7 +1465,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. { - ViewShell* pViewShell( pFrm->GetShell() ); + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); // no notification, if is in construction if ( pViewShell && !pViewShell->IsInConstructor() && pViewShell->GetLayout() && @@ -1493,7 +1503,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, nIndex = pNode->EndOfSectionIndex(); else { - pFrm = pNode->MakeFrm(); + pFrm = pNode->MakeFrm( pLay ); pActualSection = new SwActualSection( pActualSection, (SwSectionFrm*)pFrm, pNode ); if ( pActualSection->GetUpper() ) @@ -1532,7 +1542,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. { - ViewShell* pViewShell( pFrm->GetShell() ); + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); // no notification, if is in construction if ( pViewShell && !pViewShell->IsInConstructor() && pViewShell->GetLayout() && @@ -1604,7 +1614,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, } // new section frame - pFrm = pActualSection->GetSectionNode()->MakeFrm(); + pFrm = pActualSection->GetSectionNode()->MakeFrm( pLay ); pFrm->InsertBehind( pLay, pPrv ); static_cast(pFrm)->Init(); @@ -1682,7 +1692,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, if ( bPages ) //Jetzt noch die Flys verbinden lassen. { if ( !bDontCreateObjects ) - AppendAllObjs( pTbl ); + AppendAllObjs( pTbl, pLayout ); bObjsDirect = TRUE; } @@ -1702,7 +1712,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, } pDoc->UnblockIdling(); - if(pLayout) + if( bOldCallbackActionEnabled ) pLayout->SetCallbackActionEnabled( bOldCallbackActionEnabled ); } @@ -1885,7 +1895,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, { const SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts(); if( pTbl->Count() ) - AppendAllObjs( pTbl ); + AppendAllObjs( pTbl, pUpper ); } // Wenn nichts eingefuegt wurde, z.B. ein ausgeblendeter Bereich, @@ -1912,7 +1922,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, if( !pSct->ContainsCntnt() ) { pSct->DelEmpty( TRUE ); - pDoc->GetRootFrm()->RemoveFromList( pSct ); + pUpper->getRootFrm()->RemoveFromList( pSct ); delete pSct; } } @@ -2903,11 +2913,11 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, { SwPageDesc *pTmpDesc = pSibling && pSibling->GetPrev() ? ((SwPageFrm*)pSibling->GetPrev())->GetPageDesc() : &rDesc; - pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pTmpDesc ); + pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pUpper, pTmpDesc ); pRet->Paste( pUpper, pSibling ); pRet->PreparePage( bFtn ); } - pRet = new SwPageFrm( pFmt, &rDesc ); + pRet = new SwPageFrm( pFmt, pUpper, &rDesc ); pRet->Paste( pUpper, pSibling ); pRet->PreparePage( bFtn ); if ( pRet->GetNext() ) @@ -3019,7 +3029,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, //Der Einfachheit halber wird hier bewusst jeweils ein Twip //unnoetig invalidiert. - ViewShell *pSh = pFly->GetShell(); + ViewShell *pSh = pFly->getRootFrm()->GetCurrShell(); if( pSh && rOld.HasArea() ) pSh->InvalidateWindows( rOld ); @@ -3317,7 +3327,7 @@ void Notify_Background( const SdrObject* pObj, // --> OD 2008-01-30 #i82258# - make code robust ViewShell* pSh = 0; if ( bInva && pPage && - 0 != (pSh = pPage->GetShell()) ) + 0 != (pSh = pPage->getRootFrm()->GetCurrShell()) ) { pSh->InvalidateWindows( rRect ); } @@ -3382,7 +3392,7 @@ BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj ) } else { - pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm(); + pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm(pObj); aPos = pObj->GetCurrentBoundRect().TopLeft(); } ASSERT( pFrm, "8-( Fly is lost in Space." ); @@ -3516,7 +3526,7 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ) return pPage; } -SwFrm* GetFrmOfModify( SwModify const& rMod, USHORT const nFrmType, +SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType, const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) { SwFrm *pMinFrm = 0, *pTmpFrm; @@ -3533,6 +3543,7 @@ SwFrm* GetFrmOfModify( SwModify const& rMod, USHORT const nFrmType, pTmpFrm = (SwFrm*)aIter.Next() ) { if( pTmpFrm->GetType() & nFrmType && + ( !pLayout || pLayout == pTmpFrm->getRootFrm() ) && (!pTmpFrm->IsFlowFrm() || !SwFlowFrm::CastFlowFrm( pTmpFrm )->IsFollow() )) { diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 3dc03053a23f..b808f22452af 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -51,6 +51,8 @@ // --> OD 2005-05-17 #i49383# #include // <-- +#include "viewopt.hxx" +#include "viewsh.hxx" /************************************************************************* |* @@ -214,8 +216,8 @@ USHORT lcl_ColumnNum( const SwFrm* pBoss ) |*************************************************************************/ -SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt ): - SwLayoutFrm( pFmt ) +SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt, SwFrm* pSib ): + SwLayoutFrm( pFmt, pSib ) { nType = FRMC_FTNCONT; } @@ -283,7 +285,14 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) if ( !bValidSize ) { - if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + bool bGrow = pPage->IsFtnPage(); + if( bGrow ) + { + const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) + bGrow = false; + } + if( bGrow ) Grow( LONG_MAX, FALSE ); else { @@ -379,7 +388,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL ) return 0; } } - const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); SwPageFrm *pPage = pBoss->FindPageFrm(); if ( bBrowseMode || !pPage->IsFtnPage() ) { @@ -483,9 +493,19 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL ) SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo ) { SwPageFrm *pPage = FindPageFrm(); - if ( pPage && - ( !pPage->IsFtnPage() || - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) ) + bool bShrink = false; + if ( pPage ) + { + if( !pPage->IsFtnPage() ) + bShrink = true; + else + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) + bShrink = true; + } + } + if( bShrink ) { SwTwips nRet = SwLayoutFrm::ShrinkFrm( nDiff, bTst, bInfo ); if( IsInSct() && !bTst ) @@ -511,8 +531,8 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo ) |*************************************************************************/ -SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ): - SwLayoutFrm( pFmt ), +SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt ): + SwLayoutFrm( pFmt, pSib ), pFollow( 0 ), pMaster( 0 ), pRef( pCnt ), @@ -636,8 +656,8 @@ void SwFtnFrm::Cut() if ( pPage ) { SwLayoutFrm *pBody = pPage->FindBodyCont(); - if ( !pBody->ContainsCntnt() ) - pPage->FindRootFrm()->SetSuperfluous(); + if( pBody && !pBody->ContainsCntnt() ) + pPage->getRootFrm()->SetSuperfluous(); } SwSectionFrm* pSect = pUp->FindSctFrm(); pUp->Cut(); @@ -1146,7 +1166,7 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont() } #endif - SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt()); + SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt(), this ); SwLayoutFrm *pLay = FindBodyCont(); pNew->Paste( this, pLay->GetNext() ); return pNew; @@ -1379,6 +1399,8 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) if ( pLast->ISA(SwFrm) ) { SwFrm *pFrm = (SwFrm*)pLast; + if( pFrm->getRootFrm() == pCheck->getRootFrm() ) + { SwFrm *pTmp = pFrm->GetUpper(); while ( pTmp && !pTmp->IsFtnFrm() ) pTmp = pTmp->GetUpper(); @@ -1397,6 +1419,7 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) } } } + } pLast = ++aIter; } } @@ -1830,7 +1853,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr ) } } - SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), pRef, pAttr ); + SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), this, pRef, pAttr ); { SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 ); ::_InsertCnt( pNew, pDoc, aIdx.GetIndex() ); @@ -2850,7 +2873,8 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine ) else nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine ); - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nMaxFtnHeight += pBody->Grow( LONG_MAX, TRUE ); if ( IsInSct() ) nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, TRUE ); @@ -2932,9 +2956,12 @@ SwTwips SwFtnBossFrm::GetVarSpace() const } else nRet = 0; - if ( IsPageFrm() && - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( IsPageFrm() ) + { + const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nRet += BROWSE_HEIGHT - Frm().Height(); + } return nRet; } @@ -3181,7 +3208,7 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss ) //Fussnote erzeugen. SwFtnFrm *pOld = FindFtnFrm(); pTmpFtn = new SwFtnFrm( pOld->GetFmt()->GetDoc()->GetDfltFrmFmt(), - pOld->GetRef(), pOld->GetAttr() ); + pOld, pOld->GetRef(), pOld->GetAttr() ); //Verkettung der Fussnoten. if ( pOld->GetFollow() ) { @@ -3315,7 +3342,7 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr() ASSERT( pAttr, "invalid Attribute" ); SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode(); SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() )); - SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, FALSE ); + SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, FALSE ); return pCFrm; } diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 79348f01d1e2..8155c7503cc8 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -35,7 +35,9 @@ #include #include #include +#include "viewopt.hxx" #include "hffrm.hxx" +#include "rootfrm.hxx" #include "txtfrm.hxx" #include "sectfrm.hxx" #include "flyfrm.hxx" @@ -117,8 +119,8 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm, } } -SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, USHORT nTypeIn) - : SwLayoutFrm(pFmt) +SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, USHORT nTypeIn) + : SwLayoutFrm( pFmt, pSib ) { nType = nTypeIn; SetDerivedVert( FALSE ); @@ -710,7 +712,8 @@ void SwPageFrm::PrepareHeader() const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader(); - const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); if ( bOn && rH.IsActive() ) { //Header einsetzen, vorher entfernen falls vorhanden. @@ -727,7 +730,7 @@ void SwPageFrm::PrepareHeader() delete pDel; } ASSERT( pLay, "Wohin mit dem Header?" ); - SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt() ); + SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt(), this ); pH->Paste( this, pLay ); if ( GetUpper() ) ::RegistFlys( this, pH ); @@ -760,7 +763,8 @@ void SwPageFrm::PrepareFooter() while ( pLay->GetNext() ) pLay = (SwLayoutFrm*)pLay->GetNext(); - const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); if ( bOn && rF.IsActive() ) { //Footer einsetzen, vorher entfernen falls vorhanden. @@ -774,7 +778,7 @@ void SwPageFrm::PrepareFooter() pLay->Cut(); delete pLay; } - SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt() ); + SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt(), this ); pF->Paste( this ); if ( GetUpper() ) ::RegistFlys( this, pF ); @@ -782,10 +786,10 @@ void SwPageFrm::PrepareFooter() else if ( pLay && pLay->IsFooterFrm() ) { //Footer entfernen falls vorhanden. ::DelFlys( pLay, this ); - ViewShell *pSh; - if ( pLay->GetPrev() && 0 != (pSh = GetShell()) && - pSh->VisArea().HasArea() ) - pSh->InvalidateWindows( pSh->VisArea() ); + ViewShell *pShell; + if ( pLay->GetPrev() && 0 != (pShell = getRootFrm()->GetCurrShell()) && + pShell->VisArea().HasArea() ) + pShell->InvalidateWindows( pShell->VisArea() ); pLay->Cut(); delete pLay; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 1475a3909220..ded3f568fa04 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -438,7 +438,8 @@ BOOL SwLayAction::RemoveEmptyBrowserPages() //Beim umschalten vom normalen in den Browsermodus bleiben u.U. einige //unangenehm lange stehen. Diese beseiten wir mal schnell. BOOL bRet = FALSE; - if ( pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = pRoot->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) { SwPageFrm *pPage = (SwPageFrm*)pRoot->Lower(); do @@ -1181,7 +1182,8 @@ const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage, BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage ) { BOOL bRet = FALSE; - const BOOL bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = pRoot->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); //Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst //gibts nix als Aerger. @@ -1430,19 +1432,14 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect ) BOOL bNoPaint = FALSE; if ( pLay->IsPageBodyFrm() && pLay->Frm().Pos() == aOldRect.Pos() && - pLay->Lower() && - pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + pLay->Lower() ) { - //HotFix: Vobis Homepage, nicht so genau hinsehen, sonst - //rpaints - + const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); //Einschraenkungen wegen Kopf-/Fusszeilen - if ( !( pLay->IsCompletePaint() && - pLay->FindPageFrm()->FindFtnCont() ) ) - { + if( pSh && pSh->GetViewOptions()->getBrowseMode() && + !( pLay->IsCompletePaint() && pLay->FindPageFrm()->FindFtnCont() ) ) bNoPaint = TRUE; } - } if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) ) { @@ -1482,8 +1479,14 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect ) aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth); } - if ( pLay->IsPageFrm() && - pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + BOOL bPageInBrowseMode = pLay->IsPageFrm(); + if( bPageInBrowseMode ) + { + const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); + if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ) + bPageInBrowseMode = FALSE; + } + if( bPageInBrowseMode ) { // NOTE: no vertical layout in online layout //Ist die Aenderung ueberhaupt sichtbar? @@ -1848,7 +1851,8 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect ) BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage ) { const SwCntntFrm *pCntnt = pPage->ContainsCntnt(); - const BOOL bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = pRoot->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); while ( pCntnt && pPage->IsAnLower( pCntnt ) ) { diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 39b8a60ef695..670d606fbc23 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -55,6 +55,8 @@ #include #include #include +#include "viewopt.hxx" +#include "viewsh.hxx" #include // OD 2004-05-24 #i28701# #include @@ -186,7 +188,7 @@ BOOL SwLayCacheImpl::Read( SvStream& rStream ) void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) { - if( rDoc.GetRootFrm() ) // the layout itself .. + if( rDoc.GetCurrentLayout() ) // the layout itself .. //swmod 080218 { SwLayCacheIoImpl aIo( rStream, TRUE ); // We want to save the relative index, so we need the index @@ -194,7 +196,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent(). StartOfSectionNode()->GetIndex(); // The first page.. - SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower(); + SwPageFrm* pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); //swmod 080218 aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES ); aIo.OpenFlagRec( 0, 0 ); @@ -347,13 +349,16 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) #ifdef DBG_UTIL sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const { + if( !pImpl ) + return sal_True; + const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout(); sal_Bool bRet = sal_True; - if( pImpl && rDoc.GetRootFrm() ) + if( pRootFrm ) { USHORT nIndex = 0; ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent(). StartOfSectionNode()->GetIndex(); - SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower(); + SwPageFrm* pPage = (SwPageFrm*)pRootFrm->Lower(); if( pPage ) pPage = (SwPageFrm*)pPage->GetNext(); while( pPage ) @@ -598,7 +603,10 @@ ULONG SwLayHelper::CalcPageCount() } if ( nNdCount < 1000 ) nPgCount = 0;// no progress bar for small documents - if ( pDoc->get(IDocumentSettingAccess::BROWSE_MODE) ) + ViewShell *pSh = 0; + if( rpLay && rpLay->getRootFrm() ) + pSh = rpLay->getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nMaxParaPerPage *= 6; } } @@ -893,7 +901,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex ) { ASSERT( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" ); pHeadline = - new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ] ); + new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ], pTab ); pHeadline->SetRepeatedHeadline( true ); pHeadline->InsertBefore( pFoll, 0 ); pHeadline->RegistFlys(); @@ -925,7 +933,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex ) else { SwTxtFrm *pNew = new SwTxtFrm( ((SwTxtFrm*)rpFrm)-> - GetTxtNode() ); + GetTxtNode(), rpFrm ); pNew->_SetIsFollow( sal_True ); pNew->ManipOfst( nOfst ); pNew->SetFollow( ((SwTxtFrm*)rpFrm)->GetFollow() ); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 1f9c92220bfa..697f4abfaa96 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -424,7 +424,7 @@ void InitCurrShells( SwRootFrm *pRoot ) SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : SwLayoutFrm( pFmt->GetDoc()->MakeFrmFmt( - XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ) ), + XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ), 0 ), // --> PAGES01 maPagesArea(), mnViewWidth( -1 ), @@ -446,6 +446,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : nType = FRMC_ROOT; bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = TRUE; bCheckSuperfluous = bBrowseWidthValid = FALSE; + setRootFrm( this ); InitCurrShells( this ); @@ -454,14 +455,17 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess(); const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess(); pTimerAccess->StopIdling(); - pLayoutAccess->SetRootFrm( this ); //Fuer das Erzeugen der Flys durch MakeFrms() + pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225 bCallbackActionEnabled = FALSE; //vor Verlassen auf TRUE setzen! SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel(); - if ( pMd ) { - pDrawPage = pMd->GetPage( 0 ); + // Disable "multiple layout" + pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE ); + //pMd->InsertPage( pDrawPage ); + // end of disabling + pDrawPage->SetSize( Frm().SSize() ); } @@ -553,6 +557,7 @@ SwRootFrm::~SwRootFrm() pBlink->FrmDelete( this ); ((SwFrmFmt*)pRegisteredIn)->GetDoc()->DelFrmFmt( (SwFrmFmt*)pRegisteredIn ); delete pDestroy; + pDestroy = 0; //Referenzen entfernen. for ( USHORT i = 0; i < pCurrShells->Count(); ++i ) @@ -585,5 +590,38 @@ void SwRootFrm::RemoveMasterObjs( SdrPage *pPg ) } +void SwRootFrm::AllCheckPageDescs() const +{ + CheckPageDescs( (SwPageFrm*)this->Lower() ); +} +//swmod 080226 +void SwRootFrm::AllInvalidateAutoCompleteWords() const +{ + SwPageFrm *pPage = (SwPageFrm*)this->Lower(); + while ( pPage ) + { + pPage->InvalidateAutoCompleteWords(); + pPage = (SwPageFrm*)pPage->GetNext(); + } +}//swmod 080305 +void SwRootFrm::AllAddPaintRect() const +{ + GetCurrShell()->AddPaintRect( this->Frm() ); +}//swmod 080305 +void SwRootFrm::AllRemoveFtns() +{ + RemoveFtns(); +} +void SwRootFrm::AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const +{ + SwPageFrm *pPage = (SwPageFrm*)this->Lower(); + while ( pPage ) + { + if ( bSmartTags ) + pPage->InvalidateSmartTags(); + pPage->InvalidateSpelling(); + pPage = (SwPageFrm*)pPage->GetNext(); + } //swmod 080218 +} diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 72976a786fa1..188eb9abb5e6 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -46,6 +46,7 @@ #include #include "viewimp.hxx" +#include "viewopt.hxx" #include "pagefrm.hxx" #include "rootfrm.hxx" #include "cntfrm.hxx" @@ -89,8 +90,8 @@ using namespace ::com::sun::star; |* Letzte Aenderung MA 01. Aug. 93 |* |*************************************************************************/ -SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt ): - SwLayoutFrm( pFmt ) +SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt, SwFrm* pSib ): + SwLayoutFrm( pFmt, pSib ) { nType = FRMC_BODY; } @@ -196,8 +197,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * ) |* Letzte Aenderung MA 08. Dec. 97 |* |*************************************************************************/ -SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) : - SwFtnBossFrm( pFmt ), +SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) : + SwFtnBossFrm( pFmt, pSib ), pSortedObjs( 0 ), pDesc( pPgDsc ), nPhyPageNum( 0 ), @@ -221,12 +222,12 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) : bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = TRUE; bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = FALSE; - const bool bBrowseMode = pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + ViewShell *pSh = getRootFrm()->GetCurrShell(); + const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); if ( bBrowseMode ) { Frm().Height( 0 ); - ViewShell *pSh = GetShell(); - long nWidth = pSh ? pSh->VisArea().Width():0; + long nWidth = pSh->VisArea().Width(); if ( !nWidth ) nWidth = 5000L; //aendert sich sowieso Frm().Width ( nWidth ); @@ -241,7 +242,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) : { bEmptyPage = FALSE; Calc(); //Damit die PrtArea stimmt. - SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt() ); + SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt(), this ); pBodyFrm->ChgSize( Prt().SSize() ); pBodyFrm->Paste( this ); pBodyFrm->Calc(); //Damit die Spalten korrekt @@ -291,7 +292,7 @@ SwPageFrm::~SwPageFrm() SwDoc *pDoc = GetFmt()->GetDoc(); if( pDoc && !pDoc->IsInDtor() ) { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( pSh ) { SwViewImp *pImp = pSh->Imp(); @@ -340,16 +341,16 @@ void SwPageFrm::CheckDirection( BOOL bVert ) ((SvxFrameDirectionItem&)GetFmt()->GetFmtAttr( RES_FRAMEDIR )).GetValue(); if( bVert ) { - if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir || - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir ) bVertical = 0; else - bVertical = 1; -/* - if( pDesc && pDesc->GetName().GetChar(0)=='x') - bReverse = 1; + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) + bVertical = 0; else - */ + bVertical = 1; + } bReverse = 0; bInvalidVert = 0; } @@ -465,7 +466,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage ) pFly->AnchorFrm()->RemoveFly( pFly ); } else - pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg ); + pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg, pPg ); pPg->AppendFly( pFly ); ::RegistFlys( pPg, pFly ); } @@ -532,7 +533,7 @@ void SwPageFrm::PreparePage( BOOL bFtn ) |*************************************************************************/ void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( pSh ) pSh->SetFirstVisPageInvalid(); BYTE nInvFlags = 0; @@ -622,7 +623,8 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, case RES_FRM_SIZE: { const SwRect aOldPageFrmRect( Frm() ); - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) { bValidSize = FALSE; // OD 28.10.2002 #97265# - Don't call @@ -650,8 +652,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, static_cast(GetUpper())->CheckViewLayout( 0, 0 ); } //Window aufraeumen. - ViewShell *pSh; - if ( 0 != (pSh = GetShell()) && pSh->GetWin() && aOldPageFrmRect.HasArea() ) + if( pSh && pSh->GetWin() && aOldPageFrmRect.HasArea() ) { // OD 12.02.2003 #i9719#, #105645# - consider border and shadow of // page frame for determine 'old' rectangle - it's used for invalidating. @@ -790,7 +791,8 @@ SwPageDesc *SwPageFrm::FindPageDesc() SwPageDesc *pRet = 0; //5. - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) { SwCntntFrm *pFrm = GetUpper()->ContainsCntnt(); while ( !pFrm->IsInDocBody() ) @@ -847,10 +849,13 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot ) ViewShell *pSh = pRoot->GetCurrShell(); if ( pSh ) { - pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );//Einmal fuer das Drawing. do { - pSh->SizeChgNotify(); //Einmal fuer jede Sicht. + if( pRoot == pSh->GetLayout() ) + { + pSh->SizeChgNotify(); + pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() ); + } pSh = (ViewShell*)pSh->GetNext(); } while ( pSh != pRoot->GetCurrShell() ); } @@ -876,7 +881,7 @@ void SwPageFrm::Cut() // PAGES01 //AdjustRootSize( CHG_CUTPAGE, 0 ); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( !IsEmptyPage() ) { if ( GetNext() ) @@ -982,9 +987,11 @@ void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) InvalidatePos(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); + if ( pSh ) + pSh->SetFirstVisPageInvalid(); // PAGES01 - if ( GetUpper() ) - static_cast(GetUpper())->CheckViewLayout( 0, 0 ); + getRootFrm()->CheckViewLayout( 0, 0 ); } /************************************************************************* @@ -1066,7 +1073,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields ) { ASSERT( pStart, "Keine Startpage." ); - ViewShell *pSh = pStart->GetShell(); + ViewShell *pSh = pStart->getRootFrm()->GetCurrShell(); SwViewImp *pImp = pSh ? pSh->Imp() : 0; if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() ) @@ -1157,7 +1164,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields ) { if ( pPage->GetPrev() ) pDesc = ((SwPageFrm*)pPage->GetPrev())->GetPageDesc(); - SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pDesc); + SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pRoot,pDesc); pTmp->Paste( pRoot, pPage ); pTmp->PreparePage( FALSE ); pPage = pTmp; @@ -1316,7 +1323,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) if( bWishedOdd != bNextOdd ) { pFmt = pDoc->GetEmptyPageFmt(); SwPageDesc *pTmpDesc = pPrevPage->GetPageDesc(); - SwPageFrm *pPage = new SwPageFrm( pFmt, pTmpDesc ); + SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pTmpDesc ); pPage->Paste( pRoot, pSibling ); pPage->PreparePage( bFtn ); //Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten @@ -1336,7 +1343,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) } pFmt = bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt(); ASSERT( pFmt, "Descriptor without format." ); - SwPageFrm *pPage = new SwPageFrm( pFmt, pDesc ); + SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pDesc ); pPage->Paste( pRoot, pSibling ); pPage->PreparePage( bFtn ); //Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten @@ -1359,7 +1366,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) if ( bCheckPages ) { CheckPageDescs( pSibling, FALSE ); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); SwViewImp *pImp = pSh ? pSh->Imp() : 0; if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() ) { @@ -1376,7 +1383,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) //Fuer das Aktualisieren der Seitennummern-Felder gibt nDocPos //die Seitenposition an, _ab_ der invalidiert werden soll. - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( !pSh || !pSh->Imp()->IsUpdateExpFlds() ) { SwDocPosUpdate aMsgHnt( pPrevPage->Frm().Top() ); @@ -1388,12 +1395,13 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) // false = right, true = left sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const { - if (!GetShell() || GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) + ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( !pSh || pSh->GetViewOptions()->getBrowseMode() ) return sw::sidebarwindows::SIDEBAR_NONE; else { - const bool bLTR = GetUpper() ? static_cast(GetUpper())->IsLeftToRightViewLayout() : true; - const bool bBookMode = GetShell()->GetViewOptions()->IsViewLayoutBookMode(); + const bool bLTR = getRootFrm()->IsLeftToRightViewLayout(); + const bool bBookMode = pSh->GetViewOptions()->IsViewLayoutBookMode(); const bool bRightSidebar = bLTR ? (!bBookMode || OnRightPage()) : (bBookMode && !OnRightPage()); return bRightSidebar @@ -1534,7 +1542,7 @@ void SwRootFrm::RemoveSuperfluous() } } while ( pPage ); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( nDocPos != LONG_MAX && (!pSh || !pSh->Imp()->IsUpdateExpFlds()) ) { @@ -1595,7 +1603,7 @@ void SwRootFrm::AssertFlyPages() { //Leerseite einfuegen, die Flys werden aber erst von //der naechsten Seite aufgenommen! - pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), pDesc ); + pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), this, pDesc ); pPage->Paste( this, pSibling ); pPage->PreparePage( FALSE ); bOdd = bOdd ? FALSE : TRUE; @@ -1603,7 +1611,7 @@ void SwRootFrm::AssertFlyPages() } pPage = new SwPageFrm( (bOdd ? pDesc->GetRightFmt() : - pDesc->GetLeftFmt()), pDesc ); + pDesc->GetLeftFmt()), this, pDesc ); pPage->Paste( this, pSibling ); pPage->PreparePage( FALSE ); bOdd = bOdd ? FALSE : TRUE; @@ -1754,8 +1762,8 @@ void SwRootFrm::ImplInvalidateBrowseWidth() |*************************************************************************/ void SwRootFrm::ImplCalcBrowseWidth() { - ASSERT( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), - "CalcBrowseWidth and not in BrowseView" ); + ASSERT( GetCurrShell() && GetCurrShell()->GetViewOptions()->getBrowseMode(), + "CalcBrowseWidth and not in BrowseView" ) //Die (minimale) Breite wird von Rahmen, Tabellen und Zeichenobjekten //bestimmt. Die Breite wird nicht anhand ihrer aktuellen Groessen bestimmt, @@ -1772,7 +1780,7 @@ void SwRootFrm::ImplCalcBrowseWidth() return; bBrowseWidthValid = TRUE; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); nBrowseWidth = pSh ? MINLAY + 2 * pSh->GetOut()-> PixelToLogic( pSh->GetBrowseBorder() ).Width() @@ -2021,7 +2029,8 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset ) if ( pFlyFrm->Lower()->IsNoTxtFrm() ) { SwCntntFrm* pCntntFrm = static_cast(pFlyFrm->Lower()); - ViewShell *pSh = pFlyFrm->Lower()->GetShell(); + SwRootFrm* pRoot = pFlyFrm->Lower()->getRootFrm(); + ViewShell *pSh = pRoot ? pRoot->GetCurrShell() : 0; if ( pSh ) { SwOLENode* pNode = pCntntFrm->GetNode()->GetOLENode(); @@ -2076,7 +2085,7 @@ void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset ) // Don't forget accessibility: if( pFrm->IsAccessibleFrm() ) { - SwRootFrm *pRootFrm = pFrm->FindRootFrm(); + SwRootFrm *pRootFrm = pFrm->getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -2175,7 +2184,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi bool bPageChanged = false; const bool bRTL = !IsLeftToRightViewLayout(); - const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetShell() ); + const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetCurrShell() ); while ( pPageFrm ) { @@ -2415,7 +2424,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi ::AdjustSizeChgNotify( this ); Calc(); - ViewShell* pSh = GetShell(); + ViewShell* pSh = GetCurrShell(); if ( pSh && pSh->GetDoc()->GetDocShell() ) { diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index b838c8163837..0120fb8fb990 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -318,7 +318,7 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd ) pMod = 0; Point aNullPt; - return pMod ? ::GetFrmOfModify( *pMod, nFrmType, &aNullPt, 0, FALSE ) + return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, FALSE ) : 0; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 09fc6b00e03d..2b1a1a5373bb 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -33,9 +33,7 @@ #include -#ifndef _SOUND_HXX //autogen #include -#endif #include #define _SVSTDARR_LONGS #include @@ -49,9 +47,7 @@ // --> collapsing borders FME 2005-05-27 #i29550# #include // <-- -#ifndef _GRAPH_HXX //autogen #include -#endif #include #include @@ -59,9 +55,7 @@ #include #include #include -#ifndef _COMCORE_HRC #include -#endif #include #include #include @@ -3108,14 +3102,14 @@ void SwRootFrm::HackPrepareLongTblPaint( int nMode ) case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" ); pLines = new SwLineRects; ASSERT( !pGlobalShell, "old GlobalShell lost" ); - pGlobalShell = GetShell(); + pGlobalShell = GetCurrShell(); bTableHack = TRUE; break; case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( TRUE ); break; case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() ); break; case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( FALSE ); break; - case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() ); + case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() ); DELETEZ( pLines ); pGlobalShell = 0; bTableHack = FALSE; @@ -3187,7 +3181,7 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect ) void SwLayoutFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); // --> FME 2004-06-24 #i16816# tagged pdf support Frm_Info aFrmInfo( *this ); @@ -3630,8 +3624,8 @@ void SwFlyFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ // for painting the graphic/OLE. Thus, the clip region is // also applied for the PDF export. // if ( !pOut->GetConnectMetaFile() || pOut->GetOutDevType() == OUTDEV_PRINTER ) - ViewShell *pSh = GetShell(); - if ( !pOut->GetConnectMetaFile() || !pSh->GetWin() ) + ViewShell *pSh = getRootFrm()->GetCurrShell(); + if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() ) // <-- { pOut->SetClipRegion( aPoly ); @@ -4291,7 +4285,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft, // OD 29.04.2003 #107169# - paint SwAligned-rectangle { SwRect aPaintRect( aRect ); - ::SwAlignRect( aPaintRect, _rFrm.GetShell() ); + ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() ); // if reveals rectangle with no width, adjust rectangle // to the prior left postion with width of one twip. if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 ) @@ -4331,7 +4325,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft, // OD 29.04.2003 #107169# - paint SwAligned-rectangle { SwRect aPaintRect( aRect ); - ::SwAlignRect( aPaintRect, _rFrm.GetShell() ); + ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() ); // if reveals rectangle with no width, adjust // rectangle to the prior left postion with width of one twip. if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 ) @@ -4395,7 +4389,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop, // OD 29.04.2003 #107169# - paint SwAligned-rectangle { SwRect aPaintRect( aRect ); - ::SwAlignRect( aPaintRect, _rFrm.GetShell() ); + ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() ); // if reveals rectangle with no width, adjust rectangle // to the prior top postion with width of one twip. if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 ) @@ -4434,7 +4428,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop, // OD 29.04.2003 #107169# - paint SwAligned-rectangle { SwRect aPaintRect( aRect ); - ::SwAlignRect( aPaintRect, _rFrm.GetShell() ); + ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() ); // if reveals rectangle with no width, adjust // rectangle to the prior top postion with width of one twip. if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 ) @@ -5252,7 +5246,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect, ViewShell* _pViewShell ) const { if ( _pViewShell->GetWin() && - !_pViewShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + !_pViewShell->GetViewOptions()->getBrowseMode() ) { SwRect aPgPrtRect( Prt() ); aPgPrtRect.Pos() += Frm().Pos(); @@ -5740,7 +5734,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, { if ( bBack || bPageFrm || !bLowerMode ) { - const BOOL bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const BOOL bBrowse = pSh->GetViewOptions()->getBrowseMode(); SwRect aRect; if ( (bPageFrm && bBrowse) || @@ -6393,7 +6387,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const return; ASSERT( GetUpper(), "Retoucheversuch ohne Upper." ); - ASSERT( GetShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" ); + ASSERT( getRootFrm()->GetCurrShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" ); SwRect aRetouche( GetUpper()->PaintArea() ); aRetouche.Top( Frm().Top() + Frm().Height() ); @@ -6405,7 +6399,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const //zum ausstanzen. SwRegionRects aRegion( aRetouche ); aRegion -= rRect; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); // --> FME 2004-06-24 #i16816# tagged pdf support SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() ); @@ -6502,7 +6496,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, BOOL bLowerMode ) const { const SwFrm *pFrm = this; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); const SwViewOption *pOpt = pSh->GetViewOptions(); rpBrush = 0; rpCol = NULL; @@ -6558,7 +6552,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, { rpBrush = &rBack; if ( pFrm->IsPageFrm() && - pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + pSh->GetViewOptions()->getBrowseMode() ) rOrigRect = pFrm->Frm(); else { @@ -6623,7 +6617,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) SwClientIter aIter( *this ); SwClient *pFirst = aIter.First( TYPE(SwFrm) ); ViewShell *pSh; - if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->GetShell()) ) + if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->getRootFrm()->GetCurrShell()) ) { ViewShell *pOldGlobal = pGlobalShell; pGlobalShell = pSh; diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 7a1a51deb8eb..b64ab79a3e37 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -54,6 +54,7 @@ #include "layouter.hxx" // SwLayouter #include "dbg_lay.hxx" #include "viewsh.hxx" +#include "viewopt.hxx" #include "viewimp.hxx" #include #include @@ -74,8 +75,8 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr ) |* Letzte Aenderung AMA 26. Nov. 97 |* |*************************************************************************/ -SwSectionFrm::SwSectionFrm( SwSection &rSect ) : - SwLayoutFrm( rSect.GetFmt() ), +SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) : + SwLayoutFrm( rSect.GetFmt(), pSib ), SwFlowFrm( (SwFrm&)*this ), pSection( &rSect ) { @@ -86,7 +87,7 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect ) : } SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, BOOL bMaster ) : - SwLayoutFrm( rSect.GetFmt() ), + SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ), SwFlowFrm( (SwFrm&)*this ), pSection( rSect.GetSection() ) { @@ -152,9 +153,9 @@ SwSectionFrm::~SwSectionFrm() { if( GetFmt() && !GetFmt()->GetDoc()->IsInDtor() ) { - SwRootFrm *pRootFrm = GetFmt()->GetDoc()->GetRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm ) - pRootFrm->RemoveFromList( this ); + pRootFrm->RemoveFromList( this ); //swmod 071108//swmod 071225 if( IsFollow() ) { SwSectionFrm *pMaster = FindMaster(); @@ -202,7 +203,7 @@ void SwSectionFrm::DelEmpty( BOOL bRemove ) // Relation CONTENT_FLOWS_FROM for current next paragraph will change // and relation CONTENT_FLOWS_TO for current previous paragraph will change. { - ViewShell* pViewShell( GetShell() ); + ViewShell* pViewShell( getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -237,11 +238,11 @@ void SwSectionFrm::DelEmpty( BOOL bRemove ) { // Wenn wir bereits halbtot waren vor diesem DelEmpty, so // stehen wir vermutlich auch in der Liste und muessen uns // dort austragen - if( !pSection ) - GetFmt()->GetDoc()->GetRootFrm()->RemoveFromList( this ); + if( !pSection && getRootFrm() ) + getRootFrm()->RemoveFromList( this ); } - else - GetFmt()->GetDoc()->GetRootFrm()->InsertEmptySct( this ); + else if( getRootFrm() ) + getRootFrm()->InsertEmptySct( this ); //swmod 071108//swmod 071225 pSection = NULL; // damit ist allerdings eine Reanimierung quasi ausgeschlossen } } @@ -398,7 +399,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) } } pParent = pSect; - pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection() ); + pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection(), pParent ); // Wenn pParent in zwei Teile zerlegt wird, so muss sein Follow am // neuen, zweiten Teil angebracht werden. pSect->SetFollow( ((SwSectionFrm*)pParent)->GetFollow() ); @@ -558,7 +559,7 @@ BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres ) ASSERT( pSav, "SplitSect: What's on?" ); if( pSav ) // Robust { // Einen neuen SctFrm anlegen, nicht als Follow/Master - SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection() ); + SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection(), pSect ); pNew->InsertBehind( pSect->GetUpper(), pSect ); pNew->Init(); SWRECTFN( this ) @@ -752,7 +753,7 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave ) // vom gleichen Parent abgeleitet ist. // Dann gibt es (noch) keinen Teil unseres Parents, der den Inhalt // aufnehmen kann,also bauen wir ihn uns. - pPrvSct = new SwSectionFrm( *pParent->GetSection() ); + pPrvSct = new SwSectionFrm( *pParent->GetSection(), pUp ); pPrvSct->InsertBehind( pUp, pPrv ); pPrvSct->Init(); SWRECTFN( pUp ) @@ -786,7 +787,7 @@ void SwSectionFrm::MakeAll() return; if( !pSection ) // Durch DelEmpty { - ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), "SectionFrm without Section" ); + ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" ); if( !bValidPos ) { if( GetUpper() ) @@ -810,7 +811,8 @@ void SwSectionFrm::MakeAll() // OD 2004-03-15 #116561# - In online layout join the follows, if section // can grow. - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() && ( Grow( LONG_MAX, true ) > 0 ) ) { while( GetFollow() ) @@ -1332,8 +1334,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr ) { if( !pSection ) // Durch DelEmpty { - ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), - "SectionFrm without Section" ); + ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" ); bValidSize = bValidPos = bValidPrtArea = TRUE; return; } @@ -1409,7 +1410,8 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr ) // OD 15.10.2002 #103517# - allow grow in online layout // Thus, set <..IsBrowseMode()> as parameter on calling // method <_CheckClipping(..)>. - _CheckClipping( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), bMaximize ); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + _CheckClipping( pSh && pSh->GetViewOptions()->getBrowseMode(), bMaximize ); bMaximize = ToMaximize( FALSE ); bValidSize = TRUE; } @@ -2041,9 +2043,14 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst ) BOOL bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked(); // OD 2004-03-15 #116561# - allow grow in online layout - if ( !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() || - GetSection()->GetFmt()->GetBalancedColumns().GetValue() || - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + BOOL bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() || + GetSection()->GetFmt()->GetBalancedColumns().GetValue(); + if( !bGrow ) + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + bGrow = pSh && pSh->GetViewOptions()->getBrowseMode(); + } + if( bGrow ) { SwTwips nGrow; if( IsInFtn() ) @@ -2561,7 +2568,7 @@ void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, case RES_PROTECT: { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this ); } @@ -2755,7 +2762,7 @@ void SwRootFrm::_DeleteEmptySct() if( pUp && !pUp->Lower() ) { if( pUp->IsPageBodyFrm() ) - pUp->FindRootFrm()->SetSuperfluous(); + pUp->getRootFrm()->SetSuperfluous(); else if( pUp->IsFtnFrm() && !pUp->IsColLocked() && pUp->GetUpper() ) { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 9b3ff15666f9..33e971b63e85 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -372,7 +372,7 @@ SwFrm::~SwFrm() // by the destructors of the derived classes. if( IsAccessibleFrm() && !(IsFlyFrm() || IsCellFrm()) && GetDep() ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() ) { ViewShell *pVSh = pRootFrm->GetCurrShell(); @@ -437,8 +437,8 @@ void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew ) /************************************************************************* |* SwCntntFrm::SwCntntFrm() |*************************************************************************/ -SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt ) : - SwFrm( pCntnt ), +SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) : + SwFrm( pCntnt, pSib ), SwFlowFrm( (SwFrm&)*this ) { } @@ -453,7 +453,7 @@ SwCntntFrm::~SwCntntFrm() !pCNd->GetDoc()->IsInDtor() ) { //Bei der Root abmelden wenn ich dort noch im Turbo stehe. - SwRootFrm *pRoot = FindRootFrm(); + SwRootFrm *pRoot = getRootFrm(); if( pRoot && pRoot->GetTurbo() == this ) { pRoot->DisallowTurbo(); @@ -479,7 +479,7 @@ SwCntntFrm::~SwCntntFrm() pTxtFtn = rFtnIdxs[ nPos ]; if( pTxtFtn->GetTxtNode().GetIndex() > nIndex ) break; - pTxtFtn->DelFrms(); + pTxtFtn->DelFrms( this ); ++nPos; } } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index f912be5cb9b1..9ae9e3178f37 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -40,6 +40,8 @@ #include "frmtool.hxx" #include "frmfmt.hxx" #include "dcontact.hxx" +#include +#include #include "viewopt.hxx" #include "hints.hxx" #include "dbg_lay.hxx" @@ -95,8 +97,8 @@ using namespace ::com::sun::star; |* Letzte Aenderung MA 30. May. 96 |* |*************************************************************************/ -SwTabFrm::SwTabFrm( SwTable &rTab ): - SwLayoutFrm( rTab.GetFrmFmt() ), +SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ): + SwLayoutFrm( rTab.GetFrmFmt(), pSib ), SwFlowFrm( (SwFrm&)*this ), pTable( &rTab ) { @@ -115,7 +117,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ): SwFrm *pTmpPrev = 0; for ( USHORT i = 0; i < rLines.Count(); ++i ) { - SwRowFrm *pNew = new SwRowFrm( *rLines[i] ); + SwRowFrm *pNew = new SwRowFrm( *rLines[i], this ); if( pNew->Lower() ) { pNew->InsertBehind( this, pTmpPrev ); @@ -128,7 +130,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ): } SwTabFrm::SwTabFrm( SwTabFrm &rTab ) : - SwLayoutFrm( rTab.GetFmt() ), + SwLayoutFrm( rTab.GetFmt(), &rTab ), SwFlowFrm( (SwFrm&)*this ), pTable( rTab.GetTable() ) { @@ -274,7 +276,7 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo const SwRowFrm& rRow = (SwRowFrm&)rTmpRow; rTab.SetFollowFlowLine( TRUE ); - SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), false ); + SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false ); pFollowFlowLine->SetRowSpanLine( bRowSpanLine ); SwFrm* pFirstRow = rTab.GetFollow()->GetFirstNonHeadlineRow(); pFollowFlowLine->InsertBefore( rTab.GetFollow(), pFirstRow ); @@ -605,7 +607,7 @@ void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine, !bTableLayoutToComplex && nMinHeight < nTmpCut ) ) { // The line has to be split: - SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), false ); + SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), &rTab, false ); pNewRow->SetFollowFlowRow( true ); pNewRow->SetFollowRow( pTmpLastLineRow->GetFollowRow() ); pTmpLastLineRow->SetFollowRow( pNewRow ); @@ -1277,7 +1279,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee // Insert new headlines: bDontCreateObjects = TRUE; //frmtool SwRowFrm* pHeadline = new SwRowFrm( - *GetTable()->GetTabLines()[ nRowCount ] ); + *GetTable()->GetTabLines()[ nRowCount ], this ); pHeadline->SetRepeatedHeadline( true ); bDontCreateObjects = FALSE; pHeadline->InsertBefore( pFoll, 0 ); @@ -1731,7 +1733,8 @@ void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab ) } SwFrm *pUp = pTab->GetUpper(); long nBottom = (pUp->*fnRect->fnGetPrtBottom)(); - if ( pTab->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = pTab->getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nBottom += pUp->Grow( LONG_MAX, TRUE ); lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), pTab, LONG_MAX, false ); } @@ -2363,7 +2366,8 @@ void SwTabFrm::MakeAll() /// OD 23.10.2002 #103517# - In online layout try to grow upper of table /// frame, if table frame doesn't fit in its upper. - const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); if ( nDistanceToUpperPrtBottom < 0 && bBrowseMode ) { if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) ) @@ -3284,11 +3288,11 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) else (this->*fnRect->fnSetXMargins)( nLeftSpacing, nRightSpacing ); - ViewShell *pSh; + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( bCheckBrowseWidth && - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + pSh && pSh->GetViewOptions()->getBrowseMode() && GetUpper()->IsPageBodyFrm() && // nur PageBodyFrms, nicht etwa ColBodyFrms - 0 != (pSh = GetShell()) && pSh->VisArea().Width() ) + pSh->VisArea().Width() ) { //Nicht ueber die Kante des sichbaren Bereiches hinausragen. //Die Seite kann breiter sein, weil es Objekte mit "ueberbreite" @@ -3373,7 +3377,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) { (Frm().*fnRect->fnAddBottom)( nDist ); - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -3509,7 +3513,7 @@ void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, for ( USHORT nIdx = 0; nIdx < nNewRepeat; ++nIdx ) { bDontCreateObjects = TRUE; //frmtool - SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ] ); + SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this ); pHeadline->SetRepeatedHeadline( true ); bDontCreateObjects = FALSE; pHeadline->Paste( this, pLowerRow ); @@ -3781,7 +3785,8 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat ) nSpace = nTmpSpace; // <-- - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nSpace += pNewUpper->Grow( LONG_MAX, TRUE ); } } @@ -4009,8 +4014,8 @@ void SwTabFrm::Prepare( const PrepareHint eHint, const void *, BOOL ) |* Letzte Aenderung MA 30. May. 96 |* |*************************************************************************/ -SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ): - SwLayoutFrm( rLine.GetFrmFmt() ), +SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent ): + SwLayoutFrm( rLine.GetFrmFmt(), pSib ), pTabLine( &rLine ), pFollowRow( 0 ), // --> collapsing borders FME 2005-05-27 #i29550# @@ -4031,7 +4036,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ): SwFrm *pTmpPrev = 0; for ( USHORT i = 0; i < rBoxes.Count(); ++i ) { - SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], bInsertContent ); + SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent ); pNew->InsertBehind( this, pTmpPrev ); pTmpPrev = pNew; } @@ -4667,7 +4672,7 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const BOOL bHeight ) SwFrm *pFrm = Lower(); if ( bHeight ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); SWRECTFN( this ) SwRect aOldFrm; @@ -4777,7 +4782,7 @@ void SwRowFrm::Cut() // --> OD 2010-02-17 #i103961# // notification for accessibility { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() ) { ViewShell* pVSh = pRootFrm->GetCurrShell(); @@ -5027,8 +5032,8 @@ bool SwRowFrm::ShouldRowKeepWithNext() const |* Letzte Aenderung MA 30. May. 96 |* |*************************************************************************/ -SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) : - SwLayoutFrm( rBox.GetFrmFmt() ), +SwCellFrm::SwCellFrm( const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent ) : + SwLayoutFrm( rBox.GetFrmFmt(), pSib ), pTabBox( &rBox ) { nType = FRMC_CELL; @@ -5050,7 +5055,7 @@ SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) : SwFrm *pTmpPrev = 0; for ( USHORT i = 0; i < rLines.Count(); ++i ) { - SwRowFrm *pNew = new SwRowFrm( *rLines[i], bInsertContent ); + SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent ); pNew->InsertBehind( this, pTmpPrev ); pTmpPrev = pNew; } @@ -5064,7 +5069,7 @@ SwCellFrm::~SwCellFrm() { // At this stage the lower frames aren't destroyed already, // therfor we have to do a recursive dispose. - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -5621,7 +5626,7 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, FALSE ) ) || RES_PROTECT == pNew->Which() ) { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( pSh && pSh->GetLayout()->IsAnyShellAccessible() ) pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this ); } @@ -5681,7 +5686,7 @@ void SwCellFrm::Cut() { // notification for accessibility { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() ) { ViewShell* pVSh = pRootFrm->GetCurrShell(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 018e48440b59..034387978ed7 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -893,7 +893,7 @@ USHORT SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const { ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" ); const SwFrm *pActFrm = GetFmt()->GetDoc()->GetNodes()[pActualCrsr->GetPoint()->nNode]-> - GetCntntNode()->GetFrm( 0, + GetCntntNode()->getLayoutFrm( this, 0, pActualCrsr->GetPoint(), FALSE ); return pActFrm->FindPageFrm()->GetPhyPageNum(); @@ -1878,8 +1878,8 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode(); const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(FALSE); - const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->GetFrm( &aPtPt, 0, FALSE ) : 0; - const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->GetFrm( &aMkPt, 0, FALSE ) : 0; + const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, FALSE ) : 0; + const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, FALSE ) : 0; const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0; const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0; @@ -2016,7 +2016,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode ) *pEndPos = rCrsr.GetPoint() == pStartPos ? rCrsr.GetMark() : rCrsr.GetPoint(); - ViewShell *pSh = GetShell(); + ViewShell *pSh = GetCurrShell(); // --> FME 2004-06-08 #i12836# enhanced pdf SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ? @@ -2024,10 +2024,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode ) Frm() ); // <-- if( !pStartPos->nNode.GetNode().IsCntntNode() || - !pStartPos->nNode.GetNode().GetCntntNode()->GetFrm() || + !pStartPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) || ( pStartPos->nNode != pEndPos->nNode && ( !pEndPos->nNode.GetNode().IsCntntNode() || - !pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) ) + !pEndPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ) ) ) { /* For SelectAll we will need something like this later on... const SwFrm* pPageFrm = GetLower(); @@ -2048,10 +2048,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode ) //Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf //jedenfall. const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]-> - GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos ); + GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos ); const SwCntntFrm *pEndFrm = rNds[ pEndPos->nNode ]-> - GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos ); + GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos ); ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." ); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index ade3efd4e70d..5a8c8b00d7c9 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -43,8 +43,11 @@ #include #include #include +#include +#include #include #include +#include "viewopt.hxx" #include #include #include @@ -87,11 +90,12 @@ using namespace ::com::sun::star; |* |*************************************************************************/ -SwFrm::SwFrm( SwModify *pMod ) : +SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) : SwClient( pMod ), // --> OD 2006-05-10 #i65250# mnFrmId( SwFrm::mnLastFrmId++ ), // <-- + mpRoot( pSib ? pSib->getRootFrm() : 0 ), pUpper( 0 ), pNext( 0 ), pPrev( 0 ), @@ -114,16 +118,6 @@ SwFrm::SwFrm( SwModify *pMod ) : bCompletePaint = bInfInvalid = TRUE; } - -ViewShell * SwFrm::GetShell() const -{ - const SwRootFrm *pRoot; - if ( 0 != (pRoot = FindRootFrm()) ) - return pRoot->GetCurrShell(); - return 0; -} - - void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse ) { if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) ) @@ -173,9 +167,12 @@ void SwSectionFrm::CheckDirection( BOOL bVert ) { const SwFrmFmt* pFmt = GetFmt(); if( pFmt ) + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), - bVert, sal_True, - pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ); + bVert, sal_True, bBrowseMode ); + } else SwFrm::CheckDirection( bVert ); } @@ -184,9 +181,12 @@ void SwFlyFrm::CheckDirection( BOOL bVert ) { const SwFrmFmt* pFmt = GetFmt(); if( pFmt ) + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), - bVert, sal_False, - pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ); + bVert, sal_False, bBrowseMode ); + } else SwFrm::CheckDirection( bVert ); } @@ -195,9 +195,12 @@ void SwTabFrm::CheckDirection( BOOL bVert ) { const SwFrmFmt* pFmt = GetFmt(); if( pFmt ) + { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), - bVert, sal_True, - pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ); + bVert, sal_True, bBrowseMode ); + } else SwFrm::CheckDirection( bVert ); } @@ -213,8 +216,9 @@ void SwCellFrm::CheckDirection( BOOL bVert ) if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, TRUE, &pItem ) ) { const SvxFrameDirectionItem* pFrmDirItem = static_cast(pItem); - CheckDir( pFrmDirItem->GetValue(), bVert, sal_False, - pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + CheckDir( pFrmDirItem->GetValue(), bVert, sal_False, bBrowseMode ); } else SwFrm::CheckDirection( bVert ); @@ -222,9 +226,10 @@ void SwCellFrm::CheckDirection( BOOL bVert ) void SwTxtFrm::CheckDirection( BOOL bVert ) { + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir( GetTxtNode()->GetSwAttrSet().GetFrmDir().GetValue(), bVert, - sal_True, - GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ); + sal_True, bBrowseMode ); } /************************************************************************* @@ -983,7 +988,7 @@ void SwCntntFrm::Cut() //er die Retouche uebernehmen. //Ausserdem kann eine Leerseite entstanden sein. else - { SwRootFrm *pRoot = FindRootFrm(); + { SwRootFrm *pRoot = getRootFrm(); if ( pRoot ) { pRoot->SetSuperfluous(); @@ -1392,7 +1397,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) if ( !nDiff || !GetUpper()->IsFtnBossFrm() ) // nur innerhalb von Seiten/Spalten return 0L; - BOOL bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); //Der (Page)Body veraendert sich nur im BrowseMode, aber nicht wenn er //Spalten enthaelt. @@ -1406,16 +1412,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) long nBrowseAdd = 0; if ( bBrowse && GetUpper()->IsPageFrm() ) // nur (Page)BodyFrms { - ViewShell *pSh = GetShell(); + ViewShell *pViewShell = getRootFrm()->GetCurrShell(); SwLayoutFrm *pUp = GetUpper(); long nChg; const long nUpPrtBottom = pUp->Frm().Height() - pUp->Prt().Height() - pUp->Prt().Top(); SwRect aInva( pUp->Frm() ); - if ( pSh ) + if ( pViewShell ) { - aInva.Pos().X() = pSh->VisArea().Left(); - aInva.Width( pSh->VisArea().Width() ); + aInva.Pos().X() = pViewShell->VisArea().Left(); + aInva.Width( pViewShell->VisArea().Width() ); } if ( nDiff > 0 ) { @@ -1425,7 +1431,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) if ( !IsBodyFrm() ) { SetCompletePaint(); - if ( !pSh || pSh->VisArea().Height() >= pUp->Frm().Height() ) + if ( !pViewShell || pViewShell->VisArea().Height() >= pUp->Frm().Height() ) { //Ersteinmal den Body verkleinern. Der waechst dann schon //wieder. @@ -1455,12 +1461,12 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) //mindestens so gross wie die VisArea. nChg = nDiff; long nInvaAdd = 0; - if ( pSh && !pUp->GetPrev() && - pUp->Frm().Height() + nDiff < pSh->VisArea().Height() ) + if ( pViewShell && !pUp->GetPrev() && + pUp->Frm().Height() + nDiff < pViewShell->VisArea().Height() ) { //Das heisst aber wiederum trotzdem, das wir geeignet invalidieren //muessen. - nChg = pSh->VisArea().Height() - pUp->Frm().Height(); + nChg = pViewShell->VisArea().Height() - pUp->Frm().Height(); nInvaAdd = -(nDiff - nChg); } @@ -1483,16 +1489,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) if ( !bTst ) { //Unabhaengig von nChg - if ( pSh && aInva.HasArea() && pUp->GetUpper() ) - pSh->InvalidateWindows( aInva ); + if ( pViewShell && aInva.HasArea() && pUp->GetUpper() ) + pViewShell->InvalidateWindows( aInva ); } if ( !bTst && nChg ) { const SwRect aOldRect( pUp->Frm() ); pUp->Frm().SSize().Height() += nChg; pUp->Prt().SSize().Height() += nChg; - if ( pSh ) - pSh->Imp()->SetFirstVisPageInvalid(); + if ( pViewShell ) + pViewShell->Imp()->SetFirstVisPageInvalid(); if ( GetNext() ) GetNext()->_InvalidatePos(); @@ -1500,7 +1506,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst ) //Ggf. noch ein Repaint ausloesen. const SvxGraphicPosition ePos = pUp->GetFmt()->GetBackground().GetGraphicPos(); if ( ePos != GPOS_NONE && ePos != GPOS_TILED ) - pSh->InvalidateWindows( pUp->Frm() ); + pViewShell->InvalidateWindows( pUp->Frm() ); if ( pUp->GetUpper() ) { @@ -1889,7 +1895,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) nDist > (LONG_MAX - nFrmHeight ) ) nDist = LONG_MAX - nFrmHeight; - const BOOL bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body if( !(GetUpper()->GetType() & nTmpType) && GetUpper()->HasFixSize() ) { @@ -2347,8 +2354,8 @@ void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew, |* Letzte Aenderung MA 12. May. 95 |* |*************************************************************************/ -SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt ): - SwFrm( pFmt ), +SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ): + SwFrm( pFmt, pSib ), pLower( 0 ) { const SwFmtFrmSize &rFmtSize = pFmt->GetFrmSize(); @@ -2411,7 +2418,8 @@ SwTwips SwLayoutFrm::InnerHeight() const |*************************************************************************/ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) { - const BOOL bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body if( !(GetType() & nTmpType) && HasFixSize() ) return 0; @@ -2557,7 +2565,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) if( bMoveAccFrm && IsAccessibleFrm() ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -2577,7 +2585,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) |*************************************************************************/ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) { - const BOOL bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body if( !(GetType() & nTmpType) && HasFixSize() ) return 0; @@ -2675,7 +2684,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) if( bMoveAccFrm && IsAccessibleFrm() ) { - SwRootFrm *pRootFrm = FindRootFrm(); + SwRootFrm *pRootFrm = getRootFrm(); if( pRootFrm && pRootFrm->IsAnyShellAccessible() && pRootFrm->GetCurrShell() ) { @@ -3330,10 +3339,9 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, BOOL ) const { const SwFrm *pRel = GetUpper(); long nRel = LONG_MAX; - const ViewShell *pSh = GetShell(); - if ( pRel->IsPageBodyFrm() && - GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - pSh && pSh->VisArea().Width()) + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + if( pRel->IsPageBodyFrm() && pSh && bBrowseMode && pSh->VisArea().Width() ) { nRel = pSh->GetBrowseWidth(); long nDiff = nRel - pRel->Prt().Width(); @@ -3434,7 +3442,9 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, BOOL bEnd = FALSE; BOOL bBackLock = FALSE; - SwViewImp *pImp = GetShell() ? GetShell()->Imp() : 0; + ViewShell *pSh = getRootFrm()->GetCurrShell(); + + SwViewImp *pImp = pSh ? pSh->Imp() : 0; { // Zugrunde liegender Algorithmus // Es wird versucht, eine optimale Hoehe fuer die Spalten zu finden. @@ -3949,7 +3959,7 @@ void SwRootFrm::InvalidateAllCntnt( BYTE nInv ) if( nInv & INV_PRTAREA ) { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( pSh ) pSh->InvalidateWindows( Frm() ); } diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index 5f5e0155e77c..afd1374126cc 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -36,6 +36,9 @@ // --> OD 2004-10-15 #i26945# #include // <-- +#include "rootfrm.hxx" +#include "viewopt.hxx" +#include "viewsh.hxx" #include #include #include @@ -159,10 +162,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition() // declare and set to true, if document is in browser mode and // object is anchored at the body, but not at frame belonging to a table. - const bool bBrowse = GetAnchorFrm().IsInDocBody() && - !GetAnchorFrm().IsInTab() - ? rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) - : false; + bool bBrowse = GetAnchorFrm().IsInDocBody() && !GetAnchorFrm().IsInTab(); + if( bBrowse ) + { + const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell(); + if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ) + bBrowse = false; + } // determine left/right and its upper/lower spacing. const SvxLRSpaceItem &rLR = rFrmFmt.GetLRSpace(); diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index 729a1eabaded..243e9b3804bb 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -31,15 +31,16 @@ #include #include #include -#ifndef _SVX_SVDOBJ_HXX #include -#endif #include #include #include #include #include #include +#include "viewsh.hxx" +#include "viewopt.hxx" +#include "rootfrm.hxx" #include #include @@ -131,8 +132,9 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() // if in online-layout the bottom of to-page anchored object is beyond // the page bottom, the page frame has to grow by growing its body frame. + const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell(); if ( !bFlyAtFly && GetAnchorFrm().IsPageFrm() && - rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + pSh && pSh->GetViewOptions()->getBrowseMode() ) { const long nAnchorBottom = GetAnchorFrm().Frm().Bottom(); const long nBottom = GetAnchorFrm().Frm().Top() + diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 881402efbfb2..eb95c281ffd1 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -795,7 +795,7 @@ uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() { //Das Teil konnte nicht geladen werden (wahrsch. Kaputt). Rectangle aArea; - SwFrm *pFrm = pOLENd->GetFrm(); + SwFrm *pFrm = pOLENd->getLayoutFrm(0); if ( pFrm ) { Size aSz( pFrm->Frm().SSize() ); diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index de76b856cda7..2f7d65cf1e1d 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -1406,7 +1406,7 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt, _FndBox aFndBox( 0, 0 ); aFndBox.SetTableLines( rBoxes, *this ); - if( bSameHeight && pDoc->GetRootFrm() ) + if( bSameHeight && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { SwSplitLines aRowLines; SwSplitLines aSplitLines; diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx index 717bf0170179..5430528956eb 100644 --- a/sw/source/core/text/blink.cxx +++ b/sw/source/core/text/blink.cxx @@ -149,7 +149,7 @@ void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor, else { pBlinkPor->SetPos( rPoint ); - pBlinkPor->SetRootFrm( pTxtFrm->FindRootFrm() ); + pBlinkPor->SetRootFrm( pTxtFrm->getRootFrm() ); aList.Insert( pBlinkPor ); pTxtFrm->SetBlinkPor(); if( pPor->IsLayPortion() || pPor->IsParaPortion() ) diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 8f9d3fc77337..d900e606fa82 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -34,6 +34,7 @@ #include "frmtool.hxx" #include "viewopt.hxx" #include "paratr.hxx" +#include "rootfrm.hxx" #include "pagefrm.hxx" #include "colfrm.hxx" #include "txttypes.hxx" @@ -131,7 +132,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew ) !pFly->GetNextLink() && !pFly->GetPrevLink() ) || ( !pFly && pFrm->IsInTab() ) ) { - ViewShell* pVsh = pFrm->GetShell(); + ViewShell* pVsh = pFrm->getRootFrm()->GetCurrShell(); if( pVsh ) { if( pVsh->GetNext() != pVsh || @@ -145,7 +146,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew ) pFrm->SetPara( 0 ); pFrm->GetFormatted(); if( pFrm->Frm().HasArea() ) - pFrm->GetShell()->InvalidateWindows( pFrm->Frm() ); + pFrm->getRootFrm()->GetCurrShell()->InvalidateWindows( pFrm->Frm() ); return sal_True; } } @@ -923,7 +924,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset, xub_StrLen nOffs = GetOfst(); if( pTmpPrev ) { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); sal_Bool bProtectedAllowed = pSh && pSh->GetViewOptions()->IsCursorInProtectedArea(); const SwTxtFrm *pPrevPrev = pTmpPrev; // Hier werden geschuetzte Frames und Frame ohne Inhalt ausgelassen @@ -1276,7 +1277,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, if( 0 != ( pTmpFollow = GetFollow() ) ) { // geschuetzte Follows auslassen const SwCntntFrm* pTmp = pTmpFollow; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( !pSh || !pSh->GetViewOptions()->IsCursorInProtectedArea() ) { while( pTmpFollow && pTmpFollow->IsProtected() ) @@ -1436,7 +1437,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const pColl = &pColl->GetNextTxtFmtColl(); SwAttrSet aSet( ((SwDoc*)GetTxtNode()->GetDoc())->GetAttrPool(), aTxtFmtCollSetRange ); const SwAttrSet* pSet = &pColl->GetAttrSet(); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( GetTxtNode()->HasSwAttrSet() ) { aSet.Put( *GetTxtNode()->GetpSwAttrSet() ); @@ -1451,8 +1452,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const pFnt->ChkMagic( pSh, pFnt->GetActual() ); } OutputDevice* pOut = pSh->GetOut(); - if ( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || - ( pSh->GetViewOptions()->IsPrtFormat() ) ) + if( !pSh->GetViewOptions()->getBrowseMode() || pSh->GetViewOptions()->IsPrtFormat() ) pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true ); pFnt->SetFntChg( sal_True ); diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index be9c84cc88af..2de1c0d3b0b7 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -681,7 +681,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm() // and relation CONTENT_FLOWS_TO for current previous paragraph, which // is , will change. { - ViewShell* pViewShell( pFoll->GetShell() ); + ViewShell* pViewShell( pFoll->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -708,7 +708,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos ) // Durch das Paste wird ein Modify() an mich verschickt. // Damit meine Daten nicht verschwinden, locke ich mich. SwTxtFrmLocker aLock( this ); - SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm()); + SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm( this )); pNew->bIsFollow = sal_True; pNew->SetFollow( GetFollow() ); @@ -721,7 +721,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos ) // and relation CONTENT_FLOWS_TO for current previous paragraph, which // is , will change. { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1297,7 +1297,7 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev ) } SwTwips nRght = Max( nOldWidth, pNew->Width() + pNew->GetHangingMargin() ); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); const SwViewOption *pOpt = pSh ? pSh->GetViewOptions() : 0; if( pOpt && (pOpt->IsParagraph() || pOpt->IsLineBreak()) ) nRght += ( Max( nOldAscent, pNew->GetAscent() ) ); diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 443900e1942c..bdee0bb911c5 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -38,13 +38,10 @@ #include #include -#ifndef _FMTLINE_HXX #include -#endif -#ifndef _LINEINFO_HXX #include -#endif #include +#include "rootfrm.hxx" #include #include // ViewShell #include // SwViewImp @@ -324,7 +321,7 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const { if( IsLocked() || IsHiddenNow() || !Prt().Height() ) return; - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); SWAP_IF_NOT_SWAPPED( this ) SwRect rOldRect( rRect ); @@ -478,7 +475,7 @@ SwRect SwTxtFrm::Paint() sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if( pSh && ( pSh->GetViewOptions()->IsParagraph() || bInitFont ) ) { bInitFont = sal_False; @@ -601,7 +598,7 @@ void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) ResetRepaint(); // --> FME 2004-06-24 #i16816# tagged pdf support - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); Num_Info aNumInfo( *this ); SwTaggedPDFHelper aTaggedPDFHelperNumbering( &aNumInfo, 0, 0, *pSh->GetOut() ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index ffcf4b53afbd..6fe26a2ede13 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -299,7 +299,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, pFrm = pFrame; CtorInitTxtInfo( pFrm ); const SwTxtNode *pNd = pFrm->GetTxtNode(); - pVsh = pFrm->GetShell(); + pVsh = pFrm->getRootFrm()->GetCurrShell(); // Get the output and reference device if ( pVsh ) @@ -311,7 +311,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, else { //Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein. - if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) ) { //in Ermangelung eines Besseren kann hier ja wohl nur noch das //AppWin genommen werden? @@ -661,7 +661,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo if( GetFont()->IsBlink() && OnWin() && rPor.Width() ) { // check if accessibility options allow blinking portions: - const ViewShell* pSh = GetTxtFrm()->GetShell(); + const ViewShell* pSh = GetTxtFrm()->getRootFrm()->GetCurrShell(); if ( pSh && ! pSh->GetAccessibilityOptions()->IsStopAnimatedText() && ! pSh->IsPreView() ) { @@ -710,7 +710,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo const sal_Bool bTmpSmart = bSmartTag && OnWin() && !GetOpt().IsPagePreview() && SwSmartTagMgr::Get().IsSmartTagsEnabled(); // SMARTTAGS ASSERT( GetParaPortion(), "No paragraph!"); - SwDrawTextInfo aDrawInf( pFrm->GetShell(), *pOut, pSI, rText, nStart, nLength, + SwDrawTextInfo aDrawInf( pFrm->getRootFrm()->GetCurrShell(), *pOut, pSI, rText, nStart, nLength, rPor.Width(), bBullet ); aDrawInf.SetLeft( GetPaintRect().Left() ); diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 60b476839705..0e851fdbb448 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,6 +62,7 @@ #include #include #include +#include using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; @@ -429,15 +430,14 @@ sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubString &rT return bRet; } -sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const +sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const//swmodtest 080307 { SwScriptInfo aScriptInfo; SwAttrIter aIter( *(SwTxtNode*)this, aScriptInfo ); aIter.Seek( nBegin ); - const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm(); - return aIter.GetFnt()->IsSymbol( pTmpRootFrm ? - pTmpRootFrm->GetCurrShell() : - 0 ); + //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout(); + return aIter.GetFnt()->IsSymbol( + const_cast(getIDocumentLayoutAccess()->GetCurrentViewShell()) );//swmod 080311 } class SwMinMaxNodeArgs @@ -590,7 +590,7 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs ) // changing this method very likely requires changing of // "GetScalingOfSelectedText" void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, - ULONG& rAbsMin, OutputDevice* pOut ) const + ULONG& rAbsMin, OutputDevice* pOut ) const//swmodtest 080307 { ViewShell* pSh = 0; GetDoc()->GetEditShell( &pSh ); @@ -702,10 +702,9 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, case CHAR_HARDHYPHEN: { XubString sTmp( cChar ); - const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm(); - SwDrawTextInfo aDrawInf( pTmpRootFrm ? - pTmpRootFrm->GetCurrShell() : - 0, *pOut, 0, sTmp, 0, 1, 0, sal_False ); + //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout(); + SwDrawTextInfo aDrawInf( const_cast(getIDocumentLayoutAccess()->GetCurrentViewShell()), + *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311 nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); aArg.nWordWidth += nAktWidth; aArg.nRowWidth += nAktWidth; @@ -839,7 +838,7 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) else { //Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein. - if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) ) pOut = GetpApp()->GetDefaultDevice(); else pOut = getIDocumentDeviceAccess()->getReferenceDevice( true ); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 1a05aa38098a..b487df43e44c 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -31,20 +31,11 @@ #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif - -#ifndef _GRAPH_HXX //autogen #include -#endif #include -#ifndef _METRIC_HXX //autogen #include -#endif -#ifndef _OUTDEV_HXX //autogen #include -#endif #include // SwViewOptions #include #include @@ -54,10 +45,9 @@ #include // pBlink #include // DrawGraphic #include -#ifndef _DOCSH_HXX #include -#endif #include +#include "rootfrm.hxx" #include #include #include // SwFtnPortion @@ -1014,7 +1004,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const pViewShell && pViewShell->GetWin() ) { ( (Graphic*) pBrush->GetGraphic() )->StopAnimation(0,nId); - rInf.GetTxtFrm()->GetShell()->InvalidateWindows( aTmp ); + rInf.GetTxtFrm()->getRootFrm()->GetCurrShell()->InvalidateWindows( aTmp ); } @@ -1248,7 +1238,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf ) } USHORT nTop = ( nCount + 1 ) / 2; // the first character of the second line - ViewShell *pSh = rInf.GetTxtFrm()->GetShell(); + ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell(); SwFont aTmpFont( *rInf.GetFont() ); SwFontSave aFontSave( rInf, &aTmpFont ); nProportion = 55; diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 0cad374e97e2..cc4f060d5f86 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -33,6 +33,7 @@ #include "dflyobj.hxx" // SwVirtFlyDrawObj #include "pam.hxx" // SwPosition #include "flyfrm.hxx" // SwFlyInCntFrm +#include "rootfrm.hxx" #include "frmfmt.hxx" // SwFrmFmt #include "viewsh.hxx" @@ -254,7 +255,7 @@ void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const if( (GetFlyFrm()->IsCompletePaint() || GetFlyFrm()->Frm().IsOver( aRepaintRect )) && SwFlyFrm::IsPaint( (SdrObject*)GetFlyFrm()->GetVirtDrawObj(), - GetFlyFrm()->GetShell() )) + GetFlyFrm()->getRootFrm()->GetCurrShell() )) { SwRect aRect( GetFlyFrm()->Frm() ); if( !GetFlyFrm()->IsCompletePaint() ) diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 3bc8e566b335..2e51fa45411b 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -53,6 +53,7 @@ #include // SwRedlineItr #include // SwFlyPortion #include +#include "rootfrm.hxx" #include #include @@ -233,7 +234,7 @@ SwTwips SwTxtFrm::EmptyHeight() const SwFont *pFnt; const SwTxtNode& rTxtNode = *GetTxtNode(); const IDocumentSettingAccess* pIDSA = rTxtNode.getIDocumentSettingAccess(); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( rTxtNode.HasSwAttrSet() ) { const SwAttrSet *pAttrSet = &( rTxtNode.GetSwAttrSet() ); @@ -250,8 +251,8 @@ SwTwips SwTxtFrm::EmptyHeight() const pFnt->SetVertical( 2700 ); OutputDevice* pOut = pSh ? pSh->GetOut() : 0; - if ( !pOut || !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) || - ( pSh->GetViewOptions()->IsPrtFormat() ) ) + if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() || + pSh->GetViewOptions()->IsPrtFormat() ) { pOut = rTxtNode.getIDocumentDeviceAccess()->getReferenceDevice(true); } @@ -393,13 +394,13 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff ) } else { - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); SwFontAccess aFontAccess( pFmt, pSh ); SwFont aFnt( *aFontAccess.Get()->GetFont() ); OutputDevice *pOut = 0; - if( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || - (pSh && pSh->GetViewOptions()->IsPrtFormat()) ) + if( !pSh || !pSh->GetViewOptions()->getBrowseMode() || + pSh->GetViewOptions()->IsPrtFormat() ) pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true ); if( pSh && !pOut ) diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index d789121de4b8..71db30b53b60 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -64,8 +64,8 @@ using namespace ::com::sun::star; void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm ) { // Beim HTML-Import kann es vorkommen, dass kein Layout existiert. - SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetRootFrm(); - pShell = pRootFrm ? pRootFrm->GetShell() : 0; + SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetCurrentLayout(); + pShell = pRootFrm ? pRootFrm->GetCurrShell() : 0; //swmod 080218 pScriptInfo = &rScrInf; diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 526dbe74c4d9..adebb58a24e6 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -146,7 +146,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, case RES_PAGENUMBERFLD: { - if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() ) + if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFlds() )//swmod 080122 { SwPageNumberFieldType *pPageNr = (SwPageNumberFieldType *)pFld->GetTyp(); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index db245de1e28b..9108ef01d92a 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -83,6 +83,7 @@ #ifdef DBG_UTIL #include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2) +#include "doc.hxx" #endif #ifdef VERT_DISTANCE @@ -962,7 +963,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf ) if ( bOn && nCount > 0 ) // <-- { - MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId(); + MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId(); for( MSHORT i = 0; i < nCount; ++i ) { // --> OD 2006-08-15 #i68520# @@ -1067,7 +1068,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect, if ( bOn && nCount > 0 ) // <-- { - MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId(); + MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId(); for( MSHORT i = 0; i < nCount; ++i ) { // --> OD 2006-08-15 #i68520# @@ -1106,7 +1107,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect, SwRect aFly( pAnchoredObjTmp->GetObjRect() ); // <-- // OD 24.01.2003 #106593# - ::SwAlignRect( aFly, pPage->GetShell() ); + ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() ); if( aFly.Width() > 0 && aFly.Height() > 0 ) aRegion -= aFly; } @@ -1804,11 +1805,11 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, delete pPolyPolygon; // UPPER_LOWER_TEST #ifdef DBG_UTIL - const SwRootFrm* pTmpRootFrm = pFmt->getIDocumentLayoutAccess()->GetRootFrm(); - if( pTmpRootFrm->GetCurrShell() ) + const ViewShell* pTmpViewShell = pFmt->GetDoc()->GetCurrentViewShell(); + if( pTmpViewShell ) { - sal_Bool bT2 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest2(); - sal_Bool bT6 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest6(); + sal_Bool bT2 = pTmpViewShell->GetViewOptions()->IsTest2(); + sal_Bool bT6 = pTmpViewShell->GetViewOptions()->IsTest6(); if( bT2 || bT6 ) { if( bT2 ) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 0861f98b2ddf..562682c73af3 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -41,6 +41,7 @@ #include #include #include // GetDoc() +#include "rootfrm.hxx" #include // InvalidateSpelling #include #include // ViewShell @@ -353,8 +354,8 @@ void SwTxtFrm::InitCtor() /************************************************************************* * SwTxtFrm::SwTxtFrm() *************************************************************************/ -SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode) - : SwCntntFrm(pNode) +SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode, SwFrm* pSib ) + : SwCntntFrm( pNode, pSib ) { InitCtor(); } @@ -399,7 +400,7 @@ sal_Bool SwTxtFrm::IsHiddenNow() const const bool bHiddenCharsHidePara = GetTxtNode()->HasHiddenCharAttribute( true ); const bool bHiddenParaField = GetTxtNode()->HasHiddenParaField(); - const ViewShell* pVsh = GetShell(); + const ViewShell* pVsh = getRootFrm()->GetCurrShell(); if ( pVsh && ( bHiddenCharsHidePara || bHiddenParaField ) ) { @@ -568,7 +569,7 @@ void SwTxtFrm::HideAndShowObjects() // paragraph is visible, but can contain hidden text portion. // first we check if objects are allowed to be hidden: const SwTxtNode& rNode = *GetTxtNode(); - const ViewShell* pVsh = GetShell(); + const ViewShell* pVsh = getRootFrm()->GetCurrShell(); const bool bShouldBeHidden = !pVsh || !pVsh->GetWin() || !pVsh->GetViewOptions()->IsShowHiddenChar(); @@ -860,7 +861,7 @@ void lcl_SetWrong( SwTxtFrm& rFrm, xub_StrLen nPos, long nCnt, bool bMove ) pTxtNode->SetSmartTagDirty( true ); } - SwRootFrm *pRootFrm = rFrm.FindRootFrm(); + SwRootFrm *pRootFrm = rFrm.getRootFrm(); if (pRootFrm) { pRootFrm->SetNeedGrammarCheck( TRUE ); @@ -913,7 +914,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) if( IsInRange( aFrmFmtSetRange, nWhich ) || RES_FMT_CHG == nWhich ) { SwCntntFrm::Modify( pOld, pNew ); - if( nWhich == RES_FMT_CHG && GetShell() ) + if( nWhich == RES_FMT_CHG && getRootFrm()->GetCurrShell() ) { // Collection hat sich geaendert Prepare( PREP_CLEAR ); @@ -1028,9 +1029,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) } // --> OD 2010-02-16 #i104008# - if ( GetShell() ) + ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if ( pViewSh ) { - GetShell()->InvalidateAccessibleParaAttrs( *this ); + pViewSh->InvalidateAccessibleParaAttrs( *this ); } // <-- } @@ -1238,7 +1240,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) if( nCount ) { - if( GetShell() ) + if( getRootFrm()->GetCurrShell() ) { Prepare( PREP_CLEAR ); _InvalidatePrt(); @@ -1284,9 +1286,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) } // --> OD 2009-01-06 #i88069# - if ( GetShell() ) + ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + if ( pViewSh ) { - GetShell()->InvalidateAccessibleParaAttrs( *this ); + pViewSh->InvalidateAccessibleParaAttrs( *this ); } // <-- } @@ -2269,7 +2272,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont ) const SwTwips mnOldHeightOfLastLine( mnHeightOfLastLine ); // <-- // determine output device - ViewShell* pVsh = GetShell(); + ViewShell* pVsh = getRootFrm()->GetCurrShell(); ASSERT( pVsh, " - no ViewShell" ); // --> OD 2007-07-02 #i78921# - make code robust, according to provided patch // There could be no instance in the case of loading a binary @@ -2280,7 +2283,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont ) } OutputDevice* pOut = pVsh->GetOut(); const IDocumentSettingAccess* pIDSA = GetTxtNode()->getIDocumentSettingAccess(); - if ( !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) || + if ( !pVsh->GetViewOptions()->getBrowseMode() || pVsh->GetViewOptions()->IsPrtFormat() ) { pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 2b655847ad05..74fa31f9237e 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -30,6 +30,7 @@ #include "viewsh.hxx" #include "doc.hxx" #include "pagefrm.hxx" +#include "rootfrm.hxx" #include "ndtxt.hxx" #include "txtatr.hxx" #include @@ -692,7 +693,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) { if( !pSrcFrm ) { - SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,pFtn); + SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,this,pFtn); SwNodeIndex aIdx( *pFtn->GetStartNode(), 1 ); ::_InsertCnt( pNew, pDoc, aIdx.GetIndex() ); GetNode()->getIDocumentLayoutAccess()->GetLayouter()->CollectEndnote( pNew ); @@ -757,7 +758,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) pBoss->RearrangeFtns( nDeadLine, sal_False, pFtn ); ValidateBodyFrm(); ValidateFrm(); - ViewShell *pSh = GetShell(); + ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( pSh && nHeight == (pCont->Frm().*fnRect->fnGetHeight)() ) //Damit uns nix durch die Lappen geht. pSh->InvalidateWindows( pCont->Frm() ); diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx index b1996905935f..f3b75e57f25e 100644 --- a/sw/source/core/text/txtio.cxx +++ b/sw/source/core/text/txtio.cxx @@ -39,6 +39,7 @@ #include "errhdl.hxx" #include "txtcfg.hxx" #include "txtfrm.hxx" // IsDbg() +#include "rootfrm.hxx" #include "flyfrms.hxx" #include "inftxt.hxx" #include "porexp.hxx" @@ -286,8 +287,8 @@ SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream sal_Bool IsDbg( const SwTxtFrm *pFrm ) { - if( pFrm && pFrm->GetShell() ) - return pFrm->GetShell()->GetViewOptions()->IsTest4(); + if( pFrm && pFrm->getRootFrm()->GetCurrShell() ) + return pFrm->getRootFrm()->GetCurrShell()->GetViewOptions()->IsTest4(); else return sal_False; } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 5cfffeaf5229..ab4b0c5f7f94 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -183,7 +183,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, { // dann die "Anker" (Body) Position holen. Point aPt; - const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, FALSE ); + const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); if( pFrm ) { SwPosition aPos( *pNd ); diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx index 5a444161a702..966a3d6f0225 100644 --- a/sw/source/core/txtnode/SwGrammarContact.cxx +++ b/sw/source/core/txtnode/SwGrammarContact.cxx @@ -205,7 +205,7 @@ void repaintTextFrames( SwModify& rModify ) pFrm; pFrm = (const SwTxtFrm*)aIter.Next() ) { SwRect aRec( pFrm->PaintArea() ); - const SwRootFrm *pRootFrm = pFrm->FindRootFrm(); + const SwRootFrm *pRootFrm = pFrm->getRootFrm(); ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL; if( pCurShell ) pCurShell->InvalidateWindows( aRec ); diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index 02da2c32be8a..c00a284f4109 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -272,8 +272,9 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm ) // Dabei wird eine sofortige Neuformatierung von pCurrFrm angestossen. // Die Rekursion wird durch den Lockmechanismus in SwTxtFrm::Format() // abgewuergt. - SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, (SwFrm*)pCurrFrm ); - ((SwFrm*)pCurrFrm)->AppendFly( pFly ); + SwFrm* pCurrFrame = const_cast< SwFrm* >(pCurrFrm); + SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, pCurrFrame, pCurrFrame ); + pCurrFrame->AppendFly( pFly ); pFly->RegistFlys(); // 7922: Wir muessen dafuer sorgen, dass der Inhalt des FlyInCnt diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 7d6b8959787b..41d5a1618e5e 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -92,7 +92,7 @@ void SwFmtFtn::SetEndNote( bool b ) { if ( GetTxtFtn() ) { - GetTxtFtn()->DelFrms(); + GetTxtFtn()->DelFrms(0); } m_bEndNote = b; } @@ -238,7 +238,7 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, BOOL bDelNode ) // Werden die Nodes nicht geloescht mussen sie bei den Seiten // abmeldet (Frms loeschen) werden, denn sonst bleiben sie // stehen (Undo loescht sie nicht!) - DelFrms(); + DelFrms( 0 ); } DELETEZ( m_pStartNode ); @@ -356,19 +356,22 @@ void SwTxtFtn::MakeNewTextSection( SwNodes& rNodes ) } -void SwTxtFtn::DelFrms() +void SwTxtFtn::DelFrms( const SwFrm* pSib ) { // delete the FtnFrames from the pages ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" ); if ( !m_pTxtNode ) return; + const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; BOOL bFrmFnd = FALSE; { SwClientIter aIter( *m_pTxtNode ); for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm )); pFnd; pFnd = (SwCntntFrm*)aIter.Next() ) { + if( pRoot != pFnd->getRootFrm() && pRoot ) + continue; SwPageFrm* pPage = pFnd->FindPageFrm(); if( pPage ) { @@ -389,6 +392,8 @@ void SwTxtFtn::DelFrms() for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm )); pFnd; pFnd = (SwCntntFrm*)aIter.Next() ) { + if( pRoot != pFnd->getRootFrm() && pRoot ) + continue; SwPageFrm* pPage = pFnd->FindPageFrm(); SwFrm *pFrm = pFnd->GetUpper(); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index ff79d2266ba7..96989f2df2ae 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -417,7 +417,7 @@ USHORT SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut const IDocumentSettingAccess& rIDSA = *pSh->getIDocumentSettingAccess(); const bool bBrowse = ( pSh->GetWin() && - rIDSA.get(IDocumentSettingAccess::BROWSE_MODE) && + pSh->GetViewOptions()->getBrowseMode() && !pSh->GetViewOptions()->IsPrtFormat() ); if ( !bBrowse && rIDSA.get(IDocumentSettingAccess::ADD_EXT_LEADING) ) @@ -459,7 +459,7 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut ) OutputDevice* pPrt = &rSh.GetRefDev(); if( !rSh.GetWin() || - !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || + !rSh.GetViewOptions()->getBrowseMode() || rSh.GetViewOptions()->IsPrtFormat() ) { // After CreatePrtFont pPrtFont is the font which is actually used @@ -832,13 +832,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) OutputDevice& rRefDev = rInf.GetShell()->GetRefDev(); OutputDevice* pWin = rInf.GetShell()->GetWin(); - const IDocumentSettingAccess* pIDSA = rInf.GetShell()->getIDocumentSettingAccess(); // true if pOut is the printer and the printer has been used for formatting const BOOL bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() && OUTDEV_PRINTER == rRefDev.GetOutDevType(); const BOOL bBrowse = ( pWin && - pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) && + rInf.GetShell()->GetViewOptions()->getBrowseMode() && !rInf.GetShell()->GetViewOptions()->IsPrtFormat() && !rInf.GetBullet() && ( rInf.GetSpace() || !rInf.GetKern() ) && @@ -876,7 +875,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) const BOOL bNoAdjust = bPrt || ( pWin && - pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) && + rInf.GetShell()->GetViewOptions()->getBrowseMode() && !rInf.GetShell()->GetViewOptions()->IsPrtFormat() ); if ( OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() ) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 798d7e41602f..6523559d8708 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -148,7 +148,7 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere, //Wenn es noch kein Layout gibt oder in einer versteckten Section // stehen, brauchen wir uns um das MakeFrms nicht bemuehen. const SwSectionNode* pSectNd; - if( !GetDoc()->GetRootFrm() || + if( !GetDoc()->GetCurrentViewShell() || //swmod 071108//swmod 071225 ( 0 != (pSectNd = pNode->FindSectionNode()) && pSectNd->GetSection().IsHiddenFlag() )) return pNode; @@ -300,9 +300,9 @@ SwTxtNode::~SwTxtNode() InitSwParaStatistics( false ); } -SwCntntFrm *SwTxtNode::MakeFrm() +SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib ) { - SwCntntFrm *pFrm = new SwTxtFrm(this); + SwCntntFrm *pFrm = new SwTxtFrm( this, pSib ); return pFrm; } @@ -320,7 +320,7 @@ xub_StrLen SwTxtNode::Len() const void lcl_ChangeFtnRef( SwTxtNode &rNode ) { SwpHints *pSwpHints = rNode.GetpSwpHints(); - if( pSwpHints && rNode.GetDoc()->GetRootFrm() ) + if( pSwpHints && rNode.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { SwTxtAttr* pHt; SwCntntFrm* pFrm = NULL; @@ -353,7 +353,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm)); if( pCntnt ) { - ASSERT( pCntnt->FindRootFrm() == pFrm->FindRootFrm(), + ASSERT( pCntnt->getRootFrm() == pFrm->getRootFrm(), "lcl_ChangeFtnRef: Layout double?" ); SwFtnFrm *pFtn = pCntnt->FindFtnFrm(); if( pFtn && pFtn->GetAttr() == pAttr ) @@ -538,13 +538,13 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) UnlockModify(); // Benachrichtigungen wieder freischalten - const SwRootFrm * const pRootFrm = pNode->GetDoc()->GetRootFrm(); // If there is an accessible layout we must call modify even // with length zero, because we have to notify about the changed // text node. + const SwRootFrm *pRootFrm; if ( (nTxtLen != nSplitPos) || - ( pRootFrm && pRootFrm->IsAnyShellAccessible() ) ) - + ( (pRootFrm = pNode->GetDoc()->GetCurrentLayout()) != 0 && + pRootFrm->IsAnyShellAccessible() ) ) //swmod 080218 { // dann sage den Frames noch, das am Ende etwas "geloescht" wurde if( 1 == nTxtLen - nSplitPos ) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 944eb70b2c3d..9614cfc27b91 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1469,7 +1469,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf ) if( pLinguNode != this ) { pLinguNode = this; - pLinguFrm = (SwTxtFrm*)GetFrm( (Point*)(rHyphInf.GetCrsrPos()) ); + pLinguFrm = (SwTxtFrm*)getLayoutFrm( GetDoc()->GetCurrentLayout(), (Point*)(rHyphInf.GetCrsrPos()) ); } SwTxtFrm *pFrm = pLinguFrm; if( pFrm ) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 6df9f9aa24b8..6848f1b13644 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -949,7 +949,7 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool ) aTmp.SetAnchor( &aPos ); // so the Layout does not get confused - if ( !pCNd || !pCNd->GetFrm( 0, 0, FALSE ) ) + if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, FALSE ) ) { m_rFmt.DelFrms(); } diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index e3b54c59b142..a4e5ded47f07 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -520,7 +520,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter ) aNewAnchor.SetPageNum( rAnchor.GetPageNum() ); Point aDrawSavePt, aDrawOldPt; - if( pDoc->GetRootFrm() ) + if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { if( RES_DRAWFRMFMT == pFrmFmt->Which() ) { diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index a0ba635549ac..3d38407a9e56 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -338,8 +338,7 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter ) } else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { - aAnchor.SetPageNum( pDoc->GetRootFrm()->GetCurrPage( - rUndoIter.pAktPam )); + aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( rUndoIter.pAktPam )); } else { ASSERT( FALSE, "was fuer ein Anker ist es denn nun?" ); diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 980496cfd518..4b9505797c57 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -80,7 +81,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo ) { ClearRedo(); const SdrMarkList* pMarkList = 0; - ViewShell* pSh = GetRootFrm() ? GetRootFrm()->GetCurrShell() : 0; + ViewShell* pSh = GetCurrentViewShell() ? GetCurrentViewShell() : 0; //swmod 071108//swmod 071225 if( pSh && pSh->HasDrawView() ) pMarkList = &pSh->GetDrawView()->GetMarkedObjectList(); diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 646ffbd4c8f2..bf485ad62153 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -1057,7 +1057,7 @@ void SwUndoInsertLabel::Repeat( SwUndoIter& rIter ) case LTYPE_OBJECT: { SwFlyFrm* pFly; - SwCntntFrm *pCnt = pCNd->GetFrm(); + SwCntntFrm *pCnt = pCNd->getLayoutFrm( rDoc.GetCurrentLayout() ); if( pCnt && 0 != ( pFly = pCnt->FindFlyFrm() ) ) nIdx = pFly->GetFmt()->GetCntnt().GetCntntIdx()->GetIndex(); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 92a33da130fe..0379f9bdc82d 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -782,7 +782,7 @@ void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny ) * --------------------------------------------------*/ void GetCurPageStyle(SwPaM& rPaM, String &rString) { - const SwPageFrm* pPage = rPaM.GetCntntNode()->GetFrm()->FindPageFrm(); + const SwPageFrm* pPage = rPaM.GetCntntNode()->getLayoutFrm(rPaM.GetDoc()->GetCurrentLayout())->FindPageFrm(); if(pPage) SwStyleNameMapper::FillProgName( pPage->GetPageDesc()->GetName(), rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True ); } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 8ae8f948900f..80ee39740c01 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -789,11 +789,11 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) else throw uno::RuntimeException(); } - else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetRootFrm()) + else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetCurrentLayout()) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp(MM100_TO_TWIP(aMM100Pos.X), MM100_TO_TWIP(aMM100Pos.Y)); - pDoc->GetRootFrm()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); + pDoc->GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); //swmod 080218 aAnchor.SetAnchor( pPam->GetPoint() ); // --> OD 2004-08-18 #i32349# - adjustment of vertical positioning @@ -1346,7 +1346,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A pFmt->SetPositionLayoutDir( nPositionLayoutDir ); } // <-- - else if( pDoc->GetRootFrm() ) + else if( pDoc->GetCurrentLayout()) //swmod 080218 { UnoActionContext aCtx(pDoc); if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId) @@ -1411,11 +1411,11 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A //if the fly has been anchored at page then it needs to be connected //to the content position SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); - if( pDoc->GetRootFrm() ) + if( pDoc->GetCurrentLayout() ) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp( pObj->GetSnapRect().TopLeft() ); - pDoc->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); + pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); } else { @@ -1530,7 +1530,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A aKeepedPosition = getPosition(); } // <-- - if( pFmt && pFmt->GetDoc()->GetRootFrm() ) + if( pFmt && pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { UnoActionContext aCtx(pFmt->GetDoc()); xPrSet->setPropertyValue(rPropertyName, aValue); diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 2923b4e46317..f349cbb40027 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -388,7 +388,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara() if ( !pCurrentPage && !pStopPage ) { pStopPage = pStartPage; - pCurrentPage = static_cast(mpDoc->GetRootFrm()->Lower()); + pCurrentPage = static_cast(pViewShell->GetLayout()->Lower()); } } } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index d9334e97c841..355857385903 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -212,9 +212,9 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, ? FLY_AT_CHAR : FLY_AT_PARA); const SwCntntFrm* pCFrm; const SwCntntNode* pCNd; - if( pDoc->GetRootFrm() && + if( pDoc->GetCurrentViewShell() && //swmod 071108//swmod 071225 0 != (pCNd = rIdx.GetNode().GetCntntNode()) && - 0 != (pCFrm = pCNd->GetFrm()) ) + 0 != (pCFrm = pCNd->getLayoutFrm( pDoc->GetCurrentLayout())) ) { const SwSortedObjs *pObjs = pCFrm->GetDrawObjs(); if( pObjs ) @@ -272,7 +272,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, UnoActionContext::UnoActionContext(SwDoc *const pDoc) : m_pDoc(pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout(); if (pRootFrm) { pRootFrm->StartAllAction(); @@ -287,7 +287,7 @@ UnoActionContext::~UnoActionContext() // Doc may already have been removed here if (m_pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout(); if (pRootFrm) { pRootFrm->EndAllAction(); @@ -301,7 +301,7 @@ UnoActionContext::~UnoActionContext() UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc) : m_pDoc(pDoc) { - SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout(); if (pRootFrm) { pRootFrm->UnoRemoveAllActions(); @@ -313,7 +313,7 @@ UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc) * --------------------------------------------------*/ UnoActionRemoveContext::~UnoActionRemoveContext() { - SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout(); if (pRootFrm) { pRootFrm->UnoRestoreAllActions(); diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 1aa7c91a4c69..79ee12778572 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -272,7 +272,7 @@ BOOL SwViewImp::IsDragPossible( const Point &rPoint ) SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj(); SwRect aRect; - if( ::CalcClipRect( pO, aRect, FALSE ) ) + if( pO && ::CalcClipRect( pO, aRect, FALSE ) ) { SwRect aTmp; ::CalcClipRect( pO, aTmp, TRUE ); diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index b2d91c48f598..4ae0462b95bd 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -69,7 +69,7 @@ void SwViewImp::Init( const SwViewOption *pNewOpt ) { ASSERT( pDrawView, "SwViewImp::Init without DrawView" ); //Jetzt die PageView erzeugen wenn sie noch nicht existiert. - SwRootFrm *pRoot = pSh->getIDocumentLayoutAccess()->GetRootFrm(); + SwRootFrm *pRoot = pSh->GetLayout(); //swmod 071108//swmod 071225 if ( !pSdrPageView ) { IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); @@ -383,7 +383,7 @@ Color SwViewImp::GetRetoucheColor() const const ViewShell &rSh = *GetShell(); if ( rSh.GetWin() ) { - if ( rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + if ( rSh.GetViewOptions()->getBrowseMode() && COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor().GetColor() ) aRet = rSh.GetViewOptions()->GetRetoucheColor(); else if(rSh.GetViewOptions()->IsPagePreview() && @@ -413,10 +413,10 @@ void SwViewImp::UpdateAccessible() // We require a layout and an XModel to be accessible. IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess(); Window *pWin = GetShell()->GetWin(); - ASSERT( pIDLA->GetRootFrm(), "no layout, no access" ); + ASSERT( GetShell()->GetLayout(), "no layout, no access" ); //swmod 071108//swmod 071225 ASSERT( pWin, "no window, no access" ); - if( IsAccessible() && pIDLA->GetRootFrm() && pWin ) + if( IsAccessible() && pIDLA->GetCurrentViewShell() && pWin ) //swmod 071108//swmod 071225 GetAccessibleMap().GetDocumentView(); } diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx old mode 100644 new mode 100755 index fcb702a7112a..7f0da726a7c6 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -90,7 +90,6 @@ void ViewShell::AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions return; } - // print brochure // OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling // for a page to be printed. diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 156447fda9da..49eb81e3f72e 100755 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -268,7 +268,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) if ( pRegion ) { - SwRootFrm* pLayout = GetLayout(); + SwRootFrm* pCurrentLayout = GetLayout(); Imp()->pRegion = NULL; @@ -333,7 +333,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) pOut = pVout; if ( bPaintsFromSystem ) PaintDesktop( aRect ); - pLayout->Paint( aRect ); + pCurrentLayout->Paint( aRect ); pOld->DrawOutDev( aRect.Pos(), aRect.SSize(), aRect.Pos(), aRect.SSize(), *pVout ); pOut = pOld; @@ -354,7 +354,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd ) if ( bPaintsFromSystem ) PaintDesktop( aRect ); - pLayout->Paint( aRect ); + pCurrentLayout->Paint( aRect ); // #i75172# end DrawingLayer paint DLPostPaint2(true); @@ -528,13 +528,14 @@ BOOL ViewShell::AddPaintRect( const SwRect & rRect ) ViewShell *pSh = this; do { + if( pSh->Imp() ) + { if ( pSh->IsPreView() && pSh->GetWin() ) -// pSh->GetWin()->Invalidate(); ::RepaintPagePreview( pSh, rRect ); else - bRet |= pSh->Imp()->AddPaintRect( rRect ); + bRet |= pSh->Imp()->AddPaintRect( rRect );//swmod 080111 + } pSh = (ViewShell*)pSh->GetNext(); - } while ( pSh != this ); return bRet; } @@ -586,7 +587,7 @@ void ViewShell::MakeVisible( const SwRect &rRect ) { if( pWin ) { - const SwFrm* pRoot = GetDoc()->GetRootFrm(); + const SwFrm* pRoot = /*GetDoc()->GetCurrentViewShell()->*/GetLayout(); int nLoopCnt = 3; long nOldH; do{ @@ -594,7 +595,7 @@ void ViewShell::MakeVisible( const SwRect &rRect ) StartAction(); ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX ); EndAction(); - } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); + } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); //swmod 071108//swmod 071225 } #ifdef DBG_UTIL else @@ -1191,13 +1192,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect) const long nXDiff = aPrevArea.Left() - VisArea().Left(); const long nYDiff = aPrevArea.Top() - VisArea().Top(); - if( !nXDiff && !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + if( !nXDiff && !GetViewOptions()->getBrowseMode() && (!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) ) { //Falls moeglich die Wiese nicht mit Scrollen. //Also linke und rechte Kante des Scrollbereiches auf die //Seiten begrenzen. - const SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower(); + const SwPageFrm *pPage = (SwPageFrm*)GetLayout()->Lower(); //swmod 071108//swmod 071225 if ( pPage->Frm().Top() > pOldPage->Frm().Top() ) pPage = (SwPageFrm*)pOldPage; SwRect aBoth( VisArea() ); @@ -1667,7 +1668,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect ) //Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten, //den diese werden spaeter beim VisPortChgd ausgespart. BOOL bBorderOnly = FALSE; - const SwRootFrm *pRoot = GetDoc()->GetRootFrm(); + const SwRootFrm *pRoot = GetLayout();//swmod 080305 if ( rRect.Top() > pRoot->Frm().Bottom() ) { const SwFrm *pPg = pRoot->Lower(); @@ -1675,7 +1676,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect ) pPg = pPg->GetNext(); if ( !pPg || !pPg->Frm().IsOver( VisArea() ) ) bBorderOnly = TRUE; - } + } //swmod 071108//swmod 071225 const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode(); @@ -1689,7 +1690,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect ) if ( bBorderOnly ) { - const SwFrm *pPage = pRoot->Lower(); + const SwFrm *pPage =pRoot->Lower(); //swmod 071108//swmod 071225 SwRect aLeft( rRect ), aRight( rRect ); while ( pPage ) { @@ -2099,8 +2100,7 @@ sal_Int32 ViewShell::GetBrowseWidth() const void ViewShell::CheckBrowseView( BOOL bBrowseChgd ) { - if ( !bBrowseChgd && - !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() ) return; SET_CURR_SHELL( this ); @@ -2168,14 +2168,15 @@ void ViewShell::CheckBrowseView( BOOL bBrowseChgd ) SwRootFrm *ViewShell::GetLayout() const { - return GetDoc()->GetRootFrm(); + return pLayout.get(); //swmod 080116 } +/***********************************************************************/ OutputDevice& ViewShell::GetRefDev() const { OutputDevice* pTmpOut = 0; if ( GetWin() && - getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + GetViewOptions()->getBrowseMode() && !GetViewOptions()->IsPrtFormat() ) pTmpOut = GetWin(); else if ( 0 != mpTmpRef ) @@ -2233,7 +2234,10 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt ) ImplApplyViewOptions( rOpt ); - //Einige Aenderungen muessen synchronisiert werden. + // swmod 080115 + // With one layout per view it is not longer necessary + // to sync these "layout related" view options + // But as long as we have to disable "multiple layout" pSh = (ViewShell*)this->GetNext(); while ( pSh != this ) { @@ -2249,6 +2253,7 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt ) pSh->ImplApplyViewOptions( aOpt ); pSh = (ViewShell*)pSh->GetNext(); } + // End of disabled multiple window pSh = this; do @@ -2313,12 +2318,17 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) // Wenn kein ReferenzDevice (Drucker) zum Formatieren benutzt wird, // sondern der Bildschirm, muss bei Zoomfaktoraenderung neu formatiert // werden. - if( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( pOpt->getBrowseMode() ) bReformat = TRUE; } - if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - pOpt->IsPrtFormat() != rOpt.IsPrtFormat() ) + bool bBrowseModeChanged = false; + if( pOpt->getBrowseMode() != rOpt.getBrowseMode() ) + { + bBrowseModeChanged = true; + bReformat = TRUE; + } + else if( pOpt->getBrowseMode() && pOpt->IsPrtFormat() != rOpt.IsPrtFormat() ) bReformat = TRUE; if ( HasDrawView() || rOpt.IsGridVisible() ) @@ -2362,6 +2372,15 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode(pDoc->GetDocShell())); + if( bBrowseModeChanged ) + { + // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in + // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) + pDoc->CheckDefaultPageFmt(); + // <-- + CheckBrowseView( TRUE ); + } + pMyWin->Invalidate(); if ( bReformat ) { @@ -2452,8 +2471,7 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet) { if( bSet != pOpt->IsPDFExport() ) { - if( bSet && - getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( bSet && pOpt->getBrowseMode() ) pOpt->SetPrtFormat( TRUE ); pOpt->SetPDFExport(bSet); } @@ -2524,13 +2542,11 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create { uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc; - SwDoc *pMyDoc = GetDoc(); - // We require a layout and an XModel to be accessible. - ASSERT( pMyDoc->GetRootFrm(), "no layout, no access" ); + ASSERT( pLayout, "no layout, no access" ); ASSERT( GetWin(), "no window, no access" ); - if( pMyDoc->GetRootFrm() && GetWin() ) + if( pDoc->GetCurrentViewShell() && GetWin() ) //swmod 071108 xAcc = Imp()->GetAccessibleMap().GetDocumentView(); return xAcc; @@ -2543,18 +2559,18 @@ ViewShell::CreateAccessiblePreview() "Can't create accessible preview for non-preview ViewShell" ); // We require a layout and an XModel to be accessible. - ASSERT( pDoc->GetRootFrm(), "no layout, no access" ); + ASSERT( pLayout, "no layout, no access" ); ASSERT( GetWin(), "no window, no access" ); // OD 15.01.2003 #103492# - add condition - if ( IsPreView() && pDoc->GetRootFrm() && GetWin() ) + if ( IsPreView() && GetLayout()&& GetWin() ) { // OD 14.01.2003 #103492# - adjustment for new method signature return Imp()->GetAccessibleMap().GetDocumentPreview( PagePreviewLayout()->maPrevwPages, GetWin()->GetMapMode().GetScaleX(), - pDoc->GetRootFrm()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ), - PagePreviewLayout()->maWinSize ); + GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ), + PagePreviewLayout()->maWinSize ); //swmod 080305 } return NULL; } @@ -2650,6 +2666,30 @@ void ViewShell::SetCareWin( Window* pNew ) pCareWindow = pNew; } +sal_uInt16 ViewShell::GetPageCount() const +{ + return GetLayout() ? GetLayout()->GetPageNum() : 1; +} + +const Size ViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const +{ + Size aSize; + const SwRootFrm* pTmpRoot = GetLayout(); + if( pTmpRoot && nPageNum ) + { + const SwPageFrm* pPage = static_cast + (pTmpRoot->Lower()); + + while( --nPageNum && pPage->GetNext() ) + pPage = static_cast( pPage->GetNext() ); + + if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) + pPage = static_cast( pPage->GetNext() ); + + aSize = pPage->Frm().SSize(); + } + return aSize; +} // --> FME 2004-06-15 #i12836# enhanced pdf export sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index adf37dd11f22..4f72891eefdb 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -112,7 +112,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) // --> FME 2005-01-21 #i41075# // Only setup the printer if we need one: const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); - const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE); + const bool bBrowseMode = pOpt->getBrowseMode(); if( pPDFOut ) InitPrt( pPDFOut ); // <-- @@ -135,12 +135,20 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) GetWin()->SetLineColor(); } - //Layout erzeugen wenn es noch nicht vorhanden ist. - SwRootFrm* pRoot = GetDoc()->GetRootFrm(); - if( !pRoot ) - GetDoc()->SetRootFrm( pRoot = new SwRootFrm( pDoc->GetDfltFrmFmt(), this ) ); - - SizeChgNotify(); + // Create a new layout, if there is no one available + if( !pLayout ) + { + // Here's the code which disables the usage of "multiple" layouts at the moment + // If the problems with controls and groups objects are solved, + // this code can be removed... + ViewShell *pCurrShell = GetDoc()->GetCurrentViewShell(); + if( pCurrShell ) + pLayout = pCurrShell->pLayout; + // end of "disable multiple layouts" + if( !pLayout ) + pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016 + } + SizeChgNotify(); //swmod 071108 // --> #i31958# // XForms mode: initialize XForms mode, based on design mode (draw view) @@ -276,9 +284,8 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, bPaintInProgress = bViewLocked = bInEndAction = bFrameView = bEndActionByVirDev = FALSE; bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags ); - // OD 12.12.2002 #103492# - if ( bPreView ) - pImp->InitPagePreviewLayout(); + if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125 + pLayout = rShell.pLayout;//swmod 080125 SET_CURR_SHELL( this ); @@ -289,6 +296,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt()) pOut = pOutput; + // OD 12.12.2002 #103492# + if ( bPreView ) + pImp->InitPagePreviewLayout(); + ((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))-> SetHiddenFlag( !pOpt->IsShowHiddenField() ); @@ -362,8 +373,8 @@ ViewShell::~ViewShell() if( !pDoc->release() ) delete pDoc, pDoc = 0; else - pDoc->GetRootFrm()->ResetNewLayout(); - } + GetLayout()->ResetNewLayout(); + }//swmod 080317 delete pOpt; @@ -378,7 +389,12 @@ ViewShell::~ViewShell() } if ( pDoc ) + { GetLayout()->DeRegisterShell( this ); + if(pDoc->GetCurrentViewShell()==this) + pDoc->SetCurrentViewShell( this->GetNext()!=this ? + (ViewShell*)this->GetNext() : NULL ); + } delete mpTmpRef; delete pAccOptions; @@ -386,7 +402,7 @@ ViewShell::~ViewShell() BOOL ViewShell::HasDrawView() const { - return Imp()->HasDrawView(); + return Imp() ? Imp()->HasDrawView() : 0; } void ViewShell::MakeDrawView() diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index e74fb21f720a..91a8353cedc6 100755 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -340,13 +340,13 @@ void ViewShell::CalcPagesForPrint( USHORT nMax ) { SET_CURR_SHELL( this ); - SwRootFrm* pLayout = GetLayout(); - // ULONG nStatMax = pLayout->GetPageNum(); + SwRootFrm* pMyLayout = GetLayout(); + // ULONG nStatMax = pMyLayout->GetPageNum(); - const SwFrm *pPage = pLayout->Lower(); - SwLayAction aAction( pLayout, Imp() ); + const SwFrm *pPage = pMyLayout->Lower(); + SwLayAction aAction( pMyLayout, Imp() ); - pLayout->StartAllAction(); + pMyLayout->StartAllAction(); for ( USHORT i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i ) { pPage->Calc(); @@ -364,7 +364,8 @@ void ViewShell::CalcPagesForPrint( USHORT nMax ) Imp()->SetFirstVisPageInvalid(); // SwPaintQueue::Repaint(); } - pLayout->EndAllAction(); + + pMyLayout->EndAllAction(); } /******************************************************************************/ @@ -402,7 +403,7 @@ SwDoc * ViewShell::CreatePrtDoc( SfxObjectShellRef &rDocShellRef) SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); - const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0; if( pCntntFrm ) { SwRect aCharRect; @@ -511,7 +512,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); - const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0; + const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0; if( pCntntFrm ) { SwRect aCharRect; @@ -631,7 +632,7 @@ sal_Bool ViewShell::PrintOrPDFExport( else { pOutDevDoc = GetDoc(); - pShell = new ViewShell( *this, 0, pOutDev ); + pShell = new ViewShell( *this, 0, pOutDev, VSHELLFLAG_SHARELAYOUT ); } SdrView *pDrawView = pShell->GetDrawView(); @@ -734,10 +735,10 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat //eine, dann legen wir uns eine neue Sicht an, oder das Doc hat noch //keine, dann erzeugen wir die erste Sicht. ViewShell *pSh; - if( pDoc->GetRootFrm() && pDoc->GetRootFrm()->GetCurrShell() ) - pSh = new ViewShell( *pDoc->GetRootFrm()->GetCurrShell(), 0, pOleOut ); - else - pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut ); + if( pDoc->GetCurrentViewShell() ) + pSh = new ViewShell( *pDoc->GetCurrentViewShell(), 0, pOleOut,VSHELLFLAG_SHARELAYOUT );//swmod 080129 + else //swmod 071108//swmod 071225 + pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut);//swmod 080129 { SET_CURR_SHELL( pSh ); @@ -747,11 +748,12 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat SwRect aSwRect( rRect ); pSh->aVisArea = aSwRect; - if ( pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + if ( pSh->GetViewOptions()->getBrowseMode() && pSh->GetNext() == pSh ) { pSh->CheckBrowseView( FALSE ); - pDoc->GetRootFrm()->Lower()->InvalidateSize(); + //pDoc->GetCurrentLayout()->Lower()->InvalidateSize(); //swmod 080218//? + pSh->GetLayout()->Lower()->InvalidateSize(); } // --> FME 2005-02-10 #119474# diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 7edd84270886..90646581da81 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -86,8 +87,6 @@ #include #include // FOOTNOTES -#include - #include "doc.hxx" #include "swerror.h" #include "charatr.hxx" diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 85c4e9846857..7ca40f104809 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -67,12 +67,11 @@ #include "pam.hxx" #include "doc.hxx" #include "ndtxt.hxx" -#include "dcontact.hxx" #include "flypos.hxx" #include "wrthtml.hxx" #include "htmlfly.hxx" #include "htmlform.hxx" - +#include "frmfmt.hxx" using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index df9f43fafa41..89f959ecd911 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -5129,7 +5129,7 @@ void _TblSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc SwTableNode *pTblNd = pTCntxt->GetTableNode(); ASSERT( pTblNd, "Wo ist der Tabellen-Node" ); - if( pDoc->GetRootFrm() && pTblNd ) + if( pDoc->GetCurrentViewShell() && pTblNd ) //swmod 071108//swmod 071225 { // Existiert schon ein Layout, dann muss an dieser Tabelle die // BoxFrames neu erzeugt werden. diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index 7dcb732df601..0482612ba07f 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -1941,7 +1941,7 @@ Writer& OutRTF_SwTblNode(Writer& rWrt, const SwTableNode & rNode) const SwTableLine* pLine = pBoxArr[ 0 ]->GetBox()->GetUpper(); // Zeilenhoehe ausgeben long nHeight = 0; - if( bFixRowHeight && rWrt.pDoc->GetRootFrm() ) + if( bFixRowHeight && rWrt.pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { nHeight = -pRow->GetPos(); //neg. => abs. height! if( nLine ) diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 5a5e7a65e0a7..95f84fece986 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -1061,7 +1061,7 @@ SwTableNode * InsertedTableClient::GetTableNode() } InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc) - : mbHasRoot(rDoc.GetRootFrm()) + : mbHasRoot(rDoc.GetCurrentLayout()) //swmod 080218 { } diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index 2cf1ca325a5b..27295e9e7bce 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -430,7 +430,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pFmt->SetFmtAttr(aAnchor); // Damit die Frames bei Einfuegen in existierendes Doc // erzeugt werden (erst nach Setzen des Ankers!): - if(pDoc->GetRootFrm() + if(pDoc->GetCurrentViewShell() //swmod 071108//swmod 071225 && (FLY_AT_PARA == pFmt->GetAnchor().GetAnchorId())) { pFmt->MakeFrms(); @@ -1606,7 +1606,7 @@ void SwFltOutDoc::EndTable() rStack.SetAttr( *pPaM->GetPoint(), 0, FALSE ); rEndStack.SetAttr( *pPaM->GetPoint(), 0, FALSE ); - if (GetDoc().GetRootFrm()){ + if (GetDoc().GetCurrentViewShell()){ //swmod 071108//swmod 071225 SwTableNode* pTableNode = GetDoc().IsIdxInTbl( pPaM->GetPoint()->nNode); pTableNode->DelFrms(); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 7bfa32992f9c..cf9c73ecf4b1 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include // class SwCropGrf #include #include @@ -409,7 +408,7 @@ SwFlyFrmFmt* SwWW8ImplReader::MakeGrafNotInCntnt(const WW8PicDesc& rPD, &aFlySet, &rGrfSet, NULL); // Damit die Frames bei Einfuegen in existierendes Doc erzeugt werden: - if (rDoc.GetRootFrm() && + if (rDoc.GetCurrentViewShell() && //swmod 071108//swmod 071225 (FLY_AT_PARA == pFlyFmt->GetAnchor().GetAnchorId())) { pFlyFmt->MakeFrms(); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 4107657e8554..2cd4acaa3f5a 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -469,7 +469,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, } } - if( pDoc->GetRootFrm() && pDoc->GetDocStat().nPage > 1 && + if( pDoc->GetCurrentViewShell() && pDoc->GetDocStat().nPage > 1 && //swmod 071108//swmod 071225 !(bOrganizerMode || bBlock || bErr) ) { // DBG_ASSERT( !pDoc->GetDocStat().bModified, diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 77dd1e63f53c..26014d58655d 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -583,7 +584,8 @@ void SwXMLExport::SetBodyAttributes() if( pText ) { SwDoc *pDoc = pText->GetDoc(); - if( pDoc && pDoc->GetPageCount() > 1 ) + if( pDoc && pDoc->GetCurrentViewShell() && + pDoc->GetCurrentViewShell()->GetPageCount() > 1 ) { sal_Bool bValue = sal_True; rtl::OUStringBuffer sBuffer; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 4b6af56066fc..267bdfa80b30 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2849,7 +2849,7 @@ void SwXMLTableContext::MakeTable() } // ??? this is always false: root frame is only created in ViewShell::Init - if( pTableNode->GetDoc()->GetRootFrm() ) + if( pTableNode->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { pTableNode->DelFrms(); SwNodeIndex aIdx( *pTableNode->EndOfSectionNode(), 1 ); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 34ccac06a256..27f39ba38c82 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1061,13 +1061,14 @@ void SwDocShell::GetState(SfxItemSet& rSet) case SID_PRINTPREVIEW: { BOOL bDisable = IsInPlaceActive(); + // Disable "multiple layout" if ( !bDisable ) { SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); while (pTmpFrm) // Preview suchen { if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) && - ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) + ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() ) { bDisable = TRUE; break; @@ -1075,6 +1076,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this); } } + // End of disabled "multiple layout" if ( bDisable ) rSet.DisableItem( SID_PRINTPREVIEW ); else diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 9cb3caffa7cc..a537a07ce53e 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -165,6 +165,44 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( return pDlg; } +// Disable "multiple layout" + +void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) +{ + GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); + UpdateFontList(); + SwView* pTempView = _pView ? _pView : (SwView*)GetView(); + if( pTempView ) + { + pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR); + if( !GetDoc()->getPrinter( false ) ) + pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); + GetDoc()->CheckDefaultPageFmt(); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + do { + if( pTmpFrm != pTempView->GetViewFrame() ) + { + pTmpFrm->DoClose(); + pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + } + else + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); + + } while ( pTmpFrm ); + const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); + pTempView->GetWrtShell().CheckBrowseView( TRUE ); + pTempView->CheckVisArea(); + if( bSet ) + { + const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); + if ( SVX_ZOOM_PERCENT != eType) + ((SwView*)GetView())->SetZoom( eType ); + } + pTempView->InvalidateBorder(); + pTempView->SetNewWindowAllowed(!bSet); + } +} +// End of disabled "multiple layout" /// update text fields on document properties changes void SwDocShell::DoFlushDocInfo() @@ -655,7 +693,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) ) { SwDoc* pTmp = pDocSh->GetDoc(); - if ( pTmp->GetRootFrm() ) + if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225 pTmp->InvalidateAutoCompleteFlag(); } } @@ -692,11 +730,7 @@ void SwDocShell::Execute(SfxRequest& rReq) USHORT nSlotId = 0; if( bSet && !bFound ) // Keine gefunden, daher neue Preview anlegen - { - //Keine neue anlegen fuer BrowseView! - if( !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) nSlotId = SID_VIEWSHELL1; - } else if( bFound && !bSet ) nSlotId = bOnly ? SID_VIEWSHELL0 : SID_VIEWSHELL1; @@ -949,6 +983,7 @@ void SwDocShell::Execute(SfxRequest& rReq) //pSavePrinter darf nicht wieder geloescht werden } pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2)); + pViewFrm->GetBindings().Invalidate( SID_NEWWINDOW ); pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE ); pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT ); } @@ -1115,60 +1150,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(FALSE, TRUE, TRUE, FALSE ); break; - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - BOOL bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static USHORT __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) @@ -1726,77 +1707,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -/* -----------------------------14.12.99 16:52-------------------------------- - - ---------------------------------------------------------------------------*/ -void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) -{ - GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); - UpdateFontList(); - SwView* pTempView = _pView ? _pView : (SwView*)GetView(); - if( pTempView ) - { - SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings(); - rBind.Invalidate(FN_SHADOWCURSOR); - rBind.Invalidate(SID_BROWSER_MODE); - rBind.Invalidate(FN_PRINT_LAYOUT); - - if( !GetDoc()->getPrinter( false ) ) - { - pTempView->SetPrinter( GetDoc()->getPrinter( false ), - SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); - } - - // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in - // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) - GetDoc()->CheckDefaultPageFmt(); - // <-- - - // Currently there can be only one view (layout) if the document is viewed in Web layout - // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); - do { - if( pTmpFrm != pTempView->GetViewFrame() ) - { - pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); - } - else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); - - } while ( pTmpFrm ); - - const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - - // set view columns before toggling: - if ( bSet ) - { - const USHORT nColumns = rViewOptions.GetViewLayoutColumns(); - const bool bBookMode = rViewOptions.IsViewLayoutBookMode(); - if ( 1 != nColumns || bBookMode ) - { - ((SwView*)GetView())->SetViewLayout( 1, false ); - } - } - - // Triggeres a formatting: - pTempView->GetWrtShell().CheckBrowseView( TRUE ); - pTempView->CheckVisArea(); - - if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) - { - const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); - - if ( SVX_ZOOM_PERCENT != eType) - { - ((SwView*)GetView())->SetZoom( eType ); - } - } - pTempView->InvalidateBorder(); - pTempView->SetNewWindowAllowed(!bSet); - } -} - ULONG SwDocShell::LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, BOOL bUnoCall ) { diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 2b3a5df1391b..51ca0450e7ac 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -99,7 +99,7 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh ) } if(bHScrollChanged) { - pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)); + pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() ); } //if only the position of the vertical ruler has been changed initiate an update if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged) @@ -653,7 +653,7 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) ) { SwDoc* pTmp = pDocSh->GetDoc(); - if ( pTmp->GetRootFrm() ) + if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags ); ViewShell* pViewShell = 0; diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 73e5d69d7764..08e4028893aa 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -109,7 +109,8 @@ BOOL SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const && nPagePrevRow == rOpt.GetPagePrevRow() && nPagePrevCol == rOpt.GetPagePrevCol() && aRetoucheColor == rOpt.GetRetoucheColor() - && bFormView == rOpt.IsFormView() + && mbFormView == rOpt.IsFormView() + && mbBrowseMode == rOpt.getBrowseMode() && mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode && bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields #ifdef DBG_UTIL @@ -214,9 +215,10 @@ SwViewOption::SwViewOption() : bIsPagePreview(FALSE), bSelectionInReadonly(FALSE), // --> FME 2004-06-29 #114856# Formular view - bFormView(FALSE), + mbFormView(FALSE), // <-- - bBookview(FALSE), + mbBookview(FALSE), + mbBrowseMode(FALSE), mbViewLayoutBookMode(FALSE), bShowPlaceHolderFields( sal_True ), @@ -255,7 +257,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) bReadonly = FALSE; bSelectionInReadonly = FALSE; // --> FME 2004-06-29 #114856# Formular view - bFormView = rVOpt.bFormView; + mbFormView = rVOpt.mbFormView; // <-- nZoom = rVOpt.nZoom ; aSnapSize = rVOpt.aSnapSize ; @@ -274,7 +276,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) sSymbolFont = rVOpt.sSymbolFont; nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode; bStarOneSetting = rVOpt.bStarOneSetting; - bBookview = rVOpt.bBookview; + mbBookview = rVOpt.mbBookview; + mbBrowseMode = rVOpt.mbBrowseMode; mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; @@ -295,7 +298,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) { // --> DVO FME 2004-06-29 #114856# Formular view - bFormView = rVOpt.bFormView ; + mbFormView = rVOpt.mbFormView ; // <-- nZoom = rVOpt.nZoom ; aSnapSize = rVOpt.aSnapSize ; @@ -314,7 +317,8 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) sSymbolFont = rVOpt.sSymbolFont; nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode; bStarOneSetting = rVOpt.bStarOneSetting; - bBookview = rVOpt.bBookview; + mbBookview = rVOpt.mbBookview; + mbBrowseMode = rVOpt.mbBrowseMode; mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index e2e59e17831e..aaea7332b378 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -3868,7 +3868,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( bTstShdwCrsr && bInsWin && !bIsDocReadOnly && !bInsFrm && - !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + !rSh.GetViewOptions()->getBrowseMode() && rSh.GetViewOptions()->IsShadowCursor() && !(rMEvt.GetModifier() + rMEvt.GetButtons()) && !rSh.HasSelection() && !GetConnectMetaFile() ) diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 7cff88c897cc..186564185899 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -491,6 +491,7 @@ public: void SetVisArea( const Point&, BOOL bUpdateScrollbar = TRUE); void CheckVisArea(); + void RecheckBrowseMode(); static LAYOUT_NS Dialog* GetSearchDialog(); static USHORT GetMoveType(); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index d499add5ad53..c63d674fd997 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1774,6 +1774,8 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) aOpt.SetTable( TRUE ); aOpt.SetSnap( FALSE ); aOpt.SetGridVisible( FALSE ); + aOpt.setBrowseMode( FALSE ); + GetViewShell()->ApplyViewOptions( aOpt ); GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions()); @@ -1782,13 +1784,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) aPrintOptions.MakeOptions( false ); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); - IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess(); - if( pIDSA->get(IDocumentSettingAccess::BROWSE_MODE)) - { - pIDSA->set(IDocumentSettingAccess::BROWSE_MODE, false); - pESh->CheckBrowseView( TRUE ); - } - GetViewShell()->CalcLayout(); DocSzChgd( GetViewShell()->GetDocSize() ); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index c7c52e3f53ff..ccd20f43bda1 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -312,6 +312,7 @@ void SwSrcView::Init() } // StartListening(*GetViewFrame()); + SetNewWindowAllowed( sal_False ); StartListening(*pDocShell,TRUE); } diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 4396ff03807c..10303af754f2 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -216,6 +216,13 @@ void SwView::GotFocus() const const_cast< SwView* >( this )->AttrChangedNotify( pWrtShell ); } } + if( GetWrtShellPtr() ) + { + SwWrtShell& rWrtShell = GetWrtShell(); + rWrtShell.GetDoc()->SetCurrentViewShell( GetWrtShellPtr() ); + rWrtShell.GetDoc()->set( IDocumentSettingAccess::BROWSE_MODE, + rWrtShell.GetViewOptions()->getBrowseMode() ); + } } /*-------------------------------------------------------------------- @@ -833,46 +840,42 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) // document SfxViewShell* pExistingSh = 0; if ( pOldSh ) - pExistingSh = pOldSh; - else { - SfxViewFrame *pF = SfxViewFrame::GetFirst( pDocSh ); - if( pF == _pFrame ) - pF = SfxViewFrame::GetNext( *pF, pDocSh ); - if( pF ) - pExistingSh = pF->GetViewShell(); - } - + pExistingSh = pOldSh; // determine type of existing view - if( pExistingSh && - pExistingSh->IsA( TYPE( SwPagePreView ) ) ) + if( pExistingSh->IsA( TYPE( SwPagePreView ) ) ) { sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData(); sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos(); nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); bOldShellWasPagePreView = TRUE; } - else if( pExistingSh && - pExistingSh->IsA( TYPE( SwSrcView ) ) ) + else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) bOldShellWasSrcView = TRUE; + } RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" ); if(PTR_CAST( SwView, pExistingSh)) { pWrtShell = new SwWrtShell( *((SwView*)pExistingSh)->pWrtShell, pEditWin, *this); -//MA: Das kann doch nur zu einem GPF fuehren! -// nSelectionType = ((SwView*)pOldSh)->nSelectionType; + } + else if( dynamic_cast( pDocSh->GetDoc()->GetCurrentViewShell() ) ) + { + pWrtShell = new SwWrtShell( *(SwWrtShell*)pDocSh->GetDoc()->GetCurrentViewShell(), + pEditWin, *this); } else { SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc(); if( !bOldShellWasSrcView && pWebDShell && !bOldShellWasPagePreView ) - rDoc.set(IDocumentSettingAccess::BROWSE_MODE, true); + aUsrPref.setBrowseMode( TRUE ); + else if( rDoc.IsLoaded() ) + aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) ); //Fuer den BrowseMode wollen wir keinen Factor uebernehmen. - if( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT ) + if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT ) { aUsrPref.SetZoomType( SVX_ZOOM_PERCENT ); aUsrPref.SetZoom( 100 ); @@ -979,8 +982,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) static_cast< USHORT >( SW_MOD()->GetUndoOptions().GetUndoCount() ) ); pWrtShell->DoUndo( 0 != SwEditShell::GetUndoActionCount() ); - const BOOL bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const BOOL bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); + // Disable "multiple window" SetNewWindowAllowed(!bBrowse); + // End of disabled multiple window ShowVScrollbar(aUsrPref.IsViewVScrollBar()); ShowHScrollbar(aUsrPref.IsViewHScrollBar()); @@ -1191,7 +1196,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) if ( rUserData.GetTokenCount() > 1 && //Fuer Dokumente ohne Layout nur im OnlineLayout oder beim //Forward/Backward - (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) ) + (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) ) { //#i43146# go to the last editing position when opening own files bool bIsOwnDocument = lcl_IsOwnDocument( *this ); @@ -1214,7 +1219,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) nRight = rUserData.GetToken(0, ';', nPos ).ToInt32(), nBottom= rUserData.GetToken(0, ';', nPos ).ToInt32(); - const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2; + const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; if ( nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) ) { pWrtShell->EnableSmooth( sal_False ); @@ -1223,7 +1228,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) sal_uInt16 nOff = 0; SvxZoomType eZoom; - if( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if( !pWrtShell->GetViewOptions()->getBrowseMode() ) eZoom = (SvxZoomType) (sal_uInt16)rUserData.GetToken(nOff, ';', nPos ).ToInt32(); else { @@ -1314,7 +1319,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > //#i43146# go to the last editing position when opening own files bool bIsOwnDocument = lcl_IsOwnDocument( *this ); sal_Int32 nLength = rSequence.getLength(); - if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) ) + if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) ) { SET_CURR_SHELL(pWrtShell); const beans::PropertyValue *pValue = rSequence.getConstArray(); @@ -1404,7 +1409,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > if (bGotVisibleBottom) { Point aCrsrPos( nX, nY ); - const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2; + const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; if (nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) ) { pWrtShell->EnableSmooth( sal_False ); @@ -1412,7 +1417,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > sal_uInt16 nOff = 0; SvxZoomType eZoom; - if ( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( !pWrtShell->GetViewOptions()->getBrowseMode() ) eZoom = static_cast < SvxZoomType > ( nZoomType ); else { diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index bc9255d59873..257b31d047d4 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -49,15 +49,17 @@ #include #include #include +//#include #include #include #include #include -#include "doc.hxx" +#include #include "view.hxx" #include "basesh.hxx" #include "docsh.hxx" +#include "doc.hxx" #include "globals.hrc" #include "cmdid.h" // FN_ ... #include "globdoc.hxx" @@ -225,6 +227,46 @@ void lcl_SetViewMetaChars( SwViewOption& rVOpt, sal_Bool bOn) } } +void SwView::RecheckBrowseMode() +{ + // OS: numerische Reihenfolge beachten! + static USHORT __READONLY_DATA aInva[] = + { + //SID_NEWWINDOW,/*5620*/ + SID_BROWSER_MODE, /*6313*/ + SID_RULER_BORDERS, SID_RULER_PAGE_POS, + //SID_ATTR_LONG_LRSPACE, + SID_HTML_MODE, + SID_RULER_PROTECT, + //SID_AUTOSPELL_CHECK, + //SID_AUTOSPELL_MARKOFF, + FN_RULER, /*20211*/ + FN_VIEW_GRAPHIC, /*20213*/ + FN_VIEW_BOUNDS, /**/ + FN_VIEW_FIELDS, /*20215*/ + FN_VLINEAL, /*20216*/ + FN_VSCROLLBAR, /*20217*/ + FN_HSCROLLBAR, /*20218*/ + FN_VIEW_META_CHARS, /**/ + FN_VIEW_MARKS, /**/ + //FN_VIEW_FIELDNAME, /**/ + FN_VIEW_TABLEGRID, /*20227*/ + FN_PRINT_LAYOUT, /*20237*/ + FN_QRY_MERGE, /*20364*/ + FN_SHADOWCURSOR, /**/ + 0 + }; + // the view must not exist! + GetViewFrame()->GetBindings().Invalidate(aInva); + CheckVisArea(); + + SvxZoomType eType; + if( GetWrtShell().GetViewOptions()->getBrowseMode() && SVX_ZOOM_PERCENT != (eType = (SvxZoomType) + GetWrtShell().GetViewOptions()->GetZoomType()) ) + SetZoom( eType ); + InvalidateBorder(); +} + /*-------------------------------------------------------------------- State of view options --------------------------------------------------------------------*/ @@ -239,7 +281,6 @@ void SwView::StateViewOptions(SfxItemSet &rSet) while(nWhich) { sal_Bool bReadonly = GetDocShell()->IsReadOnly(); - sal_Bool bBrowse = pIDSA ? pIDSA->get( IDocumentSettingAccess::BROWSE_MODE ) : sal_False; if ( bReadonly && nWhich != FN_VIEW_GRAPHIC ) { rSet.DisableItem(nWhich); @@ -258,6 +299,15 @@ void SwView::StateViewOptions(SfxItemSet &rSet) aBool.SetValue( pOpt->IsViewAnyRuler()); } break; + case SID_BROWSER_MODE: + case FN_PRINT_LAYOUT: + { + sal_Bool bState = pOpt->getBrowseMode(); + if(FN_PRINT_LAYOUT == nWhich) + bState = !bState; + aBool.SetValue( bState ); + } + break; case FN_VIEW_BOUNDS: aBool.SetValue( SwViewOption::IsDocBoundaries()); break; case FN_VIEW_GRAPHIC: @@ -297,7 +347,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet) case FN_VLINEAL: aBool.SetValue( 0 != StatVLineal() ); break; case FN_HSCROLLBAR: - if(bBrowse) + if( pOpt->getBrowseMode() ) { rSet.DisableItem(nWhich); nWhich = 0; @@ -310,7 +360,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet) aBool.SetValue( pOpt->IsOnlineSpell() ); break; case FN_SHADOWCURSOR: - if (pIDSA == 0 || pIDSA->get( IDocumentSettingAccess::BROWSE_MODE )) + if (pIDSA == 0 || pOpt->getBrowseMode() ) { rSet.DisableItem( nWhich ); nWhich = 0; @@ -340,6 +390,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) int eState = STATE_TOGGLE; sal_Bool bSet = sal_False; + bool bBrowseModeChanged = false; const SfxItemSet *pArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -396,6 +447,19 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetCrossHair( bFlag ); break; + case SID_BROWSER_MODE: + case FN_PRINT_LAYOUT: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->getBrowseMode(); + else if( nSlot == FN_PRINT_LAYOUT ) + bFlag = !bFlag; + bBrowseModeChanged = bFlag != pOpt->getBrowseMode(); + // Disable "multiple layout" + GetDocShell()->ToggleBrowserMode( bFlag, this ); + + pOpt->setBrowseMode( bFlag ); + break; + case FN_VIEW_NOTES: if ( STATE_TOGGLE == eState ) bFlag = !pOpt->IsPostIts(); @@ -524,6 +588,11 @@ void SwView::ExecViewOptions(SfxRequest &rReq) if( !(*rSh.GetViewOptions() == *pOpt )) { rSh.ApplyViewOptions( *pOpt ); + if( bBrowseModeChanged ) + { + RecheckBrowseMode(); + CheckVisArea(); + } //Die UsrPref muessen als Modified gekennzeichnet werden. //call for initialization @@ -544,6 +613,8 @@ void SwView::ExecViewOptions(SfxRequest &rReq) const BOOL bLockedView = rSh.IsViewLocked(); rSh.LockView( TRUE ); //lock visible section GetWrtShell().EndAction(); + if( bBrowseModeChanged && !bFlag ) + CalcVisArea( GetEditWin().GetOutputSizePixel() ); rSh.LockView( bLockedView ); delete pOpt; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index e19e06916145..dcbbbfb80796 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1224,8 +1224,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet) { const SwViewOption* pVOpt = rShell.GetViewOptions(); SvxZoomType eZoom = (SvxZoomType) pVOpt->GetZoomType(); - SvxZoomItem aZoom(eZoom, pVOpt->GetZoom()); - if(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) + SvxZoomItem aZoom(eZoom, + pVOpt->GetZoom()); + if( pVOpt->getBrowseMode() ) { aZoom.SetValueSet( SVX_ZOOM_ENABLE_50| @@ -1576,7 +1577,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) SfxItemSet aCoreSet(pShell->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT, 0 ); SvxZoomItem aZoom( (SvxZoomType)rViewOptions.GetZoomType(), rViewOptions.GetZoom() ); - const bool bBrowseMode = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const bool bBrowseMode = rSh.GetViewOptions()->getBrowseMode(); if( bBrowseMode ) { aZoom.SetValueSet( diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index b343619f2ea8..8ccc1988f0c0 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -75,7 +75,7 @@ static USHORT nPgNum = 0; BOOL SwView::IsDocumentBorder() { return GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || - pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || + pWrtShell->GetViewOptions()->getBrowseMode() || SVX_ZOOM_PAGEWIDTH_NOBORDER == (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(); } @@ -199,13 +199,24 @@ aDocSz = rSz; BOOL bModified = false; SwTwips lGreenOffset = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; SwTwips lTmp = aDocSz.Width() + lGreenOffset; + Size aEditSz( GetEditWin().PixelToLogic( GetEditWin().GetOutputSizePixel() ) ); + if( !pWrtShell->GetViewOptions()->getBrowseMode() && + lTmp < aEditSz.Width()) + { + aNewVisArea.Left() = - (aEditSz.Width() - lTmp) / 2; + aNewVisArea.Right() = aEditSz.Width() + aNewVisArea.Left(); + bModified = true; + } + else + { if ( aNewVisArea.Right() >= lTmp ) { lTmp = aNewVisArea.Right() - lTmp; aNewVisArea.Right() -= lTmp; aNewVisArea.Left() -= lTmp; - bModified = TRUE; + bModified = true; + } } lTmp = aDocSz.Height() + lGreenOffset; @@ -214,7 +225,7 @@ aDocSz = rSz; lTmp = aNewVisArea.Bottom() - lTmp; aNewVisArea.Bottom() -= lTmp; aNewVisArea.Top() -= lTmp; - bModified = TRUE; + bModified = true; } if ( bModified ) @@ -249,7 +260,8 @@ void SwView::SetVisArea( const Rectangle &rRect, BOOL bUpdateScrollbar ) aLR.Bottom() += lMin - aLR.Top(); aLR.Top() = lMin; } - if( aLR.Left() < lMin ) + if( pWrtShell->GetViewOptions()->getBrowseMode() && + aLR.Left() < lMin ) { aLR.Right() += lMin - aLR.Left(); aLR.Left() = lMin; @@ -354,7 +366,7 @@ void SwView::SetVisArea( const Point &rPt, BOOL bUpdateScrollbar ) void SwView::CheckVisArea() { - pHScrollbar->SetAuto( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + pHScrollbar->SetAuto( pWrtShell->GetViewOptions()->getBrowseMode() && !GetViewFrame()->GetFrame().IsInPlace() ); if ( IsDocumentBorder() ) { @@ -713,7 +725,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) if ( pScrollbar->GetType() == SCROLL_DRAG ) pWrtShell->EnableSmooth( FALSE ); - if(!pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && + if(!pWrtShell->GetViewOptions()->getBrowseMode() && pScrollbar->GetType() == SCROLL_DRAG) { //Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist. @@ -824,15 +836,32 @@ void SwView::CalcVisArea( const Size &rOutPixel ) //Die Verschiebungen nach rechts und/oder unten koennen jetzt falsch //sein (z.B. Zoom aendern, Viewgroesse aendern. const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2; - if ( aRect.Left() ) + + if( !pWrtShell->GetViewOptions()->getBrowseMode() && + aDocSz.Width() < aRect.GetWidth()) + { + //#i1761# if the document is smaller than the Window then put it to the center of the window + long lDelta = (aDocSz.Width() + lBorder - aRect.GetWidth())/2; + aRect.Right() = aRect.GetWidth() + lDelta; + aRect.Left() = lDelta; + } + else { const long lWidth = GetWrtShell().GetDocSize().Width() + lBorder; + if ( aRect.Left() > 0 ) + { if ( aRect.Right() > lWidth ) { long lDelta = aRect.Right() - lWidth; aRect.Left() -= lDelta; aRect.Right() -= lDelta; } + } + else if( aRect.Left() < 0 ) + { + aRect.Right() = aRect.GetWidth(); + aRect.Left() = 0; + } } if ( aRect.Top() ) { @@ -881,7 +910,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, BOOL /*bInner*/ ) } //#i32913# in browse mode the visibility of the horizontal scrollbar // depends on the content (fixed width tables may require a scrollbar) - if ( pHScrollbar->IsVisible(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) ) + if ( pHScrollbar->IsVisible(pWrtShell->GetViewOptions()->getBrowseMode()) ) rToFill.Bottom() = nTmp; SetBorderPixel( rToFill ); @@ -1121,7 +1150,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) bInOuterResizePixel = TRUE; // feststellen, ob Scrollbars angezeigt werden duerfen - BOOL bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + BOOL bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); BOOL bShowH = FALSE, bShowV = FALSE, bAuto = FALSE, @@ -1214,7 +1243,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) pDocSh->SetVisArea( pDocSh->SfxInPlaceObject::GetVisArea() );*/ if ( pWrtShell->GetViewOptions()->GetZoomType() != SVX_ZOOM_PERCENT && - !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + !pWrtShell->GetViewOptions()->getBrowseMode() ) _SetZoom( aEditSz, (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(), 100, TRUE ); pWrtShell->EndAction(); @@ -1274,7 +1303,7 @@ void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY ) Size SwView::GetOptimalSizePixel() const { Size aPgSize; - if ( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + if ( pWrtShell->GetViewOptions()->getBrowseMode() ) aPgSize = SvxPaperInfo::GetPaperSize(PAPER_A4); else { diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index 44e314a7475b..fc5ddc48c77d 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -277,8 +277,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) FRMTYPE_DRAWOBJ : rSh.GetFrmType(0,TRUE); const BOOL bFrmSelection = rSh.IsFrmSelected(); - const BOOL bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); - + const BOOL bBrowse = rSh.GetViewOptions()->getBrowseMode(); const USHORT nSlot = rReq.GetSlot(); const USHORT nDescId = rSh.GetCurPageDesc(); @@ -915,7 +914,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) const BOOL bFrmSelection = rSh.IsFrmSelected(); - const BOOL bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const BOOL bBrowse = rSh.GetViewOptions()->getBrowseMode(); // PageOffset/Begrenzer const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, pPt ); const SwRect& rPagePrtRect = rSh.GetAnyCurRect( RECT_PAGE_PRT, pPt ); diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index bb0fde6b1fb4..7d67b91afeb8 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -788,8 +788,13 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c break; case HANDLE_VIEWSET_ONLINE_LAYOUT : { - if( pView && !bVal != !pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) - pView->GetDocShell()->ToggleBrowserMode(bVal, pView ); + if( pView && !bVal != !pView->GetWrtShell().GetViewOptions()->getBrowseMode() ) + { + SwViewOption aOpt( *pView->GetWrtShell().GetViewOptions() ); + aOpt.setBrowseMode( bVal ); + pView->GetWrtShell().ApplyViewOptions( aOpt ); + pView->RecheckBrowseMode(); + } } break; case HANDLE_VIEWSET_HELP_URL : @@ -977,7 +982,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u break; case HANDLE_VIEWSET_ONLINE_LAYOUT: if(pView) - bBoolVal = pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + bBoolVal = pView->GetWrtShell().GetViewOptions()->getBrowseMode(); break; case HANDLE_VIEWSET_HELP_URL : { diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index a4167da88748..60e60c2e227e 100755 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2686,12 +2686,18 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( { SwDocShell *pRenderDocShell = pDoc->GetDocShell(); SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell(); + if (!pWrtShell->GetLayout()) + return 0; + if (bFormat) { // #i38289 - if(pDoc->get(IDocumentSettingAccess::BROWSE_MODE)) + if( pWrtShell && pWrtShell->GetViewOptions()->getBrowseMode() ) { - pRenderDocShell->ToggleBrowserMode(false,NULL); + SwViewOption aOpt( *pWrtShell->GetViewOptions() ); + aOpt.setBrowseMode( false ); + pWrtShell->ApplyViewOptions( aOpt ); + pWrtShell->GetView().RecheckBrowseMode(); } if (!pWrtShell) @@ -2739,7 +2745,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // there is no time to sort this out. //TODO: check what exatly needs to be done and make just one function for that pWrtShell->CalcLayout(); - pWrtShell->CalcPagesForPrint( pDoc->GetPageCount() ); + pWrtShell->CalcPagesForPrint( pWrtShell->GetPageCount() ); pWrtShell->SetPDFExportOption( sal_False ); @@ -2748,7 +2754,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( pWrtShell->EndAction(); } - const sal_Int32 nPageCount = pDoc->GetPageCount(); + const sal_Int32 nPageCount = pWrtShell->GetPageCount(); // // get number of pages to be rendered @@ -2756,7 +2762,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); if (bPrintProspect) { - pDoc->CalculatePagePairsForProspectPrinting( *m_pRenderData, *m_pPrintUIOptions, nPageCount ); + pDoc->CalculatePagePairsForProspectPrinting( *pWrtShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, nPageCount ); nRet = m_pRenderData->GetPagePairsForProspectPrinting().size(); } else @@ -2770,7 +2776,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // get set of valid document pages (according to the current settings) // and their start frames - pDoc->CalculatePagesForPrinting( *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount ); + pDoc->CalculatePagesForPrinting( *pWrtShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount ); if (nPostItMode != POSTITS_NONE) { @@ -2826,6 +2832,12 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( // Thus instead of throwing the exception we silently return. if (0 > nRenderer) throw IllegalArgumentException(); + + const TypeId aSwViewTypeId = TYPE(SwView); + ViewShell* pVwSh = pView->IsA(aSwViewTypeId) ? + ((SwView*)pView)->GetWrtShellPtr() : + ((SwPagePreView*)pView)->GetViewShell(); + sal_Int32 nMaxRenderer = 0; if (!bIsSwSrcView && m_pRenderData) { @@ -2884,7 +2896,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( // we just state what output size we would need // which may cause vcl to set that page size on the printer // (if available and not overriden by the user) - aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages ); + aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages ); aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ), TWIP_TO_MM100( aTmpSize.Height() )); } @@ -2892,7 +2904,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( } else { - aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages ); + aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages ); aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ), TWIP_TO_MM100( aTmpSize.Height() )); } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 0504fb1107ad..ebc5243eecfd 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -1053,7 +1053,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( sal_Int32 nCount = -1; if (nWID == WID_PAGE_COUNT) - nCount = m_pView->GetDocShell()->GetDoc()->GetPageCount(); + nCount = m_pView->GetWrtShell().GetPageCount(); else // WID_LINE_COUNT nCount = m_pView->GetWrtShell().GetLineCount( FALSE /*of whole document*/ ); aRet <<= nCount; diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx index 6fdf8f9f9449..317aa64c46ca 100644 --- a/sw/source/ui/vba/vbainformationhelper.cxx +++ b/sw/source/ui/vba/vbainformationhelper.cxx @@ -32,6 +32,7 @@ #include #include #include +#include using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -58,7 +59,9 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css sal_Int32 nCurrentPos = xTVCursor->getPosition().Y; sal_Int32 nCurrentPage = handleWdActiveEndPageNumber( xTVCursor ); - sal_Int32 nPageHeight = word::getDocShell( xModel )->GetDoc()->GetPageSize( nCurrentPage, sal_False ).Height(); + SwDoc* pDoc = word::getDocShell( xModel )->GetDoc(); + ViewShell* pViewSh = pDoc->GetCurrentViewShell(); + sal_Int32 nPageHeight = pViewSh ? pViewSh->GetPageSize( nCurrentPage, sal_False ).Height() : 0; // FIXME: handle multipul page style // it is very strange that the curros position is incorrect when open Word file. // e.g. if current cursor in the top left of the text body of the first page without header, diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx index 82dfacf4f18d..cb0f5ce90091 100644 --- a/sw/source/ui/vba/wordvbahelper.cxx +++ b/sw/source/ui/vba/wordvbahelper.cxx @@ -34,6 +34,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::ooo::vba; @@ -84,7 +85,8 @@ uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame sal_Int32 getPageCount( const uno::Reference< frame::XModel>& xModel ) throw (uno::RuntimeException) { SwDocShell* pDocShell = getDocShell( xModel ); - return pDocShell ? pDocShell->GetDoc()->GetPageCount() : 0; + ViewShell* pViewSh = pDocShell ? pDocShell->GetDoc()->GetCurrentViewShell() : 0; + return pViewSh ? pViewSh->GetPageCount() : 0; } } // word -- cgit From 0e3443faef3a520947aa50ca1e301284877fad2a Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 11 Mar 2011 14:33:15 +0100 Subject: obo55: #164395# Calc 1.0 import (by NN) --- sc/source/filter/starcalc/scflt.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index a7d0150ee220..07f2462041d4 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -414,7 +414,10 @@ Sc10FontData::Sc10FontData(SvStream& rStream) rStream >> PitchAndFamily; sal_uInt16 nLen; rStream >> nLen; - rStream.Read(FaceName, nLen); + if (nLen < sizeof(FaceName)) + rStream.Read(FaceName, nLen); + else + rStream.SetError(ERRCODE_IO_WRONGFORMAT); } @@ -452,10 +455,14 @@ Sc10NameData::Sc10NameData(SvStream& rStream) sal_uInt8 nLen; rStream >> nLen; rStream.Read(Name, sizeof(Name) - 1); + if (nLen >= sizeof(Name)) + nLen = sizeof(Name) - 1; Name[nLen] = 0; rStream >> nLen; rStream.Read(Reference, sizeof(Reference) - 1); + if (nLen >= sizeof(Reference)) + nLen = sizeof(Reference) - 1; Reference[nLen] = 0; rStream.Read(Reserved, sizeof(Reserved)); } @@ -1452,6 +1459,8 @@ void Sc10Import::LoadTables() sal_uInt8 nLen; rStream >> nLen; rStream.Read(TabName, sizeof(TabName) - 1); + if (nLen >= sizeof(TabName)) + nLen = sizeof(TabName) - 1; TabName[nLen] = 0; //---------------------------------------------------------- @@ -1684,7 +1693,7 @@ void Sc10Import::LoadCol(SCCOL Col, SCTAB Tab) { /*double Value =*/ ScfTools::ReadLongDouble(rStream); sal_uInt8 Len; - sal_Char s[256]; + sal_Char s[256+1]; //rStream.Read(&Value, sizeof(Value)); rStream >> Len; rStream.Read(&s[1], Len); -- cgit From e1a85d5fb9bc8fe4e48b2448542390a5d3b2bd9f Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 15 Oct 2010 09:25:36 +0200 Subject: obo55: #163912# fix hairline drawing related artifacts obo55: #163911# update visible range when switching sheets Authors: Herbert Duerr [hdu] Niklas Nebel --- sc/source/ui/inc/gridwin.hxx | 2 ++ sc/source/ui/inc/tabview.hxx | 2 ++ sc/source/ui/view/gridwin.cxx | 20 ++++++++++++++++++++ sc/source/ui/view/tabview3.cxx | 9 +++++++++ 4 files changed, 33 insertions(+) diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index aad45058de2c..3e6a7eb6085a 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -395,6 +395,8 @@ public: void UpdateDPFromFieldPopupMenu(); + void UpdateVisibleRange(); + // #114409# void CursorChanged(); void DrawLayerCreated(); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 9c3327805a88..09861e778826 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -194,6 +194,8 @@ private: void UpdateVarZoom(); + void UpdateVisibleRange(); + static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL ); static long GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index d350da754433..335f5ad14490 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5100,6 +5100,26 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen return sal_False; } +void ScGridWindow::UpdateVisibleRange() +{ + // #163911# Update the visible range outside of paint (called when switching sheets). + // Use the same logic here as in ScGridWindow::Draw. + + SCCOL nPosX = pViewData->GetPosX( eHWhich ); + SCROW nPosY = pViewData->GetPosY( eVWhich ); + + SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich); + if (nXRight > MAXCOL) nXRight = MAXCOL; + SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich); + if (nYBottom > MAXROW) nYBottom = MAXROW; + + // Store the current visible range. + maVisibleRange.mnCol1 = nPosX; + maVisibleRange.mnCol2 = nXRight; + maVisibleRange.mnRow1 = nPosY; + maVisibleRange.mnRow2 = nYBottom; +} + // #114409# void ScGridWindow::DrawLayerCreated() { diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 19289e4cf703..6265d823001b 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1548,6 +1548,12 @@ void ScTabView::SelectNextTab( short nDir, sal_Bool bExtendSelection ) PaintExtras(); } +void ScTabView::UpdateVisibleRange() +{ + for (sal_uInt16 i=0; i<4; i++) + if (pGridWin[i] && pGridWin[i]->IsVisible()) + pGridWin[i]->UpdateVisibleRange(); +} // SetTabNo - angezeigte Tabelle @@ -1736,6 +1742,9 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection, RepeatResize(); InvalidateSplit(); + // #163911# Update the visible range in each GridWin directly, don't wait for the repaint event. + UpdateVisibleRange(); + if ( aViewData.IsPagebreakMode() ) UpdatePageBreakData(); //! asynchron ?? -- cgit From cdeae7ac60074f97a1214c486f95c1273c187c80 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 15 Oct 2010 09:25:36 +0200 Subject: obo55: #163912# fix hairline drawing related artifacts obo55: #163911# update visible range when switching sheets Authors: Herbert Duerr [hdu] Niklas Nebel --- vcl/unx/source/gdi/salgdi.cxx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index dc1ec968d859..df23220ea6d5 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1217,6 +1217,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double aPolygon.transform( basegfx::tools::createTranslateB2DHomMatrix(+fHalfWidth,+fHalfWidth) ); // shortcut for hairline drawing to improve performance + bool bDrawnOk = true; if( bIsHairline ) { // hairlines can benefit from a simplified tesselation @@ -1225,17 +1226,13 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); // draw tesselation result - if( ! aB2DTrapVector.empty() ) - { - const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + const int nTrapCount = aB2DTrapVector.size(); + if( nTrapCount > 0 ) + bDrawnOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); - // restore the original brush GC - nBrushColor_ = aKeepBrushColor; - return bDrawOk; - } - else - return true; + // restore the original brush GC + nBrushColor_ = aKeepBrushColor; + return bDrawnOk; } // get the area polygon for the line polygon @@ -1258,19 +1255,18 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double // draw each area polypolygon component individually // to emulate the polypolygon winding rule "non-zero" - bool bDrawOk = true; const int nPolyCount = aAreaPolyPoly.count(); for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) ); - bDrawOk = drawPolyPolygon( aOnePoly, fTransparency ); - if( !bDrawOk ) + bDrawnOk = drawPolyPolygon( aOnePoly, fTransparency ); + if( !bDrawnOk ) break; } // restore the original brush GC nBrushColor_ = aKeepBrushColor; - return bDrawOk; + return bDrawnOk; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- cgit From e06b38bf6b2d483ff996854e27fcb0d47d78ab0c Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 2 Nov 2010 09:55:12 +0100 Subject: CWS swlayoutrefactoring: resolve conflicts after resync to m91 --- sw/source/core/crsr/crsrsh.cxx | 16 ---------------- sw/source/core/doc/doc.cxx | 35 ----------------------------------- sw/source/core/frmedt/feshview.cxx | 6 +----- sw/source/core/layout/pagechg.cxx | 8 -------- 4 files changed, 1 insertion(+), 64 deletions(-) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ee61fedeeb06..33c9a9fb71c4 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3305,22 +3305,6 @@ String SwCrsrShell::GetCrsrDescr() const return aResult; } -<<<<<<< local -SwRect SwCrsrShell::GetRectOfCurrentChar() -{ - SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), 0, pCurCrsr->GetPoint(), FALSE ); - SwRect aRet; - SwCrsrMoveState aTmpState( MV_NONE ); - aTmpState.bRealHeight = TRUE; - pFrm->GetCharRect( aRet, *pCurCrsr->GetPoint(), &aTmpState ); - //const SwTwips nRealHeight = aTmpState.aRealHeight.Y(); - if (aTmpState.aRealHeight.X() != 0) - aRet.Top(aRet.Top() + aTmpState.aRealHeight.X()); - return aRet; -} - -======= ->>>>>>> other // SMARTTAGS void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes, diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 81bd3432a558..d866a41a3016 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1707,41 +1707,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // thus we are done here. } -<<<<<<< local -======= - -sal_uInt16 SwDoc::GetPageCount() const -{ - return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; -} - -const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const -{ - Size aSize; - if ( GetRootFrm() && nPageNum ) - { - const SwPageFrm* pPage = static_cast - (GetRootFrm()->Lower()); - - while ( --nPageNum && pPage->GetNext() ) - { - pPage = static_cast( pPage->GetNext() ); - } - - // switch to next page for an empty page, if empty pages are not skipped - // in order to get a sensible page size for an empty page - e.g. for printing. - if ( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) - { - pPage = static_cast( pPage->GetNext() ); - } - - aSize = pPage->Frm().SSize(); - } - return aSize; -} - - ->>>>>>> other /************************************************************************* * void UpdateDocStat( const SwDocStat& rStat ); *************************************************************************/ diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index f446e885e00e..844d2b569547 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -599,11 +599,7 @@ bool SwFEShell::IsSelContainsControl() const // if we have one marked object, get the SdrObject and check // whether it contains a control const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj(); -<<<<<<< local - bRet = pSdrObject && CheckControlLayer( pSdrObject ); -======= - bRet = ::CheckControlLayer( pSdrObject ); ->>>>>>> other + bRet = pSdrObject && ::CheckControlLayer( pSdrObject ); } return bRet; } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 430de97ddf64..828729d74a53 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1394,19 +1394,11 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn ) sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const { -<<<<<<< local ViewShell *pSh = getRootFrm()->GetCurrShell(); if( !pSh || pSh->GetViewOptions()->getBrowseMode() ) - return sw::sidebarwindows::SIDEBAR_NONE; -======= - if ( !GetShell() || - GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) { - // --> OD 2010-06-03 #i111964# - provide default sidebar position return sw::sidebarwindows::SIDEBAR_RIGHT; - // <-- } ->>>>>>> other else { const bool bLTR = getRootFrm()->IsLeftToRightViewLayout(); -- cgit From f9ae468e1cb8242ce7a9b1b33ca202fd0f649841 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 2 Nov 2010 17:22:33 +0100 Subject: CWS swlayoutrefactoring: warning fixed --- sw/source/core/view/vnew.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 4f72891eefdb..a1b2805cbfa2 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -111,7 +111,6 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) // --> FME 2005-01-21 #i41075# // Only setup the printer if we need one: - const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); const bool bBrowseMode = pOpt->getBrowseMode(); if( pPDFOut ) InitPrt( pPDFOut ); -- cgit From 2f9f480b22f2fff59d9c48b4b46706c3d5223e66 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 3 Nov 2010 15:31:40 +0100 Subject: CWS swlayoutrefactoring: found logical conflict after resync: not every view has a WrtShell, so try to do printing with ViewShell where possible --- sw/inc/printdata.hxx | 6 +-- sw/inc/unotxdoc.hxx | 8 +-- sw/source/core/view/printdata.cxx | 4 +- sw/source/ui/uno/unotxdoc.cxx | 103 ++++++++++++++++++++++---------------- 4 files changed, 68 insertions(+), 53 deletions(-) mode change 100755 => 100644 sw/inc/printdata.hxx mode change 100755 => 100644 sw/inc/unotxdoc.hxx diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx old mode 100755 new mode 100644 index f76ac65e747a..c8875e856eb8 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -46,7 +46,7 @@ class SwViewOption; class OutputDevice; class SwViewOptionAdjust_Impl; class SwPrtOptions; -class SwWrtShell; +class ViewShell; class SfxViewShell; // forward declarations @@ -267,8 +267,8 @@ public: void DeletePostItData(); bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } - bool NeedNewViewOptionAdjust( const SwWrtShell& ) const; - void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ); + bool NeedNewViewOptionAdjust( const ViewShell& ) const; + void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions ); void ViewOptionAdjust( const SwPrtOptions *pPrtOptions ); void ViewOptionAdjustStop(); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx old mode 100755 new mode 100644 index b50d5b0a1b76..b2d163ae92a0 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -130,7 +130,7 @@ class SwPrintUIOptions; class SwPrintData; class SwRenderData; class SwPrtOptions; -class SwWrtShell; +class ViewShell; typedef UnoActionContext* UnoActionContextPtr; @@ -597,18 +597,18 @@ public: -----------------------------------------------------------------------*/ class SwViewOptionAdjust_Impl { - SwWrtShell & m_rShell; + ViewShell & 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 SwViewOption &rViewOptions ); + SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ); ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( const SwPrtOptions *pPrtOptions ); - bool checkShell( const SwWrtShell& rCompare ) const + bool checkShell( const ViewShell& rCompare ) const { return &rCompare == &m_rShell; } }; diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index d6cbf11b8731..6ba592a9ca5c 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -111,13 +111,13 @@ void SwRenderData::DeletePostItData() } } -bool SwRenderData::NeedNewViewOptionAdjust( const SwWrtShell& rCompare ) const +bool SwRenderData::NeedNewViewOptionAdjust( const ViewShell& rCompare ) const { return m_pViewOptionAdjust ? ! m_pViewOptionAdjust->checkShell( rCompare ) : true; } -void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ) +void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions ) { if (m_pViewOptionAdjust) { diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 0a047fb7679c..e038b00577b2 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2375,10 +2375,10 @@ void SwXTextDocument::refresh(void) throw( RuntimeException ) ::vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) throw RuntimeException(); - SwWrtShell *pWrtShell = pDocShell->GetWrtShell(); + ViewShell *pViewShell = pDocShell->GetWrtShell(); notifyRefreshListeners(); - if(pWrtShell) - pWrtShell->CalcLayout(); + if(pViewShell) + pViewShell->CalcLayout(); } /*-- 21.02.00 08:41:06--------------------------------------------------- @@ -2685,48 +2685,59 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( else { SwDocShell *pRenderDocShell = pDoc->GetDocShell(); - SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell(); - if (!pWrtShell->GetLayout()) + + // TODO/mba: we really need a generic way to get the ViewShell! + ViewShell* pViewShell = 0; + SwView* pSwView = PTR_CAST(SwView, pView); + if ( pSwView ) + { + pViewShell = pSwView->GetWrtShellPtr(); + } + else + { + if ( bIsPDFExport && bFormat ) + { + //create a hidden view to be able to export as PDF also in print preview + //pView and pSwView are not changed intentionally! + m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 ); + pViewShell = ((SwView*)m_pHiddenViewFrame->GetViewShell())->GetWrtShellPtr(); + } + else + pViewShell = ((SwPagePreView*)pView)->GetViewShell(); + } + + if (!pViewShell || !pViewShell->GetLayout()) return 0; if (bFormat) { // #i38289 - if( pWrtShell && pWrtShell->GetViewOptions()->getBrowseMode() ) + if( pViewShell->GetViewOptions()->getBrowseMode() ) { - SwViewOption aOpt( *pWrtShell->GetViewOptions() ); + SwViewOption aOpt( *pViewShell->GetViewOptions() ); aOpt.setBrowseMode( false ); - pWrtShell->ApplyViewOptions( aOpt ); - pWrtShell->GetView().RecheckBrowseMode(); - } - - if (!pWrtShell) - { - //create a hidden view to be able to export as PDF also in print preview - m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 ); - SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell(); - pWrtShell = pSwView->GetWrtShellPtr(); + pViewShell->ApplyViewOptions( aOpt ); + pSwView->RecheckBrowseMode(); } // reformating the document for printing will show the changes in the view // which is likely to produce many unwanted and not nice to view actions. // We don't want that! Thus we disable updating of the view. - pWrtShell->StartAction(); + pViewShell->StartAction(); - const TypeId aSwViewTypeId = TYPE(SwView); - if (pView->IsA(aSwViewTypeId)) + if (pSwView) { - if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) ) + if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) ) m_pRenderData->ViewOptionAdjustStop(); if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust()) - m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() ); + m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() ); } m_pRenderData->SetSwPrtOptions( new SwPrtOptions( C2U( bIsPDFExport ? "PDF export" : "Printing" ) ) ); m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); - if (pView->IsA(aSwViewTypeId)) + if (pSwView) { // PDF export should not make use of the SwPrtOptions const SwPrtOptions *pPrtOptions = bIsPDFExport? NULL : m_pRenderData->GetSwPrtOptions(); @@ -2735,7 +2746,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // since printing now also use the API for PDF export this option // should be set for printing as well ... - pWrtShell->SetPDFExportOption( sal_True ); + pViewShell->SetPDFExportOption( sal_True ); bool bOrigStatus = pRenderDocShell->IsEnableSetModified(); // check configuration: shall update of printing information in DocInfo set the document to "modified"? bool bStateChanged = false; @@ -2745,9 +2756,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( bStateChanged = true; } - // --> FME 2005-05-23 #122919# Force field update before PDF export: - pWrtShell->ViewShell::UpdateFlds(TRUE); + pViewShell->UpdateFlds(TRUE); // <-- if( bStateChanged ) pRenderDocShell->EnableSetModified( sal_True ); @@ -2755,17 +2765,16 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // there is some redundancy between those two function calls, but right now // there is no time to sort this out. //TODO: check what exatly needs to be done and make just one function for that - pWrtShell->CalcLayout(); - pWrtShell->CalcPagesForPrint( pWrtShell->GetPageCount() ); - - pWrtShell->SetPDFExportOption( sal_False ); + pViewShell->CalcLayout(); + pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() ); + pViewShell->SetPDFExportOption( sal_False ); // enable view again - pWrtShell->EndAction(); + pViewShell->EndAction(); } - const sal_Int32 nPageCount = pWrtShell->GetPageCount(); + const sal_Int32 nPageCount = pViewShell->GetPageCount(); // // get number of pages to be rendered @@ -2773,7 +2782,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); if (bPrintProspect) { - pDoc->CalculatePagePairsForProspectPrinting( *pWrtShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, nPageCount ); + pDoc->CalculatePagePairsForProspectPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, nPageCount ); nRet = m_pRenderData->GetPagePairsForProspectPrinting().size(); } else @@ -2782,12 +2791,12 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( if (nPostItMode != POSTITS_NONE) { OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); - m_pRenderData->CreatePostItData( pDoc, pWrtShell->GetViewOptions(), pOutDev ); + m_pRenderData->CreatePostItData( pDoc, pViewShell->GetViewOptions(), pOutDev ); } // get set of valid document pages (according to the current settings) // and their start frames - pDoc->CalculatePagesForPrinting( *pWrtShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount ); + pDoc->CalculatePagesForPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount ); if (nPostItMode != POSTITS_NONE) { @@ -2844,10 +2853,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( if (0 > nRenderer) throw IllegalArgumentException(); - const TypeId aSwViewTypeId = TYPE(SwView); - ViewShell* pVwSh = pView->IsA(aSwViewTypeId) ? - ((SwView*)pView)->GetWrtShellPtr() : - ((SwPagePreView*)pView)->GetViewShell(); + // TODO/mba: we really need a generic way to get the ViewShell! + ViewShell* pVwSh = 0; + SwView* pSwView = PTR_CAST(SwView, pView); + if ( pSwView ) + pVwSh = pSwView->GetWrtShellPtr(); + else + pVwSh = ((SwPagePreView*)pView)->GetViewShell(); sal_Int32 nMaxRenderer = 0; if (!bIsSwSrcView && m_pRenderData) @@ -3061,9 +3073,12 @@ void SAL_CALL SwXTextDocument::render( ViewShell* pVwSh = 0; if (pView) { - pVwSh = pView->IsA(aSwViewTypeId) ? - ((SwView*)pView)->GetWrtShellPtr() : - ((SwPagePreView*)pView)->GetViewShell(); + // TODO/mba: we really need a generic way to get the ViewShell! + SwView* pSwView = PTR_CAST(SwView, pView); + if ( pSwView ) + pVwSh = pSwView->GetWrtShellPtr(); + else + pVwSh = ((SwPagePreView*)pView)->GetViewShell(); } // get output device to use @@ -3327,7 +3342,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( } } - //get languages from "drawobject" + //TODO/mba: it's a strange concept that a view is needed to retrieve core data SwWrtShell *pWrtSh = pDocShell->GetWrtShell(); SdrView *pSdrView = pWrtSh->GetDrawView(); @@ -4109,7 +4124,7 @@ void SwXDocumentPropertyHelper::onChange() /*****************************************************************************/ -SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) : +SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ) : m_rShell( rSh ), m_aOldViewOptions( rViewOptions ) { -- cgit From 858fcd359f72f14fca1d400700e1bd113db7f8b5 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Tue, 23 Nov 2010 18:24:20 +0100 Subject: chart51: #i112773# fix exponential fit for small values (Patch from Regina) --- .../inc/ExponentialRegressionCurveCalculator.hxx | 7 +- .../tools/ExponentialRegressionCurveCalculator.cxx | 77 +++++++++++++--------- 2 files changed, 50 insertions(+), 34 deletions(-) diff --git a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx index 91c3034ea79c..acecde281001 100644 --- a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx +++ b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx @@ -63,9 +63,10 @@ private: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - // formula is: f(x) = m_fSlope ^ x + m_fIntercept - double m_fSlope; - double m_fIntercept; + // formula is: f(x) = exp(m_fLogIntercept) * exp( m_fLogSlope * x ) + // mathematical model f(x) = Intercept * Slope^x + double m_fLogSlope; + double m_fLogIntercept; }; } // namespace chart diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx index d7bb86174323..495be222b6f4 100644 --- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx +++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx @@ -43,11 +43,11 @@ namespace chart { ExponentialRegressionCurveCalculator::ExponentialRegressionCurveCalculator() : - m_fSlope( 0.0 ), - m_fIntercept( 0.0 ) + m_fLogSlope( 0.0 ), + m_fLogIntercept( 0.0 ) { - ::rtl::math::setNan( & m_fSlope ); - ::rtl::math::setNan( & m_fIntercept ); + ::rtl::math::setNan( & m_fLogSlope ); + ::rtl::math::setNan( & m_fLogIntercept ); } ExponentialRegressionCurveCalculator::~ExponentialRegressionCurveCalculator() @@ -67,9 +67,9 @@ void SAL_CALL ExponentialRegressionCurveCalculator::recalculateRegression( const size_t nMax = aValues.first.size(); if( nMax == 0 ) { - ::rtl::math::setNan( & m_fSlope ); - ::rtl::math::setNan( & m_fIntercept ); - ::rtl::math::setNan( & m_fCorrelationCoeffitient ); + ::rtl::math::setNan( & m_fLogSlope ); + ::rtl::math::setNan( & m_fLogIntercept ); + ::rtl::math::setNan( & m_fCorrelationCoeffitient );// actual it is coefficient of determination return; } @@ -96,12 +96,10 @@ void SAL_CALL ExponentialRegressionCurveCalculator::recalculateRegression( fQxy += fDeltaX * fDeltaY; } - m_fSlope = fQxy / fQx; - m_fIntercept = fAverageY - m_fSlope * fAverageX; + m_fLogSlope = fQxy / fQx; + m_fLogIntercept = fAverageY - m_fLogSlope * fAverageX; m_fCorrelationCoeffitient = fQxy / sqrt( fQx * fQy ); - m_fSlope = exp( m_fSlope ); - m_fIntercept = exp( m_fIntercept ); } double SAL_CALL ExponentialRegressionCurveCalculator::getCurveValue( double x ) @@ -111,10 +109,10 @@ double SAL_CALL ExponentialRegressionCurveCalculator::getCurveValue( double x ) double fResult; ::rtl::math::setNan( & fResult ); - if( ! ( ::rtl::math::isNan( m_fSlope ) || - ::rtl::math::isNan( m_fIntercept ))) + if( ! ( ::rtl::math::isNan( m_fLogSlope ) || + ::rtl::math::isNan( m_fLogIntercept ))) { - fResult = m_fIntercept * pow( m_fSlope, x ); + fResult = exp(m_fLogIntercept + x * m_fLogSlope); } return fResult; @@ -150,31 +148,48 @@ OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation( const uno::Reference< util::XNumberFormatter >& xNumFormatter, ::sal_Int32 nNumberFormatKey ) const { + double fIntercept = exp(m_fLogIntercept); + double fSlope = exp(m_fLogSlope); + bool bHasSlope = !rtl::math::approxEqual( fSlope, 1.0 ); + bool bHasIntercept = !rtl::math::approxEqual( fIntercept, 1.0 ); + OUStringBuffer aBuf( C2U( "f(x) = " )); - if( m_fIntercept == 0.0 || - m_fSlope == 0.0 ) - { - aBuf.append( sal_Unicode( '0' )); - } - else if( rtl::math::approxEqual( m_fSlope, 1.0 ) ) + if ( fIntercept == 0.0) { - aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept )); + // underflow, a true zero is impossible + aBuf.append( C2U( "exp( " )); + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) ); + aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " )); + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) ); + aBuf.append( C2U( " x )" )); } else { - if( ! rtl::math::approxEqual( m_fIntercept, 1.0 ) ) + if (bHasIntercept) { - aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept )); - aBuf.append( sal_Unicode( 0x00b7 )); + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fIntercept) ); + aBuf.append( C2U( " exp( " )); + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) ); + aBuf.append( C2U( " x )" )); + } + else + { + // show logarithmic output, if intercept and slope both are near one + // otherwise drop output of intercept, which is 1 here + aBuf.append( C2U( " exp( " )); + if (!bHasSlope) + { + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) ); + aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " )); + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) ); + } + else + { + aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) ); + } + aBuf.append( C2U( " x )" )); } - - if( m_fSlope < 0.0 ) - aBuf.append( sal_Unicode( '(' )); - aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope )); - if( m_fSlope < 0.0 ) - aBuf.append( sal_Unicode( ')' )); - aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "^x" )); } return aBuf.makeStringAndClear(); -- cgit From 908e4f71480a904ae6e1f337a85885acecb190a1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:29:47 +0100 Subject: debuglevels: use vsnprintf instead of _vsnprintf, otherwise it won't build on unxlngi6.pro+debug --- slideshow/source/engine/debug.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slideshow/source/engine/debug.cxx b/slideshow/source/engine/debug.cxx index 4c8ba5415f04..f3fd185a58b0 100644 --- a/slideshow/source/engine/debug.cxx +++ b/slideshow/source/engine/debug.cxx @@ -307,7 +307,7 @@ DebugTraceScope::DebugTraceScope (const sal_Char* sFormat, ...) va_start(args, sFormat); msMessage[mnBufferSize-1] = 0; - _vsnprintf(msMessage, mnBufferSize-1, sFormat, args); + vsnprintf(msMessage, mnBufferSize-1, sFormat, args); TRACE_BEGIN("[ %s", msMessage); va_end(args); } -- cgit From 212572f2d3369cc992098248606d46ca9b7c8e9c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Dec 2010 14:27:32 +0100 Subject: dba34c: #i115901#: dispose the local pane's window (after clearing the cache, which will dispose the windows currently anchored to the pane) (transplanted from 6010283465918075d489ba4b589fdc9b11343759) --- sd/source/ui/framework/factories/BasicViewFactory.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 2dd7689f2b39..b7e5d72b9e6c 100755 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -152,6 +153,20 @@ BasicViewFactory::BasicViewFactory ( BasicViewFactory::~BasicViewFactory (void) { + mpViewCache.reset(); + + Reference< awt::XWindow > xLocalPaneWindow( mxLocalPane->getWindow() ); + try + { + const Reference< XComponent > xLocalPaneComponent( mxLocalPane, UNO_QUERY_THROW ); + xLocalPaneComponent->dispose(); + const Reference< XComponent > xWindowComponent( xLocalPaneWindow, UNO_QUERY_THROW ); + xWindowComponent->dispose(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } -- cgit From 52678bf33f29a43d2b7ac11e389fbc62aea69359 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 6 Dec 2010 22:58:33 +0100 Subject: CWS swlayoutrefactoring: #i81480#: fix resync bug from old cvs based cws --- sw/source/ui/uiview/viewport.cxx | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index 8ccc1988f0c0..dec0029551a0 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -199,24 +199,13 @@ aDocSz = rSz; BOOL bModified = false; SwTwips lGreenOffset = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; SwTwips lTmp = aDocSz.Width() + lGreenOffset; - Size aEditSz( GetEditWin().PixelToLogic( GetEditWin().GetOutputSizePixel() ) ); - if( !pWrtShell->GetViewOptions()->getBrowseMode() && - lTmp < aEditSz.Width()) - { - aNewVisArea.Left() = - (aEditSz.Width() - lTmp) / 2; - aNewVisArea.Right() = aEditSz.Width() + aNewVisArea.Left(); - bModified = true; - } - else - { if ( aNewVisArea.Right() >= lTmp ) { lTmp = aNewVisArea.Right() - lTmp; aNewVisArea.Right() -= lTmp; aNewVisArea.Left() -= lTmp; - bModified = true; - } + bModified = true; } lTmp = aDocSz.Height() + lGreenOffset; @@ -260,8 +249,7 @@ void SwView::SetVisArea( const Rectangle &rRect, BOOL bUpdateScrollbar ) aLR.Bottom() += lMin - aLR.Top(); aLR.Top() = lMin; } - if( pWrtShell->GetViewOptions()->getBrowseMode() && - aLR.Left() < lMin ) + if( aLR.Left() < lMin ) { aLR.Right() += lMin - aLR.Left(); aLR.Left() = lMin; @@ -836,32 +824,15 @@ void SwView::CalcVisArea( const Size &rOutPixel ) //Die Verschiebungen nach rechts und/oder unten koennen jetzt falsch //sein (z.B. Zoom aendern, Viewgroesse aendern. const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2; - - if( !pWrtShell->GetViewOptions()->getBrowseMode() && - aDocSz.Width() < aRect.GetWidth()) - { - //#i1761# if the document is smaller than the Window then put it to the center of the window - long lDelta = (aDocSz.Width() + lBorder - aRect.GetWidth())/2; - aRect.Right() = aRect.GetWidth() + lDelta; - aRect.Left() = lDelta; - } - else + if ( aRect.Left() ) { const long lWidth = GetWrtShell().GetDocSize().Width() + lBorder; - if ( aRect.Left() > 0 ) - { if ( aRect.Right() > lWidth ) { long lDelta = aRect.Right() - lWidth; aRect.Left() -= lDelta; aRect.Right() -= lDelta; } - } - else if( aRect.Left() < 0 ) - { - aRect.Right() = aRect.GetWidth(); - aRect.Left() = 0; - } } if ( aRect.Top() ) { -- cgit From 4f26cb529960cf62b669dc697e2e69d50fd5ad51 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 10 Dec 2010 11:57:28 +0100 Subject: #i116037# Don't toggle the calc formula bar when activating and deactivating a chart --- sfx2/inc/sfx2/childwin.hxx | 1 + sfx2/source/appl/childwin.cxx | 3 --- sfx2/source/appl/workwin.cxx | 27 +++++++++++++++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx index fd1eb65d54df..6df820a08b2c 100644 --- a/sfx2/inc/sfx2/childwin.hxx +++ b/sfx2/inc/sfx2/childwin.hxx @@ -60,6 +60,7 @@ class SfxChildWinContextArr_Impl; #define SFX_CHILDWIN_CANTGETFOCUS 0x20 // ChildWindow kann keinen Focus bekommen #define SFX_CHILDWIN_ALWAYSAVAILABLE 0x40 // ChildWindow is never disabled #define SFX_CHILDWIN_NEVERHIDE 0x80 // ChildWindow is can always made visible/is visible +#define SFX_CHILDWIN_NEVERHIDEACTIVEOLE 0x0100 // ChildWindow is visible with active inplace client #define CHILDWIN_NOPOS USHRT_MAX // Konfiguration eines ChildWindows diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index b8e8a92da1b8..40726b96d77b 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -467,12 +467,9 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin if ( nNextPos != STRING_NOTFOUND ) { // es gibt noch Extra-Information - rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1, nNextPos - nPos - 1 ).ToInt32(); aWinData.Erase( nPos, nNextPos-nPos+1 ); rInfo.aExtraString = aWinData; } - else - rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1 ).ToInt32(); } } } diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index f9a388deee5c..b50192e9281c 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -822,7 +822,19 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) if ( pF && pF->GetViewShell() ) pClient = pF->GetViewShell()->GetIPClient(); - if ( pClient ) + bool bForceArrange( false ); + for ( USHORT n = 0; n < pChildWins->Count(); ++n ) + { + SfxChildWin_Impl* pCW = (*pChildWins)[ n ]; + SfxChildWindow* pChild = pCW->pWin; + if ( pChild && ( pCW->aInfo.nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) && pCW->aInfo.bVisible ) + { + bForceArrange = true; + break; + } + } + + if ( pClient && !bForceArrange ) return; aClientArea = GetTopRect_Impl(); @@ -832,7 +844,7 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) SvBorder aBorder; if ( nChilds ) { - if ( IsVisible_Impl() ) + if ( IsVisible_Impl() || bForceArrange ) aBorder = Arrange_Impl(); } @@ -1144,6 +1156,13 @@ void SfxWorkWindow::ShowChilds_Impl() bool bInvisible = ( !IsVisible_Impl() || ( !pWorkWin->IsReallyVisible() && !pWorkWin->IsReallyShown() )); + SfxInPlaceClient* pClient = 0; + SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); + if ( pViewFrame && pViewFrame->GetViewShell() ) + { + pClient = pViewFrame->GetViewShell()->GetIPClient(); + } + SfxChild_Impl *pCli = 0; for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos ) { @@ -1173,6 +1192,7 @@ void SfxWorkWindow::ShowChilds_Impl() // visible. sal_uInt16 nFlags = pCW->aInfo.nFlags; bVisible = !bInvisible || ( bInvisible & (( nFlags & SFX_CHILDWIN_NEVERHIDE ) != 0 )); + bVisible = bVisible || ( pClient && ( nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) ); } if ( CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) && bVisible ) @@ -1645,8 +1665,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) { - if ( pCW->aInfo.bVisible != 42 ) - pCW->aInfo.bVisible = TRUE; + pCW->aInfo.bVisible = TRUE; SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo); if (pChildWin) -- cgit From d6cf918d5158cdc7d543741dcb08bd0580a957af Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 10 Dec 2010 11:57:28 +0100 Subject: #i116037# Don't toggle the calc formula bar when activating and deactivating a chart --- sc/source/ui/app/client.cxx | 10 ++++++++++ sc/source/ui/app/scdll.cxx | 3 +-- sc/source/ui/drawfunc/fusel.cxx | 12 +++++++----- sc/source/ui/inc/client.hxx | 1 + sc/source/ui/view/drawview.cxx | 2 +- sc/source/ui/view/tabvwshb.cxx | 9 ++++++++- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index b1cb325ceb69..2ca326c4acf9 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -254,3 +254,13 @@ void __EXPORT ScClient::MakeVisible() } } +void ScClient::DeactivateObj() +{ + DeactivateObject(); + + ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( GetViewShell() ); + if ( pViewSh ) + { + pViewSh->UpdateInputHandler(); + } +} diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 8051399d06fa..00c0734b26a6 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -287,8 +287,7 @@ void ScDLL::Init() // Child-Windows - // Hack: Eingabezeile mit 42 registrieren, damit sie im PlugIn immer sichtbar ist - ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK); + ScInputWindowWrapper ::RegisterChildWindow( TRUE, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK|SFX_CHILDWIN_NEVERHIDEACTIVEOLE ); ScNavigatorDialogWrapper ::RegisterChildWindowContext( sal::static_int_cast(ScTabViewShell::GetInterfaceId()), pMod); ScSolverDlgWrapper ::RegisterChildWindow(FALSE, pMod); diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 4a456522003c..d17726ad3cb3 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -56,6 +56,7 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "scmod.hxx" +#include "client.hxx" // ----------------------------------------------------------------------- @@ -462,15 +463,16 @@ BOOL __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt) /************************************************************************** * Ggf. OLE-Objekt beruecksichtigen **************************************************************************/ - SfxInPlaceClient* pIPClient = pViewShell->GetIPClient(); - if (pIPClient) + ScClient* pClient = static_cast< ScClient* >( pViewShell->GetIPClient() ); + if ( pClient ) { ScModule* pScMod = SC_MOD(); bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF; - - if ( pIPClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - pIPClient->DeactivateObject(); + if ( pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) + { + pClient->DeactivateObj(); + } } USHORT nClicks = rMEvt.GetClicks(); diff --git a/sc/source/ui/inc/client.hxx b/sc/source/ui/inc/client.hxx index 1b13ee224d77..c8373e6b0bcd 100644 --- a/sc/source/ui/inc/client.hxx +++ b/sc/source/ui/inc/client.hxx @@ -56,6 +56,7 @@ public: SdrGrafObj* GetGrafEdit() const { return pGrafEdit; } void SetGrafEdit(SdrGrafObj* pNew) { pGrafEdit = pNew; } SdrOle2Obj* GetDrawObj(); + void DeactivateObj(); }; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 489da0cc4899..2b913d0ffb73 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -416,7 +416,7 @@ void ScDrawView::MarkListHasChanged() { // #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen //HMHbDisableHdl = TRUE; - pClient->DeactivateObject(); + pClient->DeactivateObj(); //HMHbDisableHdl = FALSE; // Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index c6d9b004b9ba..67ab19d6cdce 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -76,6 +76,7 @@ #include "chartarr.hxx" #include "drawview.hxx" #include "ChartRangeSelectionListener.hxx" +#include "inputhdl.hxx" using namespace com::sun::star; @@ -179,6 +180,12 @@ BOOL ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) bErrorShown = TRUE; // SfxViewShell::DoVerb zeigt seine Fehlermeldungen selber an + ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl( this ); + if ( pInputHdl ) + { + pInputHdl->NotifyChange( NULL ); + } + // attach listener to selection changes in chart that affect cell // ranges, so those can be highlighted // note: do that after DoVerb, so that the chart controller exists @@ -263,7 +270,7 @@ void ScTabViewShell::DeactivateOle() ScClient* pClient = (ScClient*) GetIPClient(); if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - pClient->DeactivateObject(); + pClient->DeactivateObj(); } void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) -- cgit From 162bc1aa8059120e60c2bf0fc111193468f15cff Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 15 Dec 2010 15:05:17 +0100 Subject: CWS swlayoutrefactoring: #i81480#: sometimes there is no ViewShell --- sw/source/core/doc/doclay.cxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 63a278cdc0c7..3c6357ba4aad 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -2314,16 +2314,24 @@ SwRootFrm *SwDoc::GetCurrentLayout(){ return GetCurrentViewShell()->GetLayout(); return 0; } -std::set SwDoc::GetAllLayouts(){ + +std::set SwDoc::GetAllLayouts() +{ std::set aAllLayouts; ViewShell *pStart = GetCurrentViewShell(); ViewShell *pTemp = pStart; - do { - if (pTemp->GetLayout()) { - aAllLayouts.insert(pTemp->GetLayout()); - pTemp = (ViewShell*)pTemp->GetNext(); - } - } while(pTemp!=pStart); + if ( pTemp ) + { + do + { + if (pTemp->GetLayout()) + { + aAllLayouts.insert(pTemp->GetLayout()); + pTemp = (ViewShell*)pTemp->GetNext(); + } + } while(pTemp!=pStart); + } + return aAllLayouts; }//swmod 070825 -- cgit From 5e9bd0b1ce50ae0e03c0563ed2f0cd589d94a287 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 16 Dec 2010 17:09:02 +0100 Subject: CWS swlayoutrefactoring: #i81480#: some minor cleanups --- sw/source/core/doc/doccorr.cxx | 4 +--- sw/source/core/doc/doclay.cxx | 46 +++++++++++++++++++++++++++++++----------- sw/source/core/doc/docnew.cxx | 4 ---- sw/source/core/doc/doctxm.cxx | 3 +-- sw/source/core/doc/ftnidx.cxx | 3 --- sw/source/core/text/itratr.cxx | 2 -- sw/source/core/view/viewsh.cxx | 3 +-- sw/source/core/view/vprint.cxx | 2 -- 8 files changed, 37 insertions(+), 30 deletions(-) mode change 100755 => 100644 sw/source/core/view/vprint.cxx diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 87ec511c62dd..2cef07f9b487 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -43,8 +43,6 @@ #include #include -/* */ - /* * MACROS um ueber alle CrsrShells zu iterieren */ @@ -441,7 +439,7 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const // Layout und OLE-Shells sollten vorhanden sein! if( pCurrentView ) { - register ViewShell *pSh = pCurrentView, *pVSh = pSh; + ViewShell *pSh = pCurrentView, *pVSh = pSh; if( ppSh ) *ppSh = pSh; diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 3c6357ba4aad..5244cd79606a 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -2294,22 +2294,45 @@ sal_Bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) con return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; } -//const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; } -//SwRootFrm* SwDoc::GetRootFrm() { return pLayout; } -//void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; } //swmod 071029//swmod 071225 -void SwDoc::SetCurrentViewShell( ViewShell* pNew ) { pCurrentView = pNew; }//swmod 071227 -SwLayouter* SwDoc::GetLayouter() { return pLayouter; } -const SwLayouter* SwDoc::GetLayouter() const { return pLayouter; } -void SwDoc::SetLayouter( SwLayouter* pNew ) { pLayouter = pNew; } -const ViewShell *SwDoc::GetCurrentViewShell() const { return pCurrentView;} //swmod 080219 -ViewShell *SwDoc::GetCurrentViewShell() { return pCurrentView;} //swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later. -const SwRootFrm *SwDoc::GetCurrentLayout() const { +void SwDoc::SetCurrentViewShell( ViewShell* pNew ) +{ + pCurrentView = pNew; +} + +SwLayouter* SwDoc::GetLayouter() +{ + return pLayouter; +} + +const SwLayouter* SwDoc::GetLayouter() const +{ + return pLayouter; +} + +void SwDoc::SetLayouter( SwLayouter* pNew ) +{ + pLayouter = pNew; +} + +const ViewShell *SwDoc::GetCurrentViewShell() const +{ + return pCurrentView; +} + +ViewShell *SwDoc::GetCurrentViewShell() +{ + return pCurrentView; +} //swmod 080219 It must be able to communicate to a ViewShell.This is going to be removedd later. + +const SwRootFrm *SwDoc::GetCurrentLayout() const +{ if(GetCurrentViewShell()) return GetCurrentViewShell()->GetLayout(); return 0; } -SwRootFrm *SwDoc::GetCurrentLayout(){ +SwRootFrm *SwDoc::GetCurrentLayout() +{ if(GetCurrentViewShell()) return GetCurrentViewShell()->GetLayout(); return 0; @@ -2334,4 +2357,3 @@ std::set SwDoc::GetAllLayouts() return aAllLayouts; }//swmod 070825 - diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 6e2a1eb51ea5..68ae706a4b51 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -238,7 +238,6 @@ SwDoc::SwDoc() : pGrfFmtCollTbl( new SwGrfFmtColls() ), pTOXTypes( new SwTOXTypes() ), pDefTOXBases( new SwDefTOXBase_Impl() ), - //pLayout( 0 ), // Rootframe des spezifischen Layouts. //swmod 071029 pCurrentView( 0 ), //swmod 071225 pDrawModel( 0 ), pUndos( new SwUndos( 0, 20 ) ), @@ -319,7 +318,6 @@ SwDoc::SwDoc() : mbNewDoc = mbCopyIsMove = mbNoDrawUndoObj = - //mbBrowseMode =//swmod 080130 mbInReading = mbInXMLImport = mbUpdateTOX = @@ -528,8 +526,6 @@ SwDoc::~SwDoc() // damit die Fussnotenattribute die Fussnotennodes in Frieden lassen. mbDtor = TRUE; - //DELETEZ( pCurrentView ); //swmod 080110//test if i can commit - delete pRedlineTbl; delete pUnoCrsrTbl; delete pAutoFmtRedlnComment; diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index dd8485ece497..e6900e96c363 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1095,8 +1095,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" )); { SwFrm::CheckPageDescs( (SwPageFrm*)(*pLayoutIter)->Lower() ); }//swmod 080310 - //if(pDoc->GetCurrentLayout()) - //SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetCurrentLayout()->Lower() ); //swmod 080218 + SetProtect( SwTOXBase::IsProtected() ); } diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx index 8ffcac046be4..a8b39c9062a6 100644 --- a/sw/source/core/doc/ftnidx.cxx +++ b/sw/source/core/doc/ftnidx.cxx @@ -232,7 +232,6 @@ void SwFtnIdxs::UpdateAllFtn() nFtnIdx = 0; // Index in das FtnIdx-Array for( USHORT n = 0; n < rOutlNds.Count(); ++n ) { - //if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei { ULONG nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels @@ -294,8 +293,6 @@ void SwFtnIdxs::UpdateAllFtn() } } - //if( pDoc->GetCurrentLayout() && FTNNUM_PAGE == rFtnInfo.eNum ) - // pDoc->GetCurrentLayout()->UpdateFtnNums(); if( pTmpRoot && FTNNUM_PAGE == rFtnInfo.eNum ) std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 0 } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 3ee041485a50..208d8a7ec9eb 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -435,7 +435,6 @@ sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const//swmodtest 080307 SwScriptInfo aScriptInfo; SwAttrIter aIter( *(SwTxtNode*)this, aScriptInfo ); aIter.Seek( nBegin ); - //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout(); return aIter.GetFnt()->IsSymbol( const_cast(getIDocumentLayoutAccess()->GetCurrentViewShell()) );//swmod 080311 } @@ -702,7 +701,6 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, case CHAR_HARDHYPHEN: { XubString sTmp( cChar ); - //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout(); SwDrawTextInfo aDrawInf( const_cast(getIDocumentLayoutAccess()->GetCurrentViewShell()), *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311 nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 0bc5139a8159..43662250ebd0 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -559,7 +559,6 @@ void ViewShell::InvalidateWindows( const SwRect &rRect ) if ( pSh->GetWin() ) { if ( pSh->IsPreView() ) -// pSh->GetWin()->Invalidate(); ::RepaintPagePreview( pSh, rRect ); else if ( pSh->VisArea().IsOver( rRect ) ) pSh->GetWin()->Invalidate( rRect.SVRect() ); @@ -587,7 +586,7 @@ void ViewShell::MakeVisible( const SwRect &rRect ) { if( pWin ) { - const SwFrm* pRoot = /*GetDoc()->GetCurrentViewShell()->*/GetLayout(); + const SwFrm* pRoot = GetLayout(); int nLoopCnt = 3; long nOldH; do{ diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx old mode 100755 new mode 100644 index 91a8353cedc6..5dd52ab9f66e --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -341,7 +341,6 @@ void ViewShell::CalcPagesForPrint( USHORT nMax ) SET_CURR_SHELL( this ); SwRootFrm* pMyLayout = GetLayout(); - // ULONG nStatMax = pMyLayout->GetPageNum(); const SwFrm *pPage = pMyLayout->Lower(); SwLayAction aAction( pMyLayout, Imp() ); @@ -752,7 +751,6 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat pSh->GetNext() == pSh ) { pSh->CheckBrowseView( FALSE ); - //pDoc->GetCurrentLayout()->Lower()->InvalidateSize(); //swmod 080218//? pSh->GetLayout()->Lower()->InvalidateSize(); } -- cgit From de60fd06b84bc1aa080ef209b0eeb36914bd8b32 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 17 Dec 2010 09:02:23 +0100 Subject: CWS swlayoutrefactoring: #i115510#: first step to clean up the SwClient mess --- sw/inc/authfld.hxx | 4 +- sw/inc/calbck.hxx | 247 +++++----- sw/inc/crsrsh.hxx | 5 +- sw/inc/dcontact.hxx | 42 +- sw/inc/docufld.hxx | 12 +- sw/inc/expfld.hxx | 7 +- sw/inc/fchrfmt.hxx | 4 +- sw/inc/fldbas.hxx | 2 +- sw/inc/fmtcol.hxx | 9 +- sw/inc/fmtfld.hxx | 7 +- sw/inc/fmthdft.hxx | 14 +- sw/inc/fmtmeta.hxx | 6 +- sw/inc/fmtpdsc.hxx | 9 +- sw/inc/format.hxx | 7 +- sw/inc/frmfmt.hxx | 10 +- sw/inc/ftninfo.hxx | 8 +- sw/inc/lineinfo.hxx | 7 +- sw/inc/ndtxt.hxx | 7 +- sw/inc/node.hxx | 10 +- sw/inc/numrule.hxx | 21 +- sw/inc/pagedesc.hxx | 4 +- sw/inc/paratr.hxx | 9 +- sw/inc/reffld.hxx | 5 +- sw/inc/rolbck.hxx | 5 +- sw/inc/section.hxx | 11 +- sw/inc/swddetbl.hxx | 3 +- sw/inc/switerator.hxx | 47 ++ sw/inc/swtable.hxx | 26 +- sw/inc/swtblfmt.hxx | 6 +- sw/inc/tox.hxx | 12 +- sw/inc/txtatr.hxx | 12 +- sw/inc/txtinet.hxx | 6 +- sw/inc/undobj.hxx | 9 +- sw/inc/unobaseclass.hxx | 2 +- sw/inc/unobookmark.hxx | 3 +- sw/inc/unochart.hxx | 17 +- sw/inc/unodraw.hxx | 6 +- sw/inc/unofield.hxx | 31 +- sw/inc/unoflatpara.hxx | 3 +- sw/inc/unoframe.hxx | 15 +- sw/inc/unoport.hxx | 17 +- sw/inc/unoredline.hxx | 6 +- sw/inc/unoredlines.hxx | 4 +- sw/inc/unosett.hxx | 7 +- sw/inc/unostyle.hxx | 15 +- sw/inc/unotbl.hxx | 22 +- sw/inc/unotextmarkup.hxx | 6 +- sw/inc/usrfld.hxx | 4 +- sw/source/core/access/accframebase.cxx | 22 +- sw/source/core/access/accframebase.hxx | 3 +- sw/source/core/access/accmap.cxx | 16 +- sw/source/core/access/accnotextframe.cxx | 8 +- sw/source/core/access/accnotextframe.hxx | 4 +- sw/source/core/access/accpara.cxx | 4 +- sw/source/core/access/accpara.hxx | 6 +- sw/source/core/access/acctable.cxx | 13 +- sw/source/core/access/acctable.hxx | 7 +- sw/source/core/access/acctextframe.cxx | 6 +- sw/source/core/access/acctextframe.hxx | 5 +- sw/source/core/attr/calbck.cxx | 508 +++++++++----------- sw/source/core/attr/cellatr.cxx | 11 +- sw/source/core/attr/format.cxx | 54 ++- sw/source/core/crsr/bookmrk.cxx | 4 +- sw/source/core/crsr/crsrsh.cxx | 4 +- sw/source/core/crsr/crstrvl.cxx | 41 +- sw/source/core/crsr/pam.cxx | 2 +- sw/source/core/doc/acmplwrd.cxx | 9 +- sw/source/core/doc/doc.cxx | 51 +- sw/source/core/doc/docbm.cxx | 2 +- sw/source/core/doc/doccorr.cxx | 2 +- sw/source/core/doc/docdesc.cxx | 73 +-- sw/source/core/doc/docdraw.cxx | 25 +- sw/source/core/doc/docedt.cxx | 8 +- sw/source/core/doc/docfld.cxx | 69 ++- sw/source/core/doc/docfly.cxx | 52 +-- sw/source/core/doc/docfmt.cxx | 31 +- sw/source/core/doc/docftn.cxx | 14 +- sw/source/core/doc/docglbl.cxx | 7 +- sw/source/core/doc/doclay.cxx | 2 +- sw/source/core/doc/docnew.cxx | 12 +- sw/source/core/doc/docnum.cxx | 31 +- sw/source/core/doc/docredln.cxx | 2 +- sw/source/core/doc/doctxm.cxx | 56 +-- sw/source/core/doc/fmtcol.cxx | 29 +- sw/source/core/doc/htmltbl.cxx | 15 +- sw/source/core/doc/lineinfo.cxx | 6 +- sw/source/core/doc/notxtfrm.cxx | 2 +- sw/source/core/doc/number.cxx | 30 +- sw/source/core/doc/tblrwcl.cxx | 29 +- sw/source/core/doc/visiturl.cxx | 2 +- sw/source/core/docnode/ndcopy.cxx | 2 +- sw/source/core/docnode/ndsect.cxx | 22 +- sw/source/core/docnode/ndtbl.cxx | 65 +-- sw/source/core/docnode/ndtbl1.cxx | 12 +- sw/source/core/docnode/node.cxx | 112 ++--- sw/source/core/docnode/node2lay.cxx | 95 +++- sw/source/core/docnode/nodes.cxx | 77 +-- sw/source/core/docnode/section.cxx | 152 ++---- sw/source/core/docnode/swbaslnk.cxx | 8 +- sw/source/core/draw/dcontact.cxx | 168 +++---- sw/source/core/draw/dview.cxx | 2 +- sw/source/core/edit/edfld.cxx | 10 +- sw/source/core/edit/edfldexp.cxx | 12 +- sw/source/core/edit/editsh.cxx | 20 +- sw/source/core/edit/edlingu.cxx | 10 +- sw/source/core/edit/edtox.cxx | 10 +- sw/source/core/fields/authfld.cxx | 89 +--- sw/source/core/fields/cellfml.cxx | 14 - sw/source/core/fields/dbfld.cxx | 70 +-- sw/source/core/fields/ddefld.cxx | 14 +- sw/source/core/fields/ddetbl.cxx | 10 +- sw/source/core/fields/docufld.cxx | 104 +---- sw/source/core/fields/expfld.cxx | 45 +- sw/source/core/fields/fldlst.cxx | 13 +- sw/source/core/fields/postithelper.cxx | 7 +- sw/source/core/fields/reffld.cxx | 66 +-- sw/source/core/fields/tblcalc.cxx | 18 +- sw/source/core/fields/usrfld.cxx | 4 +- sw/source/core/frmedt/feshview.cxx | 150 +----- sw/source/core/frmedt/tblsel.cxx | 92 ++-- sw/source/core/graphic/ndgrf.cxx | 12 +- sw/source/core/inc/bookmrk.hxx | 6 +- sw/source/core/inc/cellfrm.hxx | 2 +- sw/source/core/inc/cntfrm.hxx | 7 +- sw/source/core/inc/flyfrm.hxx | 18 +- sw/source/core/inc/flyfrms.hxx | 10 +- sw/source/core/inc/frame.hxx | 17 +- sw/source/core/inc/frmtool.hxx | 2 +- sw/source/core/inc/notxtfrm.hxx | 2 +- sw/source/core/inc/pagefrm.hxx | 4 +- sw/source/core/inc/rowfrm.hxx | 2 +- sw/source/core/inc/sectfrm.hxx | 6 +- sw/source/core/inc/tabfrm.hxx | 4 +- sw/source/core/inc/txtfrm.hxx | 5 +- sw/source/core/layout/atrfrm.cxx | 148 +++--- sw/source/core/layout/colfrm.cxx | 7 +- sw/source/core/layout/findfrm.cxx | 9 +- sw/source/core/layout/flowfrm.cxx | 39 +- sw/source/core/layout/fly.cxx | 125 +++-- sw/source/core/layout/flycnt.cxx | 2 +- sw/source/core/layout/flyincnt.cxx | 2 +- sw/source/core/layout/flylay.cxx | 2 +- sw/source/core/layout/flypos.cxx | 22 +- sw/source/core/layout/frmtool.cxx | 324 ++++--------- sw/source/core/layout/ftnfrm.cxx | 145 +----- sw/source/core/layout/hffrm.cxx | 4 +- sw/source/core/layout/movedfwdfrmsbyobjpos.cxx | 9 +- sw/source/core/layout/newfrm.cxx | 2 +- sw/source/core/layout/pagechg.cxx | 21 +- sw/source/core/layout/pagedesc.cxx | 27 +- sw/source/core/layout/paintfrm.cxx | 30 +- sw/source/core/layout/sectfrm.cxx | 11 +- sw/source/core/layout/softpagebreak.cxx | 15 +- sw/source/core/layout/ssfrm.cxx | 88 +++- sw/source/core/layout/tabfrm.cxx | 38 +- sw/source/core/layout/wsfrm.cxx | 27 +- sw/source/core/para/paratr.cxx | 19 +- sw/source/core/table/swnewtable.cxx | 7 +- sw/source/core/table/swtable.cxx | 248 +++++----- sw/source/core/text/EnhancedPDFExportHelper.cxx | 48 +- sw/source/core/text/itratr.cxx | 23 +- sw/source/core/text/porlay.cxx | 16 +- sw/source/core/text/txtdrop.cxx | 20 +- sw/source/core/text/txtfrm.cxx | 24 +- sw/source/core/tox/tox.cxx | 51 +- sw/source/core/txtnode/SwGrammarContact.cxx | 44 +- sw/source/core/txtnode/atrfld.cxx | 22 +- sw/source/core/txtnode/atrflyin.cxx | 19 +- sw/source/core/txtnode/atrftn.cxx | 19 +- sw/source/core/txtnode/fmtatr2.cxx | 12 +- sw/source/core/txtnode/ndtxt.cxx | 77 ++- sw/source/core/txtnode/thints.cxx | 36 +- sw/source/core/txtnode/txtatr2.cxx | 18 +- sw/source/core/txtnode/txtedt.cxx | 8 +- sw/source/core/undo/SwUndoPageDesc.cxx | 32 +- sw/source/core/undo/rolbck.cxx | 8 +- sw/source/core/undo/unattr.cxx | 71 +-- sw/source/core/undo/undobj1.cxx | 9 +- sw/source/core/undo/undraw.cxx | 131 ++---- sw/source/core/undo/untbl.cxx | 50 +- sw/source/core/unocore/unobkm.cxx | 4 +- sw/source/core/unocore/unochart.cxx | 4 +- sw/source/core/unocore/unocoll.cxx | 171 +------ sw/source/core/unocore/unocrsrhelper.cxx | 2 +- sw/source/core/unocore/unodraw.cxx | 182 +------- sw/source/core/unocore/unofield.cxx | 255 ++-------- sw/source/core/unocore/unoflatpara.cxx | 2 +- sw/source/core/unocore/unoframe.cxx | 313 +------------ sw/source/core/unocore/unoftn.cxx | 20 +- sw/source/core/unocore/unoidx.cxx | 30 +- sw/source/core/unocore/unoobj.cxx | 4 +- sw/source/core/unocore/unoobj2.cxx | 117 +---- sw/source/core/unocore/unoparagraph.cxx | 4 +- sw/source/core/unocore/unoport.cxx | 12 +- sw/source/core/unocore/unoportenum.cxx | 4 +- sw/source/core/unocore/unoredline.cxx | 72 +-- sw/source/core/unocore/unoredlines.cxx | 49 +- sw/source/core/unocore/unorefmk.cxx | 28 +- sw/source/core/unocore/unosect.cxx | 2 +- sw/source/core/unocore/unosett.cxx | 4 +- sw/source/core/unocore/unostyle.cxx | 10 +- sw/source/core/unocore/unotbl.cxx | 571 +++-------------------- sw/source/core/unocore/unotext.cxx | 2 +- sw/source/core/unocore/unotextmarkup.cxx | 10 +- sw/source/core/view/viewsh.cxx | 2 +- sw/source/core/view/vnew.cxx | 21 +- sw/source/filter/html/htmlvsh.hxx | 5 +- sw/source/filter/html/swhtml.cxx | 6 +- sw/source/filter/html/swhtml.hxx | 2 +- sw/source/filter/inc/fltshell.hxx | 2 +- sw/source/filter/rtf/rtfnum.cxx | 2 +- sw/source/filter/rtf/rtftbl.cxx | 4 +- sw/source/filter/rtf/swparrtf.cxx | 2 +- sw/source/filter/ww1/fltshell.cxx | 4 +- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- sw/source/filter/ww8/wrtw8nds.cxx | 6 +- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/ww8atr.cxx | 24 +- sw/source/filter/ww8/ww8par5.cxx | 2 +- sw/source/filter/xml/xmlfmt.cxx | 4 +- sw/source/filter/xml/xmltexti.cxx | 6 +- sw/source/ui/app/docsh.cxx | 60 +-- sw/source/ui/app/docstyle.cxx | 4 +- sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 50 +- sw/source/ui/dochdl/swdtflvr.cxx | 23 +- sw/source/ui/docvw/PostItMgr.cxx | 10 +- sw/source/ui/fldui/fldmgr.cxx | 2 +- sw/source/ui/fldui/fldpage.cxx | 10 +- sw/source/ui/lingu/sdrhhcwrap.cxx | 49 +- sw/source/ui/lingu/sdrhhcwrap.hxx | 1 - sw/source/ui/shells/textfld.cxx | 10 +- sw/source/ui/uno/unotxvw.cxx | 6 +- sw/source/ui/utlui/uitool.cxx | 4 +- 233 files changed, 2548 insertions(+), 5356 deletions(-) create mode 100755 sw/inc/switerator.hxx diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index 7d3ff5514b72..b1811d5bb965 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -89,13 +89,15 @@ class SW_DLLPUBLIC SwAuthorityFieldType : public SwFieldType // @@@ private copy assignment, but public copy ctor? @@@ const SwAuthorityFieldType& operator=( const SwAuthorityFieldType& ); +protected: +virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + public: SwAuthorityFieldType(SwDoc* pDoc); SwAuthorityFieldType( const SwAuthorityFieldType& ); ~SwAuthorityFieldType(); virtual SwFieldType* Copy() const; - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhichId ) const; virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhichId ); diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 6ce5e181947a..e8a33399ac8e 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -25,25 +25,6 @@ * ************************************************************************/ -/************************************************************* -#* Service-Klassen - *************************************************************/ - -/* -#* Aendert sich ein Attribut in einem Format, so muss diese -#* Aenderung an alle abhaengigen Formate und ueber sie an -#* alle betroffenen Nodes propagiert werden. Dabei muss -#* festgestellt werden, ob die Aenderung einen Effekt haben -#* kann, oder ob das geaenderte Attribut von dem abhaengigen -#* Format ueberdefiniert wird (so dass ohnehin der -#* Attributwert des abhaengigen Formates den geaenderten -#* Wert verdeckt). Weiterhin kann der betroffene Node -#* feststellen, ob er von dem geaenderten Attribut Gebrauch -#* macht (Beispiel: Linienabstand fuer Unterstreichung wurde -#* geaendert, das Attribut Unterstreichung wurde aber nicht -#* verwendet). So wird bei Aenderungen der minimale Aufwand -#* zum Reformatieren erkannt. - */ #ifndef _CALBCK_HXX #define _CALBCK_HXX @@ -53,7 +34,33 @@ class SwModify; class SwClientIter; class SfxPoolItem; -class SvStream; + +/* + SwModify and SwClient cooperate in propagating attribute changes. + If an attribute changes, the change is notified to all dependent + formats and other interested objects, e.g. Nodes. The clients will detect + if the change affects them. It could be that the changed attribute is + overruled in the receiving object so that its change does not become + effective or that the receiver is not interested in the particular attribute + in general (though probably in other attributes of the SwModify object they + are registered in). + As SwModify objects are derived from SwClient, they can create a chain of SwClient + objects where changes can get propagated through. + Each SwClient can be registered at only one SwModify object, while each SwModify + object is connected to a list of SwClient objects. If an object derived from SwClient + wants to get notifications from more than one SwModify object, it must create additional + SwClient objects. The SwDepend class allows to handle their notifications in the same + notification callback as it forwards the Modify() calls it receives to a "master" + SwClient implementation. + The SwClientIter class allows to iterate over the SwClient objects registered at an + SwModify. For historical reasons its ability to use TypeInfo to restrict this iteration + to objects of a particular type created a lot of code that misuses SwClient-SwModify + relationships that basically should be used only for Modify() callbacks. + This is still subject to refactoring. + Until this gets resolved, new SwClientIter base code should be reduced to the absolute + minimum and it also should be wrapped by SwIterator templates that prevent that the + code gets polluted by pointer casts (see switerator.hxx). + */ // ---------- // SwClient @@ -61,106 +68,128 @@ class SvStream; class SW_DLLPUBLIC SwClient { + // avoids making the details of the linked list and the callback method public friend class SwModify; friend class SwClientIter; - SwClient *pLeft, *pRight; // fuer die AVL-Sortierung - BOOL bModifyLocked : 1; // wird in SwModify::Modify benutzt, - // eigentlich ein Member des SwModify - // aber aus Platzgruenden hier. - BOOL bInModify : 1; // ist in einem Modify. (Debug!!!) - BOOL bInDocDTOR : 1; // Doc wird zerstoert, nicht "abmelden" - BOOL bInCache : 1; // Ist im BorderAttrCache des Layout, - // Traegt sich dann im Modify aus! - BOOL bInSwFntCache : 1; // Ist im SwFont-Cache der Formatierung + SwClient *pLeft, *pRight; // double-linked list of other clients + SwModify *pRegisteredIn; // event source -protected: - SwModify *pRegisteredIn; + // in general clients should not be removed when their SwModify sends out Modify() + // notifications; in some rare cases this is necessary, but only the concrete SwClient + // sub class will know that; this flag allows to make that known + bool mbIsAllowedToBeRemovedInModifyCall; + // callbacks received from SwModify (friend class - so these methods can be private) + // should be called only from SwModify the client is registered in + // mba: IMHO these methods should be pure virtual + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); + +protected: // single argument ctors shall be explicit. explicit SwClient(SwModify *pToRegisterIn); + // write access to pRegisteredIn shall be granted only to the object itself (protected access) + SwModify* GetRegisteredInNonConst() const { return pRegisteredIn; } + void SetIsAllowedToBeRemovedInModifyCall( bool bSet ) { mbIsAllowedToBeRemovedInModifyCall = bSet; } + public: + inline SwClient(); virtual ~SwClient(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + // in case an SwModify object is destroyed that itself is registered in another SwModify, + // its SwClient objects can decide to get registered to the latter instead by calling this method + void CheckRegistration( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ); + + // controlled access to Modify method + // mba: this is still considered a hack and it should be fixed; the name makes grep-ing easier + void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ); + const SwModify* GetRegisteredIn() const { return pRegisteredIn; } + bool IsLast() const { return !pLeft && !pRight; } - //rtti, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun - //kann ueber die Abhaengigkeitsliste eines Modify typsicher gecastet - //werden. + // needed for class SwClientIter TYPEINFO(); - void LockModify() { bModifyLocked = TRUE; } - void UnlockModify() { bModifyLocked = FALSE; } - void SetInCache( BOOL bNew ) { bInCache = bNew; } - void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; } - BOOL IsModifyLocked() const { return bModifyLocked; } - BOOL IsInDocDTOR() const { return bInDocDTOR; } - BOOL IsInCache() const { return bInCache; } - BOOL IsInSwFntCache() const { return bInSwFntCache; } - - // erfrage vom Client Informationen + // get information about attribute virtual BOOL GetInfo( SfxPoolItem& ) const; private: + // forbidden and not implemented SwClient( const SwClient& ); SwClient &operator=( const SwClient& ); }; inline SwClient::SwClient() : - pLeft(0), pRight(0), pRegisteredIn(0) -{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = FALSE; } - + pLeft(0), pRight(0), pRegisteredIn(0), mbIsAllowedToBeRemovedInModifyCall(false) +{} // ---------- // SwModify // ---------- -// Klasse hat eine doppelt Verkette Liste fuer die Abhaengigen. - class SW_DLLPUBLIC SwModify: public SwClient { - friend SvStream& operator<<( SvStream& aS, SwModify & ); +// friend class SwClientIter; - friend class SwClientIter; - SwClient* pRoot; + SwClient* pRoot; // the start of the linked list of clients + BOOL bModifyLocked : 1; // don't broadcast changes now + BOOL bLockClientList : 1; // may be set when this instance notifies its clients + BOOL bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed + BOOL bInCache : 1; + BOOL bInSwFntCache : 1; - SwClient *_Remove(SwClient *pDepend); + // mba: IMHO this method should be pure virtual + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: - SwModify() : pRoot(0) {} + SwModify(); + + // broadcasting: send notifications to all clients + void NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ); + + // the same, but without setting bModifyLocked or checking for any of the flags + // mba: it would be interesting to know why this is necessary + // also allows to limit callback to certain type (HACK) + void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) ); + + // placeholder for a more elaborated broadcasting mechanism; currently the nWhich is enough + void CallSwClientNotify( USHORT nWhich ); // single argument ctors shall be explicit. - explicit SwModify(SwModify *pToRegisterIn ); + explicit SwModify( SwModify *pToRegisterIn ); virtual ~SwModify(); - virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); void Add(SwClient *pDepend); - SwClient *Remove(SwClient *pDepend) - { return bInDocDTOR ? 0 : _Remove( pDepend ); } - + SwClient* Remove(SwClient *pDepend); const SwClient* GetDepends() const { return pRoot; } - // erfrage vom Client Informationen + // get information about attribute virtual BOOL GetInfo( SfxPoolItem& ) const; - void SetInDocDTOR() { bInDocDTOR = TRUE; } + void LockModify() { bModifyLocked = TRUE; } + void UnlockModify() { bModifyLocked = FALSE; } + void SetInCache( BOOL bNew ) { bInCache = bNew; } + void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; } + void SetInDocDTOR() { bInDocDTOR = TRUE; } + BOOL IsModifyLocked() const { return bModifyLocked; } + BOOL IsInDocDTOR() const { return bInDocDTOR; } + BOOL IsInCache() const { return bInCache; } + BOOL IsInSwFntCache() const { return bInSwFntCache; } void CheckCaching( const USHORT nWhich ); - BOOL IsLastDepend() const - { return pRoot && !pRoot->pLeft && !pRoot->pRight; } + bool IsLastDepend() { return pRoot && pRoot->IsLast(); } + +#ifdef DBG_UTIL + int GetClientCount() const; +#endif private: - // forbidden and not implemented (see @ SwClient). + // forbidden and not implemented SwModify & operator= (const SwModify &); - -protected: - // forbidden and not implemented (see @ SwClient), - // but GCC >= 3.4 needs an accessible "T (const T&)" - // to pass a "T" as a "const T&" argument SwModify (const SwModify &); }; @@ -169,9 +198,7 @@ protected: // ---------- /* - * Sehr sinnvolle Klasse, wenn ein Objekt von mehreren Objekten - * abhaengig ist. Diese sollte fuer jede Abhaengigkeit ein Objekt - * der Klasse SwDepend als Member haben. + * Helper class for objects that need to depend on more than one SwClient */ class SW_DLLPUBLIC SwDepend: public SwClient { @@ -182,13 +209,14 @@ public: SwDepend(SwClient *pTellHim, SwModify *pDepend); SwClient* GetToTell() { return pToTell; } - virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); - // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem & ) const; +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ); + private: - // forbidden and not implemented (see @ SwClient). + // forbidden and not implemented SwDepend (const SwDepend &); SwDepend & operator= (const SwDepend &); }; @@ -196,55 +224,52 @@ private: class SwClientIter { - friend SwClient* SwModify::_Remove(SwClient *); // fuer Ptr-Korrektur - friend void SwModify::Add(SwClient *); // nur fuer ASSERT ! + friend SwClient* SwModify::Remove(SwClient *); // for pointer adjustments + friend void SwModify::Add(SwClient *pDepend); // for pointer adjustments - SwModify const& rRoot; - SwClient *pAkt, *pDelNext; - // fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von - // Clients, wenn der Iterator gerade draufsteht. - SwClientIter *pNxtIter; + const SwModify& rRoot; - SwClient* mpWatchClient; // if set, SwModify::_Remove checks if this client is removed + // the current object in an iteration + SwClient* pAct; - TypeId aSrchId; // fuer First/Next - suche diesen Type + // in case the current object is already removed, the next object in the list + // is marked down to become the current object in the next step + // this is necessary because iteration requires access to members of the current object + SwClient* pDelNext; -public: - SW_DLLPUBLIC SwClientIter( SwModify const& ); - SW_DLLPUBLIC ~SwClientIter(); + // SwClientIter objects are tracked in linked list so that they can react + // when the current (pAct) or marked down (pDelNext) SwClient is removed + // from its SwModify + SwClientIter *pNxtIter; - const SwModify& GetModify() const { return rRoot; } + // iterator can be limited to return only SwClient objects of a certain type + TypeId aSrchId; -#ifndef CFRONT - SwClient* operator++(int); // zum Naechsten - SwClient* operator--(int); // zum Vorherigen -#endif - SwClient* operator++(); // zum Naechsten - SwClient* operator--(); // zum Vorherigen +public: + SW_DLLPUBLIC SwClientIter( const SwModify& ); + SW_DLLPUBLIC ~SwClientIter(); - SwClient* GoStart(); // zum Anfang - SwClient* GoEnd(); // zum Ende + const SwModify& GetModify() const { return rRoot; } - inline SwClient* GoRoot(); // wieder ab Root (==Start) anfangen + SwClient* operator++(int); + SwClient* GoStart(); + SwClient* GoEnd(); + // returns the current SwClient object; + // in case this was already removed, the object marked down to become + // the next current one is returned SwClient* operator()() const - { return pDelNext == pAkt ? pAkt : pDelNext; } + { return pDelNext == pAct ? pAct : pDelNext; } - int IsChanged() const { return pDelNext != pAkt; } + // return "true" if an object was removed from a client chain in iteration + // adding objects to a client chain in iteration is forbidden + // SwModify::Add() asserts this + bool IsChanged() const { return pDelNext != pAct; } SW_DLLPUBLIC SwClient* First( TypeId nType ); SW_DLLPUBLIC SwClient* Next(); - - const SwClient* GetWatchClient() const { return mpWatchClient; } - void SetWatchClient( SwClient* pWatch ) { mpWatchClient = pWatch; } + SW_DLLPUBLIC SwClient* Last( TypeId nType ); + SW_DLLPUBLIC SwClient* Previous(); }; -inline SwClient* SwClientIter::GoRoot() // wieder ab Root anfangen -{ - pAkt = rRoot.pRoot; - return (pDelNext = pAkt); -} - - - #endif diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 22cb3613502e..cd0c2168a97e 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -322,6 +322,9 @@ protected: */ SW_DLLPRIVATE void UpdateMarkedListLevel(); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: TYPEINFO(); SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 ); @@ -329,8 +332,6 @@ public: SwCrsrShell( SwCrsrShell& rShell, Window *pWin ); virtual ~SwCrsrShell(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - // neuen Cusror erzeugen und den alten anhaengen SwPaM * CreateCrsr(); // loesche den aktuellen Cursor und der folgende wird zum Aktuellen diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index 5406fb042e95..f4b66b59b53a 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -28,17 +28,14 @@ #define _DCONTACT_HXX #include -// OD 14.05.2003 #108784# #include -// OD 2004-01-16 #110582# #include #include #include - -// OD 17.06.2003 #108784# #include #include "calbck.hxx" +#include class SfxPoolItem; class SwFrmFmt; @@ -50,13 +47,10 @@ class SwVirtFlyDrawObj; class SwFmtAnchor; class SwFlyDrawObj; class SwRect; -// OD 17.06.2003 #108784# - forward declaration for class class SwDrawContact; -// OD 2004-01-16 #110582# struct SwPosition; class SwIndex; -// OD 2004-03-25 #i26791# -#include +class SdrTextObj; //Der Umgekehrte Weg: Sucht das Format zum angegebenen Objekt. //Wenn das Object ein SwVirtFlyDrawObj ist so wird das Format von @@ -212,7 +206,7 @@ public: @author */ - virtual void GetAnchoredObjs( std::vector& _roAnchoredObjs ) const = 0; + virtual void GetAnchoredObjs( std::list& _roAnchoredObjs ) const = 0; /** get minimum order number of anchored objects handled by with contact @@ -240,14 +234,9 @@ private: // OD 2004-04-01 #i26791# SwFlyDrawObj* mpMasterObj; - /** method to determine new order number for new instance of - - OD 2004-08-16 #i27030# - Used in method . - - @author OD - */ - sal_uInt32 _GetOrdNumForNewRef( const SwFlyFrm* pFlyFrm ); +protected: + // virtuelle Methoden von SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); public: TYPEINFO(); @@ -265,11 +254,6 @@ public: virtual SdrObject* GetMaster(); virtual void SetMaster( SdrObject* _pNewMaster ); - SwVirtFlyDrawObj* CreateNewRef( SwFlyFrm* pFly ); - - // virtuelle Methoden von SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - // OD 2004-01-16 #110582# - override methods to control Writer fly frames, // which are linked, and to assure that all objects anchored at/inside the // Writer fly frame are also made visible/invisible. @@ -282,7 +266,7 @@ public: @author */ - virtual void GetAnchoredObjs( std::vector& _roAnchoredObjs ) const; + virtual void GetAnchoredObjs( std::list& _roAnchoredObjs ) const; }; // OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual' @@ -468,6 +452,11 @@ class SwDrawContact : public SwContact SwDrawContact( const SwDrawContact& ); SwDrawContact& operator=( const SwDrawContact& ); // <-- + + protected: + // virtuelle Methoden von SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + public: TYPEINFO(); @@ -530,9 +519,6 @@ class SwDrawContact : public SwContact // by frame. SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm ); - // virtuelle Methoden von SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - // virtuelle Methoden von SdrObjUserCall virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect); @@ -555,7 +541,9 @@ class SwDrawContact : public SwContact @author */ - virtual void GetAnchoredObjs( std::vector& _roAnchoredObjs ) const; + + static void GetTextObjectsFromFmt( std::list&, SwDoc* ); + virtual void GetAnchoredObjs( std::list& _roAnchoredObjs ) const; }; #endif diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 8483cf7b2d39..091280e5b294 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -636,8 +636,10 @@ public: SwRefPageSetFieldType(); virtual SwFieldType* Copy() const; + +protected: // ueberlagert, weil es nichts zum Updaten gibt! - virtual void Modify( SfxPoolItem *, SfxPoolItem * ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); }; /*-------------------------------------------------------------------- @@ -677,15 +679,13 @@ class SwRefPageGetFieldType : public SwFieldType sal_Int16 nNumberingType; void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList ); - +protected: + // ueberlagert, um alle RefPageGet-Felder zu updaten + virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); public: SwRefPageGetFieldType( SwDoc* pDoc ); virtual SwFieldType* Copy() const; - - // ueberlagert, um alle RefPageGet-Felder zu updaten - virtual void Modify( SfxPoolItem *, SfxPoolItem * ); USHORT MakeSetList( _SetGetExpFlds& rTmpLst ); - SwDoc* GetDoc() const { return pDoc; } }; diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 00598528e891..613a66c9cc4f 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -82,8 +82,8 @@ public: // ueberlagert, weil das Get-Field nicht veraendert werden kann // und dann auch nicht aktualisiert werden muss. Aktualisierung // erfolgt beim Aendern von Set-Werten ! - - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); }; /*-------------------------------------------------------------------- @@ -165,6 +165,8 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType USHORT nType; BYTE nLevel; BOOL bDeleted; +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); public: SwSetExpFieldType( SwDoc* pDoc, const String& rName, @@ -183,7 +185,6 @@ public: // ueberlagert, weil das Set-Field selbst dafuer sorgt, das // es aktualisiert wird. - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); inline const String& GetSetRefName() const; USHORT SetSeqRefNo( SwSetExpField& rFld ); diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx index ee557e8eeaba..a84c6e4cd04c 100644 --- a/sw/inc/fchrfmt.hxx +++ b/sw/inc/fchrfmt.hxx @@ -53,6 +53,9 @@ public: // @@@ public copy ctor, but no copy assignment? SwFmtCharFmt( const SwFmtCharFmt& rAttr ); +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + private: // @@@ public copy ctor, but no copy assignment? SwFmtCharFmt & operator= (const SwFmtCharFmt &); @@ -73,7 +76,6 @@ public: virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); // an das SwTxtCharFmt weiterleiten (vom SwClient) - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); } diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index a2e08366ba24..8a36e1de6ec8 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -293,7 +293,7 @@ public: inline void SwFieldType::UpdateFlds() const { - ((SwFieldType*)this)->Modify( 0, 0 ); + ((SwFieldType*)this)->ModifyNotification( 0, 0 ); } /*-------------------------------------------------------------------- diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index aba9b8533c0a..79536445f5b8 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -96,10 +96,11 @@ protected: //nOutlineLevel( NO_NUMBERING ) //<-#outline level,removed by zhaojianwei mbAssignedToOutlineStyle(false) //<-#outline level,added by zhaojianwei { pNextTxtFmtColl = this; } -public: // zum "abfischen" von UL-/LR-/FontHeight Aenderungen - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + +public: TYPEINFO(); //Bereits in Basisklasse Client drin. @@ -255,6 +256,7 @@ public: void SetCondition( ULONG nCond, ULONG nSubCond ); SwTxtFmtColl* GetTxtFmtColl() const { return (SwTxtFmtColl*)GetRegisteredIn(); } + void RegisterToFormat( SwFmt& ); }; @@ -281,9 +283,6 @@ public: virtual ~SwConditionTxtFmtColl(); - // zum "abfischen" von Aenderungen -// virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - const SwCollCondition* HasCondition( const SwCollCondition& rCond ) const; const SwFmtCollConditions& GetCondColls() const { return aCondColls; } void InsertCondition( const SwCollCondition& rCond ); diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 0e1932f9605b..1f8be0e88f12 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -27,6 +27,7 @@ #ifndef _FMTFLD_HXX #define _FMTFLD_HXX +#include #include #include #include @@ -37,6 +38,7 @@ class SwField; class SwTxtFld; class SwView; +class SwFieldType; // ATT_FLD *********************************** class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster @@ -53,6 +55,9 @@ class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBro // @@@ copy construction allowed, but copy assignment is not? @@@ SwFmtFld& operator=(const SwFmtFld& rFld); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: TYPEINFO(); @@ -68,7 +73,6 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; const SwField *GetFld() const { return pField; } @@ -89,6 +93,7 @@ public: BOOL IsFldInDoc() const; BOOL IsProtect() const; + void RegisterToFieldType( SwFieldType& ); }; class SW_DLLPUBLIC SwFmtFldHint : public SfxHint diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx index 14c71d6a0264..935fe8c80de8 100644 --- a/sw/inc/fmthdft.hxx +++ b/sw/inc/fmthdft.hxx @@ -34,7 +34,7 @@ class SwFrmFmt; class IntlWrapper; - +class SwFmt; //Kopfzeile, fuer Seitenformate //Client von FrmFmt das den Header beschreibt. @@ -61,13 +61,15 @@ public: String &rText, const IntlWrapper* pIntl = 0 ) const; - const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; } - SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)pRegisteredIn; } + const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)GetRegisteredIn(); } BOOL IsActive() const { return bActive; } void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } + void RegisterToFormat( SwFmt& rFmt ); }; + //Fusszeile, fuer Seitenformate //Client von FrmFmt das den Footer beschreibt. @@ -93,13 +95,15 @@ public: String &rText, const IntlWrapper* pIntl = 0 ) const; - const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; } - SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)pRegisteredIn; } + const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)GetRegisteredIn(); } BOOL IsActive() const { return bActive; } void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } + void RegisterToFormat( SwFmt& rFmt ); }; + inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const { return (const SwFmtHeader&)Get( RES_HEADER,bInP); } inline const SwFmtFooter &SwAttrSet::GetFooter(BOOL bInP) const diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index d09df11bb1aa..5b443c479124 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -162,13 +162,13 @@ protected: ::com::sun::star::rdf::XMetadatable> const& xMeta) { m_wXMeta = xMeta; } + // SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + public: explicit Meta(SwFmtMeta * const i_pFmt = 0); virtual ~Meta(); - // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - // sfx2::Metadatable virtual ::sfx2::IXmlIdRegistry& GetRegistry(); virtual bool IsInClipboard() const; diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 47ad826bc875..7f23e7cd7e2f 100644 --- a/sw/inc/fmtpdsc.hxx +++ b/sw/inc/fmtpdsc.hxx @@ -38,6 +38,7 @@ class SwPageDesc; class SwHistory; class SwPaM; class IntlWrapper; +class SwEndNoteInfo; //Pagedescriptor //Client vom SwPageDesc der durch das Attribut "beschrieben" wird. @@ -55,6 +56,8 @@ class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient USHORT nDescNameIdx; // SW3-Reader: Stringpool-Index des Vorlagennamens SwModify* pDefinedIn; // Verweis auf das Objekt, in dem das // Attribut gesetzt wurde (CntntNode/Format) +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); public: SwFmtPageDesc( const SwPageDesc *pDesc = 0 ); @@ -75,8 +78,6 @@ public: virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); } const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); } @@ -86,6 +87,10 @@ public: // erfrage/setze, wo drin das Attribut verankert ist inline const SwModify* GetDefinedIn() const { return pDefinedIn; } void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; } + void RegisterToEndNotInfo( SwEndNoteInfo& ); + void RegisterToPageDesc( SwPageDesc& ); + bool KnowsPageDesc() const; + bool IsRegisteredAt( SwEndNoteInfo* pInfo ) const; }; diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index d1a33db7b246..f12ac15f5d69 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -44,9 +44,6 @@ class SwDoc; class SW_DLLPUBLIC SwFmt : public SwModify { -// friend class SwSwgReader; -// friend class SwSwgWriter; - String aFmtName; SwAttrSet aSet; @@ -70,6 +67,7 @@ protected: SwFmt( SwAttrPool& rPool, const String &rFmtNm, const USHORT* pWhichRanges, SwFmt *pDrvdFrm, USHORT nFmtWhich ); SwFmt( const SwFmt& rFmt ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue ); public: TYPEINFO(); //Bereits in Basisklasse Client drin. @@ -80,7 +78,6 @@ public: // fuer die Abfrage der Writer-Funktionen USHORT Which() const { return nWhichId; } - virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); // erfrage vom Format Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; @@ -114,7 +111,7 @@ public: virtual USHORT ResetAllFmtAttr(); // <-- - inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; } + inline SwFmt* DerivedFrom() const { return (SwFmt*)GetRegisteredIn(); } inline BOOL IsDefault() const { return DerivedFrom() == 0; } inline const String& GetName() const { return aFmtName; } diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index 388607d4f0e0..26da8b872073 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -27,14 +27,9 @@ #ifndef _FRMFMT_HXX #define _FRMFMT_HXX -// --> OD 2004-08-06 #i28749# #include -// <-- - #include - #include - #include "swdllapi.h" class SwFlyFrm; @@ -70,6 +65,8 @@ protected: pDrvdFrm, nFmtWhich ) {} + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue ); + public: TYPEINFO(); //Bereits in Basisklasse Client drin. @@ -81,8 +78,6 @@ public: virtual Graphic MakeGraphic( ImageMap* pMap = NULL ); - virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); - // returnt das IMapObject, das an dem Format (Fly), in der ImageMap // an der Point Position definiert ist. // rPoint - teste auf der DocPosition @@ -145,6 +140,7 @@ public: { m_wXObject = xObject; } DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt) + void RegisterToFormat( SwFmt& rFmt ) { Add( &rFmt ); } }; //Das FlyFrame-Format ------------------------------ diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index c3b9f7c7dc13..6bf1f073aa3d 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -29,9 +29,6 @@ #include #include "swdllapi.h" -//#ifndef _NUMRULE_HXX -//#include -//#endif #include #include @@ -48,6 +45,8 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient String sSuffix; protected: bool m_bEndNote; + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: SvxNumberType aFmt; USHORT nFtnOffset; @@ -67,8 +66,6 @@ public: void SetAnchorCharFmt( SwCharFmt* ); SwClient *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; } - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); - SwEndNoteInfo & operator=(const SwEndNoteInfo&); BOOL operator==( const SwEndNoteInfo &rInf ) const; @@ -80,6 +77,7 @@ public: void SetPrefix(const String& rSet) { sPrefix = rSet; } void SetSuffix(const String& rSet) { sSuffix = rSet; } + void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); } }; enum SwFtnPos diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx index 079fbeee4cf5..3af3d39e29ec 100644 --- a/sw/inc/lineinfo.hxx +++ b/sw/inc/lineinfo.hxx @@ -28,9 +28,6 @@ #define SW_LINEINFO_HXX #include "calbck.hxx" -//#ifndef _NUMRULE_HXX -//#include -//#endif #include #include "swdllapi.h" @@ -60,6 +57,8 @@ class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation fr BOOL bCountInFlys; //Count also within FlyFrames? BOOL bRestartEachPage; //Restart counting at the first paragraph of each page //(even on follows when paragraphs are splitted) +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwLineNumberInfo(); @@ -100,7 +99,7 @@ public: BOOL IsRestartEachPage() const { return bRestartEachPage; } void SetRestartEachPage( BOOL b ) { bRestartEachPage = b; } - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + bool HasCharFormat() const { return GetRegisteredIn() != 0; } }; diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 415ff86ee01a..3fa98364e177 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -228,6 +228,10 @@ public: // // End: Data collected during idle time // +protected: + // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!) + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); public: using SwCntntNode::GetAttr; @@ -794,9 +798,6 @@ public: TYPEINFO(); // fuer rtti - // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!) - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - // override SwIndexReg virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen, const bool bNegative = false, const bool bDelete = false ); diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 8bdf86af3a38..0ae7e1ca3be1 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -82,9 +82,8 @@ class IDocumentLineNumberAccess; class IDocumentLinksAdministration; class IDocumentFieldsAccess; class IDocumentContentOperations; -// --> OD 2007-10-31 #i83479# class IDocumentListItems; -// <-- +class SwOLENodes; // -------------------- // class SwNode @@ -398,11 +397,11 @@ protected: // SwAttrSet (handle): USHORT ClearItemsFromAttrSet( const std::vector& rWhichIds ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: TYPEINFO(); //Bereits in Basisklasse Client drin. - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - // MakeFrm will be called for a certain layout // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent) virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0; @@ -508,11 +507,12 @@ public: inline void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; } inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr; } + static SwOLENodes* CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize ); + private: // privater Constructor, weil nie kopiert werden darf !! SwCntntNode( const SwCntntNode & rNode ); SwCntntNode & operator= ( const SwCntntNode & rNode ); - }; diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 11920c2d6f61..99460b60b6be 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -35,23 +35,17 @@ #include "swdllapi.h" #include #include -#include // Fuer die inline-ASSERTs -#include // Fuer die inline-ASSERTs +#include +#include #include #include #include -// --> OD 2008-02-21 #refactorlists# -class SwNodeNum; #include -// <-- -// --> OD 2008-02-19 #refactorlists# #include + class SwTxtFmtColl; -// <-- -// --> OD 2008-07-08 #i91400# class IDocumentListsAccess; -// <-- - +class SwNodeNum; class Font; class SvxBrushItem; class SvxNumRule; @@ -72,6 +66,9 @@ class SW_DLLPUBLIC SwNumFmt : public SvxNumberFormat, public SwClient using SvxNumberFormat::operator ==; using SvxNumberFormat::operator !=; +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: SwNumFmt(); SwNumFmt( const SwNumFmt& ); @@ -84,9 +81,9 @@ public: BOOL operator==( const SwNumFmt& ) const; BOOL operator!=( const SwNumFmt& r ) const { return !(*this == r); } - SwCharFmt* GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; } + SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } void SetCharFmt( SwCharFmt* ); - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + void ForgetCharFmt(); virtual void SetCharFmtName(const String& rSet); virtual const String& GetCharFmtName()const; diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 6df70d20199d..070ace752129 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -160,6 +160,9 @@ class SW_DLLPUBLIC SwPageDesc : public SwModify SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwDoc *pDc ); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ); + public: const String &GetName() const { return aDescName; } void SetName( const String& rNewName ) { aDescName = rNewName; } @@ -213,7 +216,6 @@ public: void SetRegisterFmtColl( const SwTxtFmtColl* rFmt ); const SwTxtFmtColl* GetRegisterFmtColl() const; - virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ); void RegisterChange(); // erfragen und setzen der PoolFormat-Id diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index 68b9ba203ba3..30d593d7b4ec 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -69,6 +69,10 @@ public: private: // @@@ public copy ctor, but no copy assignment? SwFmtDrop & operator= (const SwFmtDrop &); + +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + public: // "pure virtual Methoden" vom SfxPoolItem @@ -94,10 +98,9 @@ public: inline USHORT GetDistance() const { return nDistance; } inline USHORT &GetDistance() { return nDistance; } - inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; } - inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)pRegisteredIn; } + inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } + inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)GetRegisteredIn(); } void SetCharFmt( SwCharFmt *pNew ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index b2b61dff6434..318319cf9884 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -77,14 +77,15 @@ public: virtual SwFieldType* Copy() const; SwDoc* GetDoc() const { return pDoc; } - // ueberlagert, um alle Ref-Felder zu updaten - virtual void Modify( SfxPoolItem *, SfxPoolItem * ); void MergeWithOtherDoc( SwDoc& rDestDoc ); static SwTxtNode* FindAnchor( SwDoc* pDoc, const String& rRefMark, USHORT nSubType, USHORT nSeqNo, USHORT* pStt, USHORT* pEnd = 0 ); +protected: + // ueberlagert, um alle Ref-Felder zu updaten + virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); }; /*-------------------------------------------------------------------- diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index e2aa129f65e1..1ad68c714330 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -425,6 +425,9 @@ private: void _MakeSetWhichIds(); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: // --> OD 2008-02-27 #refactorlists# - removed SwRegHistory( SwHistory* pHst ); @@ -432,8 +435,6 @@ public: SwRegHistory( const SwNode& rNd, SwHistory* pHst ); SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst ); - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); - /// @return true iff at least 1 item was inserted bool InsertItems( const SfxItemSet& rSet, xub_StrLen const nStart, xub_StrLen const nEnd, diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index db99cfdf4d52..f6b083dec54a 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -177,6 +177,9 @@ private: SW_DLLPRIVATE void ImplSetHiddenFlag( bool const bHidden, bool const bCondition); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: TYPEINFO(); // rtti @@ -193,10 +196,8 @@ public: SectionType GetType() const { return m_Data.GetType(); } void SetType(SectionType const eType) { return m_Data.SetType(eType); } - SwSectionFmt* GetFmt() { return (SwSectionFmt*)pRegisteredIn; } - SwSectionFmt* GetFmt() const { return (SwSectionFmt*)pRegisteredIn; } - - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + SwSectionFmt* GetFmt() { return (SwSectionFmt*)GetRegisteredIn(); } + SwSectionFmt* GetFmt() const { return (SwSectionFmt*)GetRegisteredIn(); } // setze die Hidden/Protected -> gesamten Baum updaten ! // (Attribute/Flags werden gesetzt/erfragt) @@ -300,6 +301,7 @@ class SW_DLLPUBLIC SwSectionFmt protected: SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); public: TYPEINFO(); //Bereits in Basisklasse Client drin. @@ -311,7 +313,6 @@ public: //Erzeugt die Ansichten virtual void MakeFrms(); - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); // erfrage vom Format Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx index 042654389174..93d7fe578a1e 100644 --- a/sw/inc/swddetbl.hxx +++ b/sw/inc/swddetbl.hxx @@ -42,12 +42,13 @@ public: BOOL bUpdate = TRUE ); ~SwDDETable(); - void Modify( SfxPoolItem*, SfxPoolItem* ); void ChangeContent(); BOOL NoDDETable(); SwDDEFieldType* GetDDEFldType(); inline const SwDDEFieldType* GetDDEFldType() const; +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); }; diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx new file mode 100755 index 000000000000..be729771b54b --- /dev/null +++ b/sw/inc/switerator.hxx @@ -0,0 +1,47 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SWITERATOR_HXX +#define _SWITERATOR_HXX + +#include +#include + +template< class TElementType, class TSource > class SwIterator +{ + SwClientIter aClientIter; +public: + + SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); } + TElementType* First() { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); } + TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); } + TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); } + TElementType* Previous() { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p); } + static TElementType* FirstElement( const TSource& rMod ) { SwClient* p = SwClientIter(rMod).First(TYPE(TElementType)); return PTR_CAST(TElementType,p); } + bool IsChanged() { return aClientIter.IsChanged(); } +}; + +#endif diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 1b1316ce37d1..f8b59353097c 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -27,9 +27,7 @@ #ifndef _SWTABLE_HXX #define _SWTABLE_HXX #include -#ifndef _TOOLS_REF_HXX #include -#endif #include #include #include @@ -43,6 +41,7 @@ class SwStartNode; #include #endif +class SwFmt; class Color; class SwFrmFmt; class SwTableFmt; @@ -86,7 +85,7 @@ typedef SwTableLine* SwTableLinePtr; class SW_DLLPUBLIC SwTable: public SwClient //Client vom FrmFmt { - using SwClient::IsModifyLocked; + protected: SwTableLines aLines; @@ -116,6 +115,8 @@ protected: BOOL IsModifyLocked(){ return bModifyLocked;} + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: enum SearchType { @@ -175,10 +176,9 @@ public: SwTableLines &GetTabLines() { return aLines; } const SwTableLines &GetTabLines() const { return aLines; } - SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } - - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwTableFmt* GetTableFmt() const { return (SwTableFmt*)GetRegisteredIn(); } void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart, BOOL bHidden = FALSE, BOOL bCurRowOnly = FALSE ) const; @@ -322,6 +322,7 @@ public: SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); BOOL SetRowHeight( SwTableBox& rAktBox, USHORT eType, SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo ); + void RegisterToFormat( SwFmt& rFmt ); #ifdef DBG_UTIL void CheckConsistency() const; #endif @@ -348,8 +349,8 @@ public: void SetUpper( SwTableBox *pNew ) { pUpper = pNew; } - SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } //Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen. SwFrmFmt* ClaimFrmFmt(); @@ -364,6 +365,7 @@ public: SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const; bool hasSoftPageBreak() const; + void RegisterToFormat( SwFmt& rFmt ); }; class SW_DLLPUBLIC SwTableBox: public SwClient //Client vom FrmFmt @@ -402,8 +404,8 @@ public: const SwTableLine *GetUpper() const { return pUpper; } void SetUpper( SwTableLine *pNew ) { pUpper = pNew; } - SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; } - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; } + SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } //Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen. SwFrmFmt* ClaimFrmFmt(); @@ -468,6 +470,8 @@ public: const SwTableBox& FindEndOfRowSpan( const SwTable& rTable, USHORT nMaxStep = USHRT_MAX ) const { return const_cast(this)->FindEndOfRowSpan( rTable, nMaxStep ); } + void RegisterToFormat( SwFmt& rFmt ) ; + void ForgetFrmFmt(); }; class SwCellFrm; diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx index 96479197cde6..86ace11c4e6b 100644 --- a/sw/inc/swtblfmt.hxx +++ b/sw/inc/swtblfmt.hxx @@ -86,12 +86,12 @@ protected: : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange ) {} + // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute) + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue ); + public: TYPEINFO(); //Bereits in Basisklasse Client drin. - // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute) - virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ); - DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt) }; diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index fea15cfafb82..e8ebce2782c6 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -91,6 +91,10 @@ class SW_DLLPUBLIC SwTOXMark SwTOXMark(); // to create the dflt. atr. in _InitCore +protected: + // SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); + public: TYPEINFO(); // rtti @@ -105,9 +109,6 @@ 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; @@ -151,7 +152,9 @@ public: SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndexMark> const& xMark) { m_wXDocumentIndexMark = xMark; } - + void DeRegister() { GetRegisteredInNonConst()->Remove( this ); } + void RegisterToTOXType( SwTOXType& rMark ); + static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType ); }; /*-------------------------------------------------------------------- @@ -592,6 +595,7 @@ public: // #i21237# void AdjustTabStops(SwDoc & rDoc, BOOL bDefaultRightTabStop); SwTOXBase& operator=(const SwTOXBase& rSource); + void RegisterToTOXType( SwTOXType& rMark ); }; diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index 65ecd951868c..da925ea1b886 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -45,9 +45,9 @@ public: SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtCharFmt( ); - // werden vom SwFmtCharFmt hierher weitergeleitet - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient - virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!) + void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* ); + bool GetInfo( SfxPoolItem& rInfo ) const; // get and set TxtNode pointer void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } @@ -88,15 +88,17 @@ public: class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient { SwTxtNode* m_pTxtNode; - +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtRuby(); TYPEINFO(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode); + /// get and set TxtNode pointer const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; } inline const SwTxtNode& GetTxtNode() const; diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index 8e0d66df654e..bec9f403c41c 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -45,14 +45,18 @@ class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient // forbidden and not implemented. SwTxtINetFmt(); +protected: +virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtINetFmt(); TYPEINFO(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode); + // get and set TxtNode pointer const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; } inline const SwTxtNode& GetTxtNode() const; diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 7f16e4e4d44c..7479623fb072 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -680,12 +680,12 @@ class SwUndoFmtAttrHelper : public SwClient { ::std::auto_ptr m_pUndo; const bool m_bSaveDrawPt; +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); } // release the undo object (so it is not deleted here), and return it SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); } @@ -1243,9 +1243,11 @@ class SwUndoSetFlyFmt : public SwUndo, public SwClient BOOL bAnchorChgd; void PutAttr( USHORT nWhich, const SfxPoolItem* pItem ); - void Modify( SfxPoolItem*, SfxPoolItem* ); void GetAnchor( SwFmtAnchor& rAnhor, ULONG nNode, xub_StrLen nCntnt ); +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + public: SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt ); virtual ~SwUndoSetFlyFmt(); @@ -1254,6 +1256,7 @@ public: virtual void Redo( SwUndoIter& ); virtual SwRewriter GetRewriter() const; + void DeRegisterFromFormat( SwFmt& ); }; //-------------------------------------------------------------------- diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 6c12a01b0d47..9e3425e04c90 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -98,7 +98,7 @@ class UnoActionRemoveContext ::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); /// helper function for implementing SwClient::Modify -void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); +void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew); #include diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx index fdd5df4c8a6c..a212efd933f3 100644 --- a/sw/inc/unobookmark.hxx +++ b/sw/inc/unobookmark.hxx @@ -220,8 +220,9 @@ class SwXFieldmarkParameters // 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); + protected: //SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); private: ::sw::mark::IFieldmark::parameter_map_t* getCoreParameters() throw (::com::sun::star::uno::RuntimeException); }; diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx index eeced6e62c50..17cbe800cb2f 100644 --- a/sw/inc/unochart.hxx +++ b/sw/inc/unochart.hxx @@ -171,6 +171,10 @@ class SwChartDataProvider : rtl::OUString GetBrokenCellRangeForExport( const rtl::OUString &rCellRangeRepresentation ); +protected: + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwChartDataProvider( const SwDoc* pDoc ); virtual ~SwChartDataProvider(); @@ -197,10 +201,6 @@ public: 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); - - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } void AddDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence ); @@ -292,6 +292,10 @@ class SwChartDataSequence : SwChartDataSequence( const SwChartDataSequence &rObj ); SwChartDataSequence & operator = ( const SwChartDataSequence & ); +protected: + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwChartDataSequence( SwChartDataProvider &rProvider, SwFrmFmt &rTblFmt, @@ -348,11 +352,6 @@ public: 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 >& aListener ) throw (::com::sun::star::uno::RuntimeException); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } sal_Bool DeleteBox( const SwTableBox &rBox ); diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index d4ac0f4f3d61..33ed59bd50b0 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -257,6 +257,9 @@ class SwXShape : public SwXShapeBaseClass, protected: virtual ~SwXShape(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape); @@ -310,9 +313,6 @@ public: virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException); // <-- - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;} ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > GetAggregationInterface() {return xShapeAgg;} diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx index 521a85e9168e..18dcdfc86b68 100644 --- a/sw/inc/unofield.hxx +++ b/sw/inc/unofield.hxx @@ -77,6 +77,9 @@ class SwXFieldMaster : public cppu::WeakImplHelper4 protected: virtual ~SwXFieldMaster(); + //SwClient +virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId); @@ -109,9 +112,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 ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - static rtl::OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc); static rtl::OUString LocalizeFormula(const SwSetExpField& rFld, const rtl::OUString& rFormula, sal_Bool bQuery); @@ -122,9 +122,6 @@ public: sal_uInt16 GetResId() const {return nResTypeId;} }; -/* -----------------04.12.98 12:49------------------- - * - * --------------------------------------------------*/ struct SwFieldProperties_Impl; class SwXTextField : public cppu::WeakImplHelper5 < @@ -153,6 +150,9 @@ class SwXTextField : public cppu::WeakImplHelper5 SwDoc* GetDoc() {return m_pDoc;} protected: virtual ~SwXTextField(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc=0); SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc); @@ -198,24 +198,18 @@ public: //XUpdatable virtual void SAL_CALL update( ) 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 ); const SwField* GetField() const; const SwFmtFld* GetFldFmt(){return GetField() ? pFmtFld : 0; }; void Invalidate(); -}; -/// @return a SwXTextField, either an already existing one or a new one -SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt); + /// @return an SwXTextField, either an already existing one or a new one + static SwXTextField* CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt); +}; -/* -----------------21.12.98 10:26------------------- - * - * --------------------------------------------------*/ typedef cppu::WeakImplHelper2 < @@ -292,9 +286,6 @@ public: virtual void Invalidate(); }; -/* -----------------21.12.98 14:49------------------- - * - * --------------------------------------------------*/ class SwXFieldEnumeration : public cppu::WeakImplHelper2 < ::com::sun::star::container::XEnumeration, @@ -309,6 +300,8 @@ class SwXFieldEnumeration : public cppu::WeakImplHelper2 protected: virtual ~SwXFieldEnumeration(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: SwXFieldEnumeration(SwDoc* pDoc); @@ -321,8 +314,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 ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); }; #endif diff --git a/sw/inc/unoflatpara.hxx b/sw/inc/unoflatpara.hxx index acc004d473ab..36d8025ab20f 100644 --- a/sw/inc/unoflatpara.hxx +++ b/sw/inc/unoflatpara.hxx @@ -122,8 +122,9 @@ public: virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException); virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException); +protected: // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); private: SwXFlatParagraphIterator( const SwXFlatParagraphIterator & ); // not defined diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 65de34a4db7f..11baa88741b7 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -55,10 +55,6 @@ class SwDoc; class SwFmt; class SwFlyFrmFmt; - -/*-----------------12.02.98 11:21------------------- - ---------------------------------------------------*/ class BaseFrameProperties_Impl; class SwXFrame : public cppu::WeakImplHelper6 < @@ -87,6 +83,7 @@ class SwXFrame : public cppu::WeakImplHelper6 protected: com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData; com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxStyleFamily; + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); virtual ~SwXFrame(); public: @@ -145,9 +142,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 ); - //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 ); void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); @@ -163,9 +157,7 @@ public: void SetSelection(SwPaM& rCopySource); static SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt ); }; -/*-----------------20.02.98 11:28------------------- ---------------------------------------------------*/ typedef cppu::WeakImplHelper3 < ::com::sun::star::text::XTextFrame, @@ -244,9 +236,7 @@ public: void * SAL_CALL operator new( size_t ) throw(); void SAL_CALL operator delete( void * ) throw(); }; -/*-----------------20.02.98 11:28------------------- ---------------------------------------------------*/ typedef cppu::WeakImplHelper2 < ::com::sun::star::text::XTextContent, @@ -370,7 +360,8 @@ public: // ::com::sun::star::util::XModifyListener virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); - void Modify( SfxPoolItem*, SfxPoolItem* ); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx index 9071a388a5b8..bb48c64b208b 100644 --- a/sw/inc/unoport.hxx +++ b/sw/inc/unoport.hxx @@ -133,9 +133,9 @@ private: SwFmtFld * GetFldFmt(bool bInit = false); -protected: + void init(const SwUnoCrsr* pPortionCursor); - //SfxItemPropertySet& GetPropSet() { return aPropSet; } +protected: void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, @@ -145,9 +145,6 @@ protected: 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::Any GetPropertyValue( const SfxItemPropertyMap *pEntry, -// SwUnoCrsr *pUnoCrsr, -// SfxItemSet *pSet ); void GetPropertyValues( const ::rtl::OUString *pPropertyNames, ::com::sun::star::uno::Any *pValues, sal_Int32 nLength ); @@ -161,6 +158,9 @@ protected: virtual ~SwXTextPortion(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType ); SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt ); @@ -229,9 +229,6 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - void SetRefMark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark) { m_xRefMark = xMark; } @@ -317,9 +314,9 @@ public: virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - +protected: //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; #endif diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx index 92db9257c4a6..5e491dc9ac34 100644 --- a/sw/inc/unoredline.hxx +++ b/sw/inc/unoredline.hxx @@ -148,9 +148,9 @@ public: 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); - const SwRedline* GetRedline() const {return pRedline;} +protected: + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; #endif diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx index 948e972e1998..fc6648ce6ca5 100644 --- a/sw/inc/unoredlines.hxx +++ b/sw/inc/unoredlines.hxx @@ -95,9 +95,9 @@ public: 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 ); - +protected: //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx index 8423ac29ad4c..b904ad8374c9 100644 --- a/sw/inc/unosett.hxx +++ b/sw/inc/unosett.hxx @@ -176,6 +176,10 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5 static String sInvalidStyle; protected: virtual ~SwXNumberingRules(); + + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering SwXNumberingRules(const SwNumRule& rRule); // NumRule for paragraphs, numbering styles @@ -223,9 +227,6 @@ public: const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rProperties, sal_Int32 nIndex) throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - const String* GetNewCharStyleNames() const {return sNewCharStyleNames;} const String* GetBulletFontNames() const {return sNewBulletFontNames;} const SwNumRule* GetNumRule() {return pNumRule;} diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 4a9fd533da66..cd1da6df9aea 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -211,6 +211,7 @@ 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); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, BOOL bConditional = FALSE); SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam, @@ -286,7 +287,6 @@ public: StartListening(*pBasePool); } SwDoc* GetDoc() const { return m_pDoc; } - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); }; /* -----------------------------15.12.00 14:25-------------------------------- @@ -377,10 +377,12 @@ class SwXAutoStyleFamily : public cppu::WeakImplHelper1< com::sun::star::style:: SwDocShell *pDocShell; IStyleAccess::SwAutoStyleFamily eFamily; +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXAutoStyleFamily(SwDocShell* pDocShell, IStyleAccess::SwAutoStyleFamily eFamily); virtual ~SwXAutoStyleFamily(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); //XAutoStyleFamily virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyle > SAL_CALL insertStyle( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Values ) throw (::com::sun::star::uno::RuntimeException); @@ -400,13 +402,14 @@ class SwXAutoStylesEnumerator : public cppu::WeakImplHelper1< ::com::sun::star:: public: SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam ); virtual ~SwXAutoStylesEnumerator(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); //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); - +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; + /*-- 19.05.2006 11:20:02--------------------------------------------------- an automatic style -----------------------------------------------------------------------*/ @@ -428,7 +431,6 @@ public: SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam ); virtual ~SwXAutoStyle(); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); //XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); @@ -461,6 +463,9 @@ public: // Special virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getProperties() throw (::com::sun::star::uno::RuntimeException); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + }; #endif diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 372b55ca9193..99006ac57d02 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -115,6 +115,9 @@ protected: virtual ~SwXCell(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX ); SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface @@ -162,9 +165,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 ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - //XEnumerationAccess - frueher XParagraphEnumerationAccess virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); @@ -194,6 +194,9 @@ class SwXTextTableRow : public cppu::WeakImplHelper2 SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } protected: virtual ~SwXTextTableRow(); + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine); @@ -214,9 +217,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 ); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - const SwTableLine* GetTblRow() const {return pLine;} static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine); }; @@ -274,7 +274,7 @@ public: 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); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); // ITextCursorHelper virtual const SwPaM* GetPaM() const; @@ -418,7 +418,7 @@ public: SwRangeDescriptor& rDesc); //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } @@ -505,7 +505,7 @@ public: 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); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } sal_uInt16 getRowCount(void); @@ -567,7 +567,7 @@ public: 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); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; /* -----------------03.02.99 07:31------------------- @@ -615,7 +615,7 @@ public: 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); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; #endif diff --git a/sw/inc/unotextmarkup.hxx b/sw/inc/unotextmarkup.hxx index 98bb3416d385..7d48595e8e3b 100644 --- a/sw/inc/unotextmarkup.hxx +++ b/sw/inc/unotextmarkup.hxx @@ -65,14 +65,14 @@ public: // ::com::sun::star::text::XMultiTextMarkup: virtual void SAL_CALL commitMultiTextMarkup( const ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextMarkupDescriptor >& aMarkups ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - private: SwXTextMarkup( const SwXTextMarkup & ); // not defined SwXTextMarkup & operator =( const SwXTextMarkup & ); // not defined protected: + //SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + SwTxtNode* mpTxtNode; const ModelToViewHelper::ConversionMap* mpConversionMap; diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx index b755cbc1631b..433af9eae145 100644 --- a/sw/inc/usrfld.hxx +++ b/sw/inc/usrfld.hxx @@ -61,8 +61,6 @@ public: inline BOOL IsValid() const; inline void ChgValid( BOOL bNew ); - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); - double GetValue(SwCalc& rCalc); // Member nValue neu berrechnen inline double GetValue() const; inline void SetValue(const double nVal); @@ -75,6 +73,8 @@ public: virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nMId ) const; virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nMId ); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); }; inline BOOL SwUserFieldType::IsValid() const diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index 221c7e1650a2..91cbe0b9324f 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -216,7 +216,7 @@ SwAccessibleFrameBase::~SwAccessibleFrameBase() { } -void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( GetFrm() ); @@ -230,13 +230,13 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) OUString sOldName( GetName() ); ASSERT( !pOld || - static_cast < SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ), + static_cast < const SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ), "invalid old name" ); const String& rNewName = pFrmFmt->GetName(); SetName( rNewName ); ASSERT( !pNew || - static_cast < SwStringMsgPoolItem * >( pNew )->GetString() == rNewName, + static_cast < const SwStringMsgPoolItem * >( pNew )->GetString() == rNewName, "invalid new name" ); if( sOldName != GetName() ) @@ -250,18 +250,20 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) } break; case RES_OBJECTDYING: + // mba: it seems that this class intentionally does not call code in base class SwClient if( GetRegisteredIn() == - static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) ) - pRegisteredIn->Remove( this ); + static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) ) + GetRegisteredInNonConst()->Remove( this ); break; case RES_FMT_CHG: - if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() && - static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() ) - pRegisteredIn->Remove( this ); + if( static_cast< const SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() && + static_cast< const SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() ) + GetRegisteredInNonConst()->Remove( this ); break; + default: - SwClient::Modify( pOld, pNew ); + // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING break; } } @@ -271,7 +273,7 @@ void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive ) vos::OGuard aGuard(Application::GetSolarMutex()); if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); SwAccessibleContext::Dispose( bRecursive ); } diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx index faa4bb492697..551f8b452621 100644 --- a/sw/source/core/access/accframebase.hxx +++ b/sw/source/core/access/accframebase.hxx @@ -51,6 +51,7 @@ protected: virtual void _InvalidateFocus(); virtual ~SwAccessibleFrameBase(); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: @@ -60,8 +61,6 @@ public: virtual sal_Bool HasCursor(); // required by map to remember that object - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - static sal_uInt8 GetNodeType( const SwFlyFrm *pFlyFrm ); // The object is not visible an longer and should be destroyed diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 0d7ab98d3b03..32d1fc424cb8 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -68,14 +68,12 @@ #include #include #include -// OD 15.01.2003 #103492# #include -// --> OD 2005-12-13 #i27301# #include #include -// <-- #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -2722,15 +2720,8 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas() if ( pTxtNode ) { // loop on all text frames registered at the text node. - SwClientIter aIter( *pTxtNode ); - for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); - pFrm; - pFrm = (SwFrm*)aIter.Next() ) - { - ASSERT( dynamic_cast(pFrm), - " - unexpected frame type" ); - SwTxtFrm* pTxtFrm( dynamic_cast(pFrm) ); - if ( pTxtFrm ) + SwIterator aIter( *pTxtNode ); + for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() ) { uno::WeakReference < XAccessible > xWeakAcc; SwAccessibleContextMap_Impl::iterator aMapIter = @@ -2758,7 +2749,6 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas() } } } - } // prepare next turn: get next cursor in ring pCrsr = static_cast( pCrsr->GetNext() ); diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index fea47cb212e5..8764feff8d74 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -92,7 +92,7 @@ SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame() { } -void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; // --> OD 2009-07-14 #i73249# @@ -112,9 +112,9 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) case RES_TITLE_CHANGED: { const String& sOldTitle( - dynamic_cast(pOld)->GetString() ); + dynamic_cast(pOld)->GetString() ); const String& sNewTitle( - dynamic_cast(pNew)->GetString() ); + dynamic_cast(pNew)->GetString() ); if ( sOldTitle == sNewTitle ) { break; @@ -168,7 +168,7 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) case RES_FMT_CHG: if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() && static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() ) - pRegisteredIn->Remove( this ); + GetRegisteredIn()->Remove( this ); break; */ } diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx index 6e070c6dd864..e07d9ff0ffc0 100644 --- a/sw/source/core/access/accnotextframe.hxx +++ b/sw/source/core/access/accnotextframe.hxx @@ -47,14 +47,14 @@ protected: const SwNoTxtNode *GetNoTxtNode() const; + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwAccessibleNoTextFrame( SwAccessibleMap* pInitMap, sal_Int16 nInitRole, const SwFlyFrm *pFlyFrm ); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - //===== XAccessibleContext ============================================== // --> OD 2009-07-14 #i73249# diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 368e076470ab..84d0cc67e7ab 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -2669,10 +2669,10 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getNumberOfLineWithCaret() } // --> OD 2010-02-19 #i108125# -void SwAccessibleParagraph::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwAccessibleParagraph::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { mpParaChangeTrackInfo->reset(); - SwClient::Modify( pOld, pNew ); + CheckRegistration( pOld, pNew ); } // <-- diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx index 7e07fa132d05..8a45a4bdd64d 100644 --- a/sw/source/core/access/accpara.hxx +++ b/sw/source/core/access/accpara.hxx @@ -234,6 +234,8 @@ protected: ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew); + public: SwAccessibleParagraph( SwAccessibleMap& rInitMap, @@ -243,10 +245,6 @@ public: virtual sal_Bool HasCursor(); // required by map to remember that object - // --> OD 2010-02-19 #i108125# - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew); - // <-- - //===== XAccessibleContext ============================================== /// Return this object's description. diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 43befb2a3f86..869f9b4c7d43 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -740,7 +740,7 @@ SwAccessibleTable::~SwAccessibleTable() delete mpTableData; } -void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; const SwTabFrm *pTabFrm = static_cast< const SwTabFrm * >( GetFrm() ); @@ -787,13 +787,14 @@ void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) break; case RES_OBJECTDYING: + // mba: it seems that this class intentionally does not call code in base class SwClient if( GetRegisteredIn() == - static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) ) - pRegisteredIn->Remove( this ); + static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) ) + GetRegisteredInNonConst()->Remove( this ); break; default: - SwClient::Modify( pOld, pNew ); + // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING break; } } @@ -1360,7 +1361,7 @@ void SwAccessibleTable::Dispose( sal_Bool bRecursive ) vos::OGuard aGuard(Application::GetSolarMutex()); if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); SwAccessibleContext::Dispose( bRecursive ); } @@ -1717,7 +1718,7 @@ SwAccessibleTableData_Impl* SwAccessibleTableColHeaders::CreateNewTableData() } -void SwAccessibleTableColHeaders::Modify( SfxPoolItem * /*pOld*/, SfxPoolItem * /*pNew*/ ) +void SwAccessibleTableColHeaders::Modify( const SfxPoolItem * /*pOld*/, const SfxPoolItem * /*pNew*/ ) { } diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx index 8bdf2e8b49b2..82141c09bead 100644 --- a/sw/source/core/access/acctable.hxx +++ b/sw/source/core/access/acctable.hxx @@ -89,12 +89,12 @@ protected: // Is table data evailable? sal_Bool HasTableData() const { return (mpTableData != 0); } + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwAccessibleTable( SwAccessibleMap* pInitMap, const SwTabFrm* pTableFrm ); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - //===== XInterface ====================================================== // (XInterface methods need to be implemented to disambigouate @@ -277,13 +277,12 @@ protected: {} virtual SwAccessibleTableData_Impl* CreateNewTableData(); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: SwAccessibleTableColHeaders( SwAccessibleMap *pMap, const SwTabFrm *pTabFrm ); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - //===== XInterface ====================================================== virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx index 75fc1fdebc0e..c0188c7eb193 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -84,7 +84,7 @@ SwAccessibleTextFrame::~SwAccessibleTextFrame() { } -void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; // --> OD 2009-07-14 #i73249# @@ -103,9 +103,9 @@ void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) case RES_TITLE_CHANGED: { const String& sOldTitle( - dynamic_cast(pOld)->GetString() ); + dynamic_cast(pOld)->GetString() ); const String& sNewTitle( - dynamic_cast(pNew)->GetString() ); + dynamic_cast(pNew)->GetString() ); if ( sOldTitle == sNewTitle ) { break; diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx index d6c9a7a74331..a2b891de18e4 100644 --- a/sw/source/core/access/acctextframe.hxx +++ b/sw/source/core/access/acctextframe.hxx @@ -46,13 +46,12 @@ protected: virtual ~SwAccessibleTextFrame(); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + public: SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm ); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - //===== XAccessibleContext ============================================== // --> OD 2009-07-14 #i73249# diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 65b11401b1da..18449844cde4 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -28,127 +28,107 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include // fuer RES_.. +#include // contains RES_.. IDs #include #include -#include -#include - -#ifdef DBG_UTIL -#include -#endif +#include // mba: get rid of that dependency +#include // mba: get rid of that dependency static SwClientIter* pClientIters = 0; -TYPEINIT0(SwClient); //rtti - -/************************************************************************* -|* SwClient::SwClient(SwModify *) -|* -|* Beschreibung callback.doc V1.14 -|* Ersterstellung VB 20.03.91 -|* Letzte Aenderung MA 20. Mar. 95 -*************************************************************************/ - +TYPEINIT0(SwClient); +/*************************************************************************/ SwClient::SwClient(SwModify *pToRegisterIn) - : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ) + : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false) { - bModifyLocked = - bInModify = - bInDocDTOR = - bInCache = FALSE; - bInSwFntCache = FALSE; - if(pToRegisterIn) + // connect to SwModify pToRegisterIn->Add(this); } -/************************************************************************* -|* SwClient::Modify() -|* -|* Beschreibung callback.doc V1.14 -|* Ersterstellung VB 20.03.91 -|* Letzte Aenderung VB 20.03.91 -*************************************************************************/ - - -void SwClient::Modify( SfxPoolItem *pOld, SfxPoolItem * ) +/*************************************************************************/ +void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem * ) { + // this method only handles notification about dying SwModify objects if( (!pOld || pOld->Which() != RES_OBJECTDYING) ) return; - SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld; - if(pDead->pObject == pRegisteredIn) + const SwPtrMsgPoolItem *pDead = static_cast(pOld); + if(pDead && pDead->pObject == pRegisteredIn) { - SwModify *pAbove = (SwModify*)pRegisteredIn->GetRegisteredIn(); + // I've got a notification from the object I know + SwModify *pAbove = const_cast(pRegisteredIn->GetRegisteredIn()); if(pAbove) { + // if the dying object itself was listening at an SwModify, I take over + // adding myself to pAbove will automatically remove me from my current pRegisteredIn pAbove->Add(this); return; } + + // destroy connection pRegisteredIn->Remove(this); } } -/************************************************************************* -|* SwClient::~SwClient() -|* -|* Beschreibung callback.doc V1.14 -|* Ersterstellung VB 20.03.91 -|* Letzte Aenderung MA 25. Jan. 94 -*************************************************************************/ +void SwClient::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) +{ + CheckRegistration( pOldValue, pNewValue ); +} +void SwClient::ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) +{ + Modify( pOldValue, pNewValue ); +} + +void SwClient::SwClientNotify( SwModify*, USHORT ) +{ +} +//************************************************************************* SwClient::~SwClient() { + DBG_ASSERT( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" ); if( pRegisteredIn && pRegisteredIn->GetDepends() ) + // still connected pRegisteredIn->Remove( this ); - - ASSERT( !IsModifyLocked(), "Modify destroyed but locked." ); } - // erfrage vom Client Informationen +/*************************************************************************/ BOOL SwClient::GetInfo( SfxPoolItem& ) const { - return TRUE; // und weiter + return TRUE; // no information here, return TRUE to enable continuation } -/************************************************************************* -|* SwModify::SwModify( SwModify * ) -|* -|* Beschreibung Dokument 1.7 -|* Ersterstellung JP 20.11.90 -|* Letzte Aenderung VB 20.03.91 -*************************************************************************/ - -SwModify::SwModify( SwModify *pToRegisterIn ) - : SwClient(pToRegisterIn), pRoot( 0 ) +/*************************************************************************/ +SwModify::SwModify() + : SwClient(0), pRoot(0) { + bModifyLocked = FALSE; + bLockClientList = FALSE; + bInDocDTOR = FALSE; + bInCache = FALSE; + bInSwFntCache = FALSE; } -// @@@ forbidden and not implemented, but needs to be accessible (protected). -SwModify::SwModify( const SwModify & ) - : SwClient( 0 ) +SwModify::SwModify( SwModify *pToRegisterIn ) + : SwClient(pToRegisterIn), pRoot( 0 ) { - OSL_PRECOND(0, "SwModify(const SwModify&): not implemented."); + bModifyLocked = FALSE; + bLockClientList = FALSE; + bInDocDTOR = FALSE; + bInCache = FALSE; + bInSwFntCache = FALSE; } -/************************************************************************* -|* SwModify::~SwModify() -|* -|* Beschreibung Dokument 1.7 -|* Ersterstellung JP 20.11.90 -|* Letzte Aenderung JP 15.04.94 -*************************************************************************/ - - - +/*************************************************************************/ SwModify::~SwModify() { + ASSERT( !IsModifyLocked(), "Modify destroyed but locked." ); + if ( IsInCache() ) SwFrm::GetCache().Delete( this ); @@ -157,44 +137,40 @@ SwModify::~SwModify() if( pRoot ) { + // there are depending objects if( IsInDocDTOR() ) { - // alle Clients "logisch" austragen + // if document gets destroyed anyway, just tell clients to forget me + // so that they don't try to get removed from my list later when they also get destroyed SwClientIter aIter( *this ); - SwClient* p; - while( 0 != ( p = aIter++ ) ) - p->pRegisteredIn = 0; - - p = aIter.GoRoot(); // wieder ab Root (==Start) anfangen - do { + SwClient* p = aIter.GoStart(); + while ( p ) + { p->pRegisteredIn = 0; - } while( 0 != ( p = aIter-- ) ); + p = aIter++; + } } else { - // verschicke die Nachricht an die abgeleiteten Objekte. + // notify all clients that they shall remove themselves SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this ); - Modify( &aDyObject, &aDyObject ); + NotifyClients( &aDyObject, &aDyObject ); - // Zwangsummeldung aller derjenigen, die sich nicht ausgetragen - // haben, durch Aufruf von SwClient::Modify() + // remove all clients that have not done themselves + // mba: possibly a hotfix for forgotten base class calls?! while( pRoot ) - pRoot->SwClient::Modify(&aDyObject, &aDyObject); + pRoot->CheckRegistration(&aDyObject, &aDyObject); } } } -/************************************************************************* -|* SwModify::Modify( SwHint * pOldValue, SwHint * pNewValue ) -|* -|* Beschreibung Dokument 1.7 -|* Ersterstellung JP 20.11.90 -|* Letzte Aenderung MA 20. Mar. 95 -*************************************************************************/ - - +/*************************************************************************/ +void SwModify::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) +{ + NotifyClients( pOldValue, pNewValue ); +} -void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) +void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { if (IsInCache() || IsInSwFntCache()) { @@ -208,50 +184,38 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) LockModify(); -#ifndef DBG_UTIL - bInModify = TRUE; -#else + // mba: WTF?! if( !pOldValue ) - bInModify = TRUE; + bLockClientList = TRUE; else - // following Modifies don't calls an ASSRT + { + // following Modifies shouldn't call an ASSERT switch( pOldValue->Which() ) { case RES_OBJECTDYING: case RES_REMOVE_UNO_OBJECT: - bInModify = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this; + bLockClientList = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this; break; case RES_FOOTNOTE_DELETED: case RES_REFMARK_DELETED: case RES_TOXMARK_DELETED: case RES_FIELD_DELETED: - bInModify = FALSE; + bLockClientList = FALSE; break; default: - bInModify = TRUE; + bLockClientList = TRUE; } -#endif - - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do - { - pLast->Modify( pOldValue, pNewValue ); - if( !pRoot ) // Baum schon Weg ?? - break; - } while( 0 != ( pLast = aIter++ )); + } - bInModify = FALSE; + ModifyBroadcast( pOldValue, pNewValue ); + bLockClientList = FALSE; UnlockModify(); } -// erfrage vom Modify Informationen - BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const { - BOOL bRet = TRUE; // bedeutet weiter zum naechsten + BOOL bRet = TRUE; // means: continue with next one if( pRoot ) { @@ -264,48 +228,38 @@ BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const ; } - return bRet; // und weiter + return bRet; } -/************************************************************************* -|* SwModify::Add( SwClient *pDepend ) -|* -|* Beschreibung Dokument 1.7 -|* Ersterstellung JP 20.11.90 -|* Letzte Aenderung JP 14.09.94 -*************************************************************************/ - - - +/*************************************************************************/ void SwModify::Add(SwClient *pDepend) { - ASSERT( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" ); + ASSERT( !bLockClientList, "Client inserted while in Modify" ); - // nur wenn das hier noch nicht eingetragen ist einfuegen if(pDepend->pRegisteredIn != this ) { #ifdef DBG_UTIL SwClientIter* pTmp = pClientIters; while( pTmp ) { - ASSERT( &pTmp->rRoot != pRoot, - "Client beim angemeldeten ClientIter einfuegen?" ); + ASSERT( &pTmp->GetModify() != pRoot, "Client added to active ClientIter" ); pTmp = pTmp->pNxtIter; } #endif - // wenn schon wanders angemeldet, dann dort abmelden + // deregister new client in case it is already registered elsewhere if( pDepend->pRegisteredIn != 0 ) pDepend->pRegisteredIn->Remove( pDepend ); if( !pRoot ) { + // first client added pRoot = pDepend; pRoot->pLeft = 0; pRoot->pRight = 0; } else { - // immer hinter die Root haengen + // append client pDepend->pRight = pRoot->pRight; pRoot->pRight = pDepend; pDepend->pLeft = pRoot; @@ -313,29 +267,24 @@ void SwModify::Add(SwClient *pDepend) pDepend->pRight->pLeft = pDepend; } + // connect client to me pDepend->pRegisteredIn = this; } } -/************************************************************************* -|* SwModify::_Remove( SwClient *pDepend ) -|* -|* Beschreibung Dokument 1.7 -|* Ersterstellung JP 20.11.90 -|* Letzte Aenderung JP 14.09.94 -*************************************************************************/ - - +/*************************************************************************/ -SwClient *SwModify::_Remove(SwClient * pDepend) +SwClient* SwModify::Remove(SwClient * pDepend) { - // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ... - ASSERT( !bInModify || 0 != dynamic_cast(pDepend), "Client innerhalb des eigenen Modifies loeschen?" ); + if ( bInDocDTOR ) + return 0; + + ASSERT( !bLockClientList || pDepend->mbIsAllowedToBeRemovedInModifyCall, "SwClient shall be removed in Modify call!" ); - // loesche das Object aus der Liste und setze den - // Registrierungs-Pointer zurueck if( pDepend->pRegisteredIn == this ) { + // SwClient is my listener + // remove it from my list SwClient* pR = pDepend->pRight; SwClient* pL = pDepend->pLeft; if( pRoot == pDepend ) @@ -346,40 +295,45 @@ SwClient *SwModify::_Remove(SwClient * pDepend) if( pR ) pR->pLeft = pL; - // alle Client-Iters updaten + // update ClientIters SwClientIter* pTmp = pClientIters; while( pTmp ) { - if( pTmp->pAkt == pDepend || pTmp->pDelNext == pDepend ) + if( pTmp->pAct == pDepend || pTmp->pDelNext == pDepend ) + // if object being removed is the current or next object in an iterator, advance this iterator pTmp->pDelNext = pR; - - // --> FME 2006-02-03 #127369# Notify SwClientIter if mpWatchClient is removed - if ( pTmp->mpWatchClient == pDepend ) - pTmp->mpWatchClient = 0; - // <-- - pTmp = pTmp->pNxtIter; } pDepend->pLeft = 0; pDepend->pRight = 0; } - else { - ASSERT( FALSE, "SwModify::Remove(): pDepend nicht gefunden"); + else + { + ASSERT( false, "SwModify::Remove(): pDepend nicht gefunden" ); } + + // disconnect client from me pDepend->pRegisteredIn = 0; return pDepend; } +#ifdef DBG_UTIL +int SwModify::GetClientCount() const +{ + int nRet=0; + SwClientIter aIter( *this ); + SwClient *pLast = aIter.GoStart(); + if( pLast ) + do + { + ++nRet; + } while( 0 != ( pLast = aIter++ )); + return nRet; +} +#endif -/************************************************************************* -|* SwModify::CheckCaching( const USHORT nWhich ) -|* -|* Ersterstellung JP 25.06.95 -|* Letzte Aenderung JP 25.06.95 -*************************************************************************/ - - +/*************************************************************************/ void SwModify::CheckCaching( const USHORT nWhich ) { @@ -411,19 +365,33 @@ void SwModify::CheckCaching( const USHORT nWhich ) } } +void SwModify::CallSwClientNotify( USHORT nWhich ) +{ + SwClientIter aIter(*this); + SwClient * pClient = aIter.GoStart(); + while (pClient) + { + pClient->SwClientNotify( this, nWhich ); + pClient = aIter++; + } +} + +void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType ) +{ + SwClientIter aIter(*this); + SwClient * pClient = aIter.First( nType ); + while (pClient) + { + pClient->Modify( pOldValue, pNewValue ); + pClient = aIter.Next(); + } +} // ---------- // SwDepend // ---------- -/************************************************************************* -|* SwDepend::SwDepend(SwClient *pTellHim,SwModify *pDepend) -|* -|* Beschreibung callback.doc V1.14 -|* Ersterstellung VB 20.03.91 -|* Letzte Aenderung VB 20.03.91 -*************************************************************************/ - +/*************************************************************************/ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend) : SwClient(pDepend) @@ -431,27 +399,17 @@ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend) pToTell = pTellHim; } -/************************************************************************* -|* -|* SwDepend::Modify(SwHint *, SwHint *) -|* -|* Beschreibung callback.doc V1.14 -|* Ersterstellung VB 20.03.91 -|* Letzte Aenderung VB 20.03.91 -|* -*************************************************************************/ - +/*************************************************************************/ -void SwDepend::Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue ) +void SwDepend::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem *pNewValue ) { if(pNewValue && pNewValue->Which() == RES_OBJECTDYING) - SwClient::Modify(pOldValue,pNewValue); + CheckRegistration(pOldValue,pNewValue); else if(pToTell) - pToTell->Modify(pOldValue, pNewValue); + pToTell->ModifyNotification(pOldValue, pNewValue); } - // erfrage vom Modify Informationen BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const { return pToTell ? pToTell->GetInfo( rInfo ) : TRUE; @@ -459,14 +417,13 @@ BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const /********************************************************************/ - -SwClientIter::SwClientIter( SwModify const& rModify ) +SwClientIter::SwClientIter( const SwModify& rModify ) : rRoot( rModify ) { - // hinten einketten! pNxtIter = 0; if( pClientIters ) { + // append to list of ClientIters SwClientIter* pTmp = pClientIters; while( pTmp->pNxtIter ) pTmp = pTmp->pNxtIter; @@ -475,9 +432,8 @@ SwClientIter::SwClientIter( SwModify const& rModify ) else pClientIters = this; - pAkt = rRoot.pRoot; - pDelNext = pAkt; - mpWatchClient = 0; + pAct = const_cast(rRoot.GetDepends()); + pDelNext = pAct; } @@ -486,6 +442,7 @@ SwClientIter::~SwClientIter() { if( pClientIters ) { + // reorganize list of ClientIters if( pClientIters == this ) pClientIters = pNxtIter; else @@ -503,132 +460,109 @@ SwClientIter::~SwClientIter() } -#ifndef CFRONT - // Postfix Operator SwClient* SwClientIter::operator++(int) { -// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer -// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der -// Code entsprechen umgestellt werden !!! - if( pDelNext == pAkt ) + if( pDelNext == pAct ) { - pAkt = pAkt->pRight; - pDelNext = pAkt; + pAct = pAct->pRight; + pDelNext = pAct; } else - pAkt = pDelNext; - return pAkt; + pAct = pDelNext; + return pAct; } -#endif - - // Prefix Operator -SwClient* SwClientIter::operator++() +SwClient* SwClientIter::GoStart() { - if( pDelNext == pAkt ) - { - pAkt = pAkt->pRight; - pDelNext = pAkt; - } - else - pAkt = pDelNext; - return pAkt; + pAct = const_cast(rRoot.GetDepends()); + if( pAct ) + while( pAct->pLeft ) + pAct = pAct->pLeft; + pDelNext = pAct; + return pAct; } - -#ifndef CFRONT - // Postfix Operator -SwClient* SwClientIter::operator--(int) +SwClient* SwClientIter::GoEnd() { -// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer -// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der -// Code entsprechen umgestellt werden !!! - if( pDelNext == pAkt ) - pAkt = pAkt->pLeft; - else - pAkt = pDelNext->pLeft; - pDelNext = pAkt; - return pAkt; + pAct = pDelNext; + if( !pAct ) + pAct = const_cast(rRoot.GetDepends()); + if( pAct ) + while( pAct->pRight ) + pAct = pAct->pRight; + pDelNext = pAct; + return pAct; } -#endif - - - // Prefix Operator -SwClient* SwClientIter::operator--() -{ - if( pDelNext == pAkt ) - pAkt = pAkt->pLeft; - else - pAkt = pDelNext->pLeft; - pDelNext = pAkt; - return pAkt; -} - - -SwClient* SwClientIter::GoStart() // zum Anfang des Baums -{ - pAkt = rRoot.pRoot; - if( pAkt ) - while( pAkt->pLeft ) - pAkt = pAkt->pLeft; - pDelNext = pAkt; - return pAkt; -} - - -SwClient* SwClientIter::GoEnd() // zum End des Baums -{ - pAkt = pDelNext; - if( !pAkt ) - pAkt = rRoot.pRoot; - if( pAkt ) - while( pAkt->pRight ) - pAkt = pAkt->pRight; - pDelNext = pAkt; - return pAkt; -} - - SwClient* SwClientIter::First( TypeId nType ) { aSrchId = nType; GoStart(); - if( pAkt ) + if( pAct ) do { - if( pAkt->IsA( aSrchId ) ) + if( pAct->IsA( aSrchId ) ) break; - if( pDelNext == pAkt ) + if( pDelNext == pAct ) { - pAkt = pAkt->pRight; - pDelNext = pAkt; + pAct = pAct->pRight; + pDelNext = pAct; } else - pAkt = pDelNext; + pAct = pDelNext; - } while( pAkt ); - return pAkt; + } while( pAct ); + return pAct; } - SwClient* SwClientIter::Next() { do { - // erstmal zum naechsten - if( pDelNext == pAkt ) + if( pDelNext == pAct ) { - pAkt = pAkt->pRight; - pDelNext = pAkt; + pAct = pAct->pRight; + pDelNext = pAct; } else - pAkt = pDelNext; + pAct = pDelNext; - if( pAkt && pAkt->IsA( aSrchId ) ) + if( pAct && pAct->IsA( aSrchId ) ) break; - } while( pAkt ); - return pAkt; + } while( pAct ); + return pAct; +} + +SwClient* SwClientIter::Last( TypeId nType ) +{ + aSrchId = nType; + GoEnd(); + if( pAct ) + do { + if( pAct->IsA( aSrchId ) ) + break; + + if( pDelNext == pAct ) + pAct = pAct->pLeft; + else + pAct = pDelNext->pLeft; + pDelNext = pAct; + + } while( pAct ); + return pAct; } +SwClient* SwClientIter::Previous() +{ + do { + if( pDelNext == pAct ) + pAct = pAct->pLeft; + else + pAct = pDelNext->pLeft; + pDelNext = pAct; + if( pAct && pAct->IsA( aSrchId ) ) + break; + } while( pAct ); + return pAct; +} diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index f492696ef8ac..17a7461fbc1e 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -29,9 +29,7 @@ #include "precompiled_sw.hxx" #include - #include - #include // fuer RES_.. #include #include @@ -41,7 +39,7 @@ #include #include #include - +#include //TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt @@ -112,9 +110,9 @@ const SwNode* SwTblBoxFormula::GetNodeOfFormula() const const SwNode* pRet = 0; if( pDefinedIn ) { - SwClient* pBox = SwClientIter( *pDefinedIn ).First( TYPE( SwTableBox )); + SwTableBox* pBox = SwIterator::FirstElement( *pDefinedIn ); if( pBox ) - pRet = ((SwTableBox*)pBox)->GetSttNd(); + pRet = pBox->GetSttNd(); } return pRet; } @@ -124,8 +122,7 @@ SwTableBox* SwTblBoxFormula::GetTableBox() { SwTableBox* pBox = 0; if( pDefinedIn ) - pBox = (SwTableBox*)SwClientIter( *pDefinedIn ). - First( TYPE( SwTableBox )); + pBox = SwIterator::FirstElement( *pDefinedIn ); return pBox; } diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 6a296782ce6c..51d8e842365e 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -36,9 +36,7 @@ #include #include // fuer SwParaFmt - SwHyphenBug #include -// --> OD 2006-11-22 #i71574# #include -// <-- TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt @@ -142,16 +140,16 @@ SwFmt &SwFmt::operator=(const SwFmt& rFmt) { SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } - if( pRegisteredIn != rFmt.pRegisteredIn ) + if( GetRegisteredIn() != rFmt.GetRegisteredIn() ) { - if( pRegisteredIn ) - pRegisteredIn->Remove(this); - if(rFmt.pRegisteredIn) + if( GetRegisteredIn() ) + GetRegisteredInNonConst()->Remove(this); + if(rFmt.GetRegisteredIn()) { - rFmt.pRegisteredIn->Add(this); + const_cast(rFmt).GetRegisteredInNonConst()->Add(this); aSet.SetParent( &rFmt.aSet ); } else @@ -170,7 +168,7 @@ void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast ) SwStringMsgPoolItem aOld( RES_NAME_CHANGED, aFmtName ); SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName ); aFmtName = rNewName; - Modify( &aOld, &aNew ); + ModifyNotification( &aOld, &aNew ); } else { @@ -229,7 +227,7 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, BOOL bReplace ) SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } @@ -269,7 +267,7 @@ SwFmt::~SwFmt() SwFmtChg aNewFmt(pParentFmt); SwClient * pDepend = (SwClient*)GetDepends(); pParentFmt->Add(pDepend); - pDepend->Modify(&aOldFmt, &aNewFmt); + pDepend->ModifyNotification(&aOldFmt, &aNewFmt); } } } @@ -277,7 +275,7 @@ SwFmt::~SwFmt() /************************************************************************* -|* void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) +|* void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) |* |* Beschreibung Dokument 1.14 |* Ersterstellung JP 22.11.90 @@ -285,7 +283,7 @@ SwFmt::~SwFmt() *************************************************************************/ -void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) +void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { BOOL bWeiter = TRUE; // TRUE = Propagierung an die Abhaengigen @@ -302,9 +300,9 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject; // nicht umhaengen wenn dieses das oberste Format ist !! - if( pRegisteredIn && pRegisteredIn == pFmt ) + if( GetRegisteredIn() && GetRegisteredIn() == pFmt ) { - if( pFmt->pRegisteredIn ) + if( pFmt->GetRegisteredIn() ) { // wenn Parent, dann im neuen Parent wieder anmelden pFmt->DerivedFrom()->Add( this ); @@ -332,7 +330,7 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) if( aNew.Count() ) // keine mehr gesetzt, dann Ende !! - SwModify::Modify( &aOld, &aNew ); + NotifyClients( &aOld, &aNew ); bWeiter = FALSE; } break; @@ -353,12 +351,12 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) { // IsWritten-Flag zuruecksetzen. Hint nur an abhanegige // Formate (und keine Frames) propagieren. + // mba: the code does the opposite from what is written in the comment! ResetWritten(); - SwClientIter aIter( *this ); - for( SwClient *pClient = aIter.First( TYPE(SwFmt) ); pClient; - pClient = aIter.Next() ) - pClient->Modify( pOldValue, pNewValue ); - + // mba: here we don't use the additional stuff from NotifyClients(). + // should we?! + // mba: move the code that ignores this event to the clients + ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) ); bWeiter = FALSE; } break; @@ -383,7 +381,7 @@ ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" ); if( bWeiter ) { // laufe durch alle abhaengigen Formate - SwModify::Modify( pOldValue, pNewValue ); + NotifyClients( pOldValue, pNewValue ); } } @@ -431,7 +429,7 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom) SwFmtChg aOldFmt(this); SwFmtChg aNewFmt(this); - Modify( &aOldFmt, &aNewFmt ); + ModifyNotification( &aOldFmt, &aNewFmt ); return TRUE; } @@ -476,7 +474,7 @@ BOOL SwFmt::SetFmtAttr(const SfxPoolItem& rAttr ) SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } return bRet; @@ -524,7 +522,7 @@ BOOL SwFmt::SetFmtAttr( const SfxItemSet& rSet ) aSet.SetModifyAtAttr( this ); SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } return bRet; @@ -561,7 +559,7 @@ BOOL SwFmt::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 ) { SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } return bRet; } @@ -595,7 +593,7 @@ USHORT SwFmt::ResetAllFmtAttr() { SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } return aNew.Count(); } @@ -644,7 +642,7 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet ) { SwAttrSetChg aChgOld( aSet, aOld ); SwAttrSetChg aChgNew( aSet, aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 11060352b6c3..4a773c6980c4 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -164,9 +164,9 @@ namespace sw { namespace mark } - void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) + void MarkBase::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew ) { - SwModify::Modify(pOld, pNew); + NotifyClients(pOld, pNew); if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) { // invalidate cached uno object SetXBookmark(uno::Reference(0)); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 33c9a9fb71c4..4a92f73a9ed8 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2147,7 +2147,7 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const // Link weitergeleitet. -void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { const USHORT nWhich = pOld ? pOld->Which() : @@ -2673,7 +2673,7 @@ SwCrsrShell::~SwCrsrShell() // der CursorShell haengt keine Chance geben, sich an den // TextNode zu haengen. if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); } SwShellCrsr* SwCrsrShell::getShellCrsr( bool bBlock ) diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index b713d1e2b626..d281da0c67e1 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -71,7 +71,7 @@ #include #include "txtfrm.hxx" #include - +#include #include #include // OD 2008-06-19 #i90516# @@ -411,14 +411,13 @@ BOOL SwCrsrShell::GotoTOXMarkBase() // dann nehme den 1. und hole den Verzeichnis-Typ. // Suche in seiner Abhaengigkeitsliste nach dem eigentlichem // Verzeichnis - SwModify* pType = (SwModify*)aMarks[0]->GetRegisteredIn(); - SwClientIter aIter( *pType ); + const SwTOXType* pType = aMarks[0]->GetTOXType(); + SwIterator aIter( *pType ); const SwSectionNode* pSectNd; const SwSectionFmt* pSectFmt; - for( SwTOXBase* pTOX = - (SwTOXBase*)aIter.First( TYPE( SwTOXBase )); - pTOX; pTOX = (SwTOXBase*)aIter.Next() ) + for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() ) + { if( pTOX->ISA( SwTOXBaseSection ) && 0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) && 0 != ( pSectNd = pSectFmt->GetSectionNode() )) @@ -445,6 +444,7 @@ BOOL SwCrsrShell::GotoTOXMarkBase() } } } + } return bRet; } @@ -630,13 +630,13 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, // es muss immer der 1. Frame gesucht werden Point aPt; SwTxtFld* pTxtFld; - SwClientIter aIter( (SwFieldType&)rFldType ); + SwIterator aIter(rFldType); BOOL bSubType = nSubType != USHRT_MAX; - for( SwClient* pLast = aIter.First( TYPE( SwFmtFld )); pLast; pLast = aIter.Next() ) - if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) && ( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld()) ->GetInputFlag() ) && - (!bSubType || (((SwFmtFld*)pLast)->GetFld()->GetSubType() + (!bSubType || (pFmtFld->GetFld()->GetSubType() & 0xff ) == nSubType )) { SwCntntFrm* pCFrm; @@ -1612,20 +1612,16 @@ bool SwContentAtPos::IsInRTLText()const } if(pNd) { - SwClientIter aClientIter( * const_cast(pNd) ); - SwClient* pLast = aClientIter.GoStart(); - while( pLast ) + SwIterator aIter(*pNd); + SwTxtFrm* pTmpFrm = aIter.First(); + while( pTmpFrm ) { - if ( pLast->ISA( SwTxtFrm ) ) - { - SwTxtFrm* pTmpFrm = static_cast( pLast ); if ( !pTmpFrm->IsFollow()) { bRet = pTmpFrm->IsRightToLeft(); break; } - } - pLast = ++aClientIter; + pTmpFrm = aIter.Next(); } } return bRet; @@ -2110,14 +2106,13 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) const SwCharFmts* pFmts = GetDoc()->GetCharFmts(); for( USHORT n = pFmts->Count(); 1 < n; ) { - SwClientIter aIter( *(*pFmts)[ --n ] ); + SwIterator aIter(*(*pFmts)[--n]); - for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt )); - pFnd; pFnd = aIter.Next() ) - if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) && + for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) + if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) && pTxtNd->GetNodes().IsDocNodes() ) { - SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd; + SwTxtINetFmt& rAttr = *pFnd; SwPosition aTmpPos( *pTxtNd ); _SetGetExpFld aPos( aTmpPos.nNode, rAttr ); SwCntntFrm* pFrm; diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index a79203c13ece..238982aac785 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1236,7 +1236,7 @@ void SwPaM::InvalidatePaM() SwInsTxt aHint( Start()->nContent.GetIndex(), End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 ); SwModify *_pModify=(SwModify*)_pTxtNd; - _pModify->Modify( 0, &aHint); + _pModify->ModifyNotification( 0, &aHint); } } diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 5431de73cd6a..53bbd9cfbd84 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -66,11 +66,12 @@ public: SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient); - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); const SwDoc& GetDoc(){return *pDoc;} #ifdef DBG_UTIL static ULONG GetElementCount() {return nSwAutoCompleteClientCount;} #endif +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; /* -----------------------------05.08.2002 12:48------------------------------ @@ -156,15 +157,15 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient pAutoCompleteWord = rClient.pAutoCompleteWord; pDoc = rClient.pDoc; if(rClient.GetRegisteredIn()) - rClient.pRegisteredIn->Add(this); + ((SwModify*)rClient.GetRegisteredIn())->Add(this); else if(GetRegisteredIn()) - pRegisteredIn->Remove(this); + GetRegisteredInNonConst()->Remove(this); return *this; } /* -----------------------------05.08.2002 12:49------------------------------ ---------------------------------------------------------------------------*/ -void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *) +void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *) { switch( pOld ? pOld->Which() : 0 ) { diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index d866a41a3016..c7aabee9c99f 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -124,6 +124,8 @@ #include #endif +#include "switerator.hxx" + /* @@@MAINTAINABILITY-HORROR@@@ Probably unwanted dependency on SwDocShell */ @@ -1087,9 +1089,8 @@ USHORT _PostItFld::GetPageNo( //Bereichs ermittelt werden. rVirtPgNo = 0; USHORT nPos = GetCntnt(); - SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() ); - for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm )); - pFrm; pFrm = (SwTxtFrm*)aIter.Next() ) + SwIterator aIter( GetFld()->GetTxtNode() ); + for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { if( pFrm->GetOfst() > nPos || (pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) ) @@ -1119,13 +1120,11 @@ bool lcl_GetPostIts( if( pFldType->GetDepends() ) { // Modify-Object gefunden, trage alle Felder ins Array ein - SwClientIter aIter( *pFldType ); - SwClient* pLast; + SwIterator aIter( *pFldType ); const SwTxtFld* pTxtFld; - - for( pLast = aIter.First( TYPE(SwFmtFld)); pLast; pLast = aIter.Next() ) + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { - if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && + if( 0 != ( pTxtFld = pFld->GetTxtFld() ) && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() ) { bHasPostIts = true; @@ -1736,10 +1735,8 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) // #i93174#: notes contain paragraphs that are not nodes { SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) ); - SwClientIter aIter(*pPostits); - SwFmtFld const * pFmtFld = - static_cast(aIter.First( TYPE(SwFmtFld) )); - while (pFmtFld) + SwIterator aIter( *pPostits ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { if (pFmtFld->IsFldInDoc()) { @@ -1747,7 +1744,6 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) static_cast(pFmtFld->GetFld())); rStat.nAllPara += pField->GetNumberOfParagraphs(); } - pFmtFld = static_cast(aIter.Next()); } } @@ -2192,9 +2188,8 @@ BOOL SwDoc::RemoveInvisibleContent() { SwTxtNode* pTxtNd; - SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) ); - for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); - pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *GetSysFldType( RES_HIDDENPARAFLD ) ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { if( pFmtFld->GetTxtFld() && 0 != ( pTxtNd = (SwTxtNode*)pFmtFld->GetTxtFld()->GetpTxtNode() ) && @@ -2374,14 +2369,11 @@ BOOL SwDoc::ConvertFieldsToText() if ( RES_POSTITFLD == pCurType->Which() ) continue; - SwClientIter aIter( *(SwFieldType*)pCurType ); - const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *pCurType ); ::std::vector aFieldFmts; - while (pCurFldFmt) - { + for( SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next() ) aFieldFmts.push_back(pCurFldFmt); - pCurFldFmt = (SwFmtFld*)aIter.Next(); - } + ::std::vector::iterator aBegin = aFieldFmts.begin(); ::std::vector::iterator aEnd = aFieldFmts.end(); while(aBegin != aEnd) @@ -2671,21 +2663,8 @@ void SwDoc::ChkCondColls() for (USHORT n = 0; n < pTxtFmtCollTbl->Count(); n++) { SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n]; - if (RES_CONDTXTFMTCOLL == pColl->Which()) - { - SwClientIter aIter(*pColl); - - SwClient * pClient = aIter.First(TYPE(SwTxtNode)); - while (pClient) - { - SwTxtNode * pTxtNode = static_cast(pClient); - - pTxtNode->ChkCondColl(); - - pClient = aIter.Next(); - } - } + pColl->CallSwClientNotify( RES_CONDTXTFMTCOLL ); } } diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index ca3ab77a2d5c..fa29cd583efc 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1490,7 +1490,7 @@ void _RestoreCntntIdx(SwDoc* pDoc, { SwFrmFmt *pFrmFmt = (*pSpz)[ aSave.GetCount() ]; SfxPoolItem *pAnchor = (SfxPoolItem*)&pFrmFmt->GetAnchor(); - pFrmFmt->SwModify::Modify( pAnchor, pAnchor ); + pFrmFmt->NotifyClients( pAnchor, pAnchor ); } break; diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 2cef07f9b487..0477eff2b0ed 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -257,7 +257,7 @@ void PaMCorrAbs( const SwNodeIndex &rStartNode, { // the UNO cursor has left its section. We need to notify it! SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION ); - pUnoCursor->Modify( &aHint, NULL ); + pUnoCursor->ModifyNotification( &aHint, NULL ); } } } diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 1f05a93f1abd..ab7cebda7304 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -55,9 +55,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -69,10 +67,8 @@ #include #include #include -#ifndef _STATSTR_HRC #include -#endif - +#include #include #include @@ -416,16 +412,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) pDesc->SetFtnInfo( rChged.GetFtnInfo() ); SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO ); { - SwClientIter aIter( pDesc->GetMaster() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) - pLast->Modify( &aInfo, 0 ); + pDesc->GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); } { - SwClientIter aIter( pDesc->GetLeft() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) - pLast->Modify( &aInfo, 0 ); + pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); } } SetModified(); @@ -459,9 +449,9 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) return; SwFmtPageDesc aDfltDesc( aPageDescs[0] ); - SwClientIter aIter( *pDel ); + SwClientIter aIter( *pDel ); // TODO SwClient* pLast; - while( 0 != ( pLast = aIter.GoRoot() )) + while( 0 != ( pLast = aIter.GoStart() )) { if( pLast->ISA( SwFmtPageDesc ) ) { @@ -475,18 +465,22 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) else { ASSERT( !this, "was ist das fuer ein Mofify-Obj?" ); - aPageDescs[0]->Add( pLast ); + ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] ); } } else //Es kann noch eine Undo-Kopie existieren - aPageDescs[0]->Add( pLast ); + ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] ); } + // mba: this code prevents us from using an SwIterator as GetPageDescDep() returns an SwClient that is an SwDepend BOOL bFtnInf = FALSE; if ( TRUE == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) || pLast == pEndNoteInfo->GetPageDescDep() ) { - aPageDescs[0]->Add( pLast ); + if ( bFtnInf ) + pFtnInfo->ChgPageDesc( aPageDescs[0] ); + else + pEndNoteInfo->ChgPageDesc( aPageDescs[0] ); if ( pTmpRoot ) { std::set aAllLayouts = GetAllLayouts(); @@ -746,23 +740,7 @@ void SwDoc::PrtOLENotify( BOOL bAll ) mbOLEPrtNotifyPending = mbAllOLENotify = FALSE; - - SwOLENodes *pNodes = 0; - SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; - pNd = (SwCntntNode*)aIter.Next() ) - { - SwOLENode *pONd; - if ( 0 != (pONd = pNd->GetOLENode()) && - (bAll || pONd->IsOLESizeInvalid()) ) - { - if ( !pNodes ) - pNodes = new SwOLENodes; - pNodes->Insert( pONd, pNodes->Count() ); - } - } - + SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), !bAll ); if ( pNodes ) { ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY, @@ -836,31 +814,19 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) { mbOLEPrtNotifyPending = mbAllOLENotify = FALSE; - SwOLENodes aOLENodes; - SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; - pNd = (SwCntntNode*)aIter.Next() ) - { - SwOLENode *pONd = pNd->GetOLENode(); - if( pONd && pONd->IsOLESizeInvalid() ) - { - aOLENodes.Insert( pONd, aOLENodes.Count() ); - } - } - - if( aOLENodes.Count() ) + SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), true ); + if( pNodes ) { ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY, - 0, aOLENodes.Count(), GetDocShell()); + 0, pNodes->Count(), GetDocShell()); GetCurrentLayout()->StartAllAction(); //swmod 080218 SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR ); - for( USHORT i = 0; i < aOLENodes.Count(); ++i ) + for( USHORT i = 0; i < pNodes->Count(); ++i ) { ::SetProgressState( i, GetDocShell() ); - SwOLENode* pOLENd = aOLENodes[i]; + SwOLENode* pOLENd = (*pNodes)[i]; pOLENd->SetOLESizeInvalid( FALSE ); //Kennen wir nicht, also muss das Objekt geladen werden. @@ -881,11 +847,12 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) pOLENd->SetOLESizeInvalid( TRUE ); }*/ // repaint it - pOLENd->Modify( &aMsgHint, &aMsgHint ); + pOLENd->ModifyNotification( &aMsgHint, &aMsgHint ); } } GetCurrentLayout()->EndAllAction(); //swmod 080218 ::EndProgress( GetDocShell() ); + delete pNodes; } } return 0; diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 312115566374..6c09d1c4fcf5 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -63,21 +63,15 @@ #include #include #include - -// OD 26.06.2003 #108784# #include -// OD 2004-04-01 #i26791# #include #include #include #include #include -// --> OD 2006-03-14 #i62875# #include -// <-- -// --> OD 2006-11-01 #130889# #include -// <-- +#include using namespace ::com::sun::star; using namespace ::com::sun::star::linguistic2; @@ -544,28 +538,29 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn, // #i11176# // This also needs to work when no layout exists. Thus, for // FlyFrames an alternative method is used now in that case. - SwClientIter aIter( (SwFmt&)*pFmt ); - if( RES_FLYFRMFMT == pFmt->Which() ) { if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225 { // Schauen, ob es ein SdrObject dafuer gibt - if( aIter.First( TYPE( SwFlyFrm) ) ) - nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(); + SwFlyFrm* pFly = SwIterator::FirstElement( *pFrmFmt ); + if( pFly ) + nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum(); } else { // Schauen, ob es ein SdrObject dafuer gibt - if( aIter.First( TYPE(SwFlyDrawContact) ) ) - nOrdNum = ((SwFlyDrawContact*)aIter())->GetMaster()->GetOrdNum(); + SwFlyDrawContact* pContact = SwIterator::FirstElement( *pFrmFmt ); + if( pContact ) + nOrdNum = pContact->GetMaster()->GetOrdNum(); } } else if( RES_DRAWFRMFMT == pFmt->Which() ) { // Schauen, ob es ein SdrObject dafuer gibt - if( aIter.First( TYPE(SwDrawContact) ) ) - nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(); + SwDrawContact* pContact = SwIterator::FirstElement( *pFrmFmt ); + if( pContact ) + nOrdNum = pContact->GetMaster()->GetOrdNum(); } else { ASSERT( !this, "was ist das fuer ein Format?" ); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 67bcd0d9d3cf..30ad4316b13e 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -832,13 +832,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) if( nOldAttrCnt != nNewAttrCnt ) { SwUpdateAttr aHint( 0, 0, 0 ); - SwClientIter aIter( *pNode ); - SwClient* pGTO = aIter.First(TYPE( SwCrsrShell )); - while( pGTO ) - { - pGTO->Modify( 0, &aHint ); - pGTO = aIter.Next(); - } + pNode->ModifyBroadcast( 0, &aHint, TYPE( SwCrsrShell ) ); } if( !DoesUndo() && !IsIgnoreRedline() && GetRedlineTbl().Count() ) diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index a738c6bd0576..852df26cba93 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -74,6 +74,7 @@ #endif #include +#include "switerator.hxx" using namespace ::com::sun::star::uno; @@ -361,10 +362,10 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB ) if( !pNewHt ) { SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL ); - (*pFldTypes)[i]->Modify( 0, &aUpdateDDE ); + (*pFldTypes)[i]->ModifyNotification( 0, &aUpdateDDE ); } else - (*pFldTypes)[i]->Modify( 0, pNewHt ); + (*pFldTypes)[i]->ModifyNotification( 0, pNewHt ); break; } case RES_GETEXPFLD: @@ -375,7 +376,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB ) if( !pNewHt ) break; default: - (*pFldTypes)[i]->Modify( 0, pNewHt ); + (*pFldTypes)[i]->ModifyNotification ( 0, pNewHt ); } } @@ -427,7 +428,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt ) SwFieldType* pFldType; for( USHORT i = 0; i < pFldTypes->Count(); ++i ) if( RES_GETREFFLD == ( pFldType = (*pFldTypes)[i] )->Which() ) - pFldType->Modify( 0, pHt ); + pFldType->ModifyNotification( 0, pHt ); } void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) @@ -446,9 +447,9 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( pHt && RES_TABLEFML_UPDATE == pHt->Which() ) pUpdtFld = (SwTableFmlUpdate*)pHt; - SwClientIter aIter( *pFldType ); - for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); - pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + { if( pFmtFld->GetTxtFld() ) { SwTblField* pFld = (SwTblField*)pFmtFld->GetFld(); @@ -499,6 +500,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) // setze bei allen das Value-Flag zurueck pFld->ChgValid( FALSE ); } + } break; } @@ -525,16 +527,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( pFldType ) { - SwClient* pLast; - SwClientIter aIter( *pFldType ); - // dann rechne mal schoen - // JP 27.03.97: Beim Berechnen am Ende anfangen - weil neue - // Felder immer am Anfang der Modifykette eingefuegt - // werden. Beim Import haben wir damit eine bessere/ - // schnellere Berechnung bei "Kettenformeln" - if( 0 != ( pLast = aIter.GoEnd() )) - do { - SwFmtFld* pFmtFld = (SwFmtFld*)pLast; + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFmtFld = aIter.Last(); pFmtFld; pFmtFld = aIter.Previous() ) + { + // start calculation at the end + // new fields are inserted at the beginning of the modify chain + // that gives faster calculation on import + // mba: do we really need this "optimization"? Is it still valid? SwTblField* pFld; if( !pFmtFld->GetTxtFld() || (nsSwExtendedSubType::SUB_CMD & (pFld = (SwTblField*)pFmtFld->GetFld())->GetSubType() )) @@ -603,8 +602,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } pCalc->SetCalcError( CALC_NOERR ); } - pFmtFld->Modify( 0, pHt ); - } while( 0 != ( pLast = aIter-- )); + pFmtFld->ModifyNotification( 0, pHt ); + } } // dann berechene noch die Formeln an den Boxen @@ -700,10 +699,10 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt ) case RES_CHAPTERFLD: case RES_GETEXPFLD: case RES_REFPAGEGETFLD: - pFldType->Modify( 0, pMsgHnt ); + pFldType->ModifyNotification( 0, pMsgHnt ); break; case RES_DOCSTATFLD: - pFldType->Modify( 0, 0 ); + pFldType->ModifyNotification( 0, 0 ); break; } SetNewFldLst(true); @@ -1542,7 +1541,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) } } // switch - pFmtFld->Modify( 0, 0 ); // Formatierung anstossen + pFmtFld->ModifyNotification( 0, 0 ); // Formatierung anstossen if( pUpdtFld == pTxtFld ) // sollte nur dieses geupdatet werden { @@ -1685,9 +1684,8 @@ const SwDBData& SwDoc::GetDBDesc() case RES_DBNUMSETFLD: case RES_DBSETNUMBERFLD: { - SwClientIter aIter( rFldType ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); - while(pFld) + SwIterator aIter( rFldType ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { if(pFld->IsFldInDoc()) { @@ -1699,7 +1697,6 @@ const SwDBData& SwDoc::GetDBDesc() aDBData = (static_cast < SwDBNameInfField* > (pFld->GetFld()))->GetRealDBData(); break; } - pFld = (SwFmtFld*)aIter.Next(); } } break; @@ -1957,7 +1954,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames, SwDBFieldType* pTyp = (SwDBFieldType*)InsertFldType( SwDBFieldType(this, pOldTyp->GetColumnName(), aNewDBData)); - pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen + pFmtFld->RegisterToFieldType( *pTyp ); pFld->ChgTyp(pTyp); ((SwDBField*)pFld)->ClearInitialized(); @@ -2102,10 +2099,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) for( ; nStt < 5; ++nStt ) { SwFieldType* pFldType = GetSysFldType( aTypes[ nStt ] ); - SwClientIter aDocInfIter( *pFldType ); - - for( SwFmtFld* pFld = (SwFmtFld*)aDocInfIter.First( TYPE( SwFmtFld )); - pFld; pFld = (SwFmtFld*)aDocInfIter.Next() ) + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { if( pFld && pFld->GetTxtFld() ) { @@ -2173,7 +2168,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) // Formatierung anstossen if( bChgd ) - pFld->Modify( 0, 0 ); + pFld->ModifyNotification( 0, 0 ); } } } @@ -2436,7 +2431,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) pFormel = 0; // Formatierung anstossen - ((SwFmtFld*)pFmtFld)->Modify( 0, 0 ); + ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 ); } break; @@ -2456,7 +2451,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) // Feld Evaluieren ((SwHiddenTxtField*)pFld)->Evaluate(&rDoc); // Formatierung anstossen - ((SwFmtFld*)pFmtFld)->Modify( 0, 0 ); + ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 ); } break; @@ -2757,7 +2752,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, if (bUpdateFlds) UpdateTblFlds( &aTblUpdate ); else - pNewFld->GetTyp()->Modify(0, &aTblUpdate); + pNewFld->GetTyp()->ModifyNotification(0, &aTblUpdate); if (! bUpdateFlds) bTblSelBreak = TRUE; @@ -2768,7 +2763,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, case RES_MACROFLD: if( bUpdateFlds && pDstTxtFld->GetpTxtNode() ) (pDstTxtFld->GetpTxtNode())-> - Modify( 0, pDstFmtFld ); + ModifyNotification( 0, pDstFmtFld ); break; case RES_DBNAMEFLD: @@ -2795,7 +2790,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, // kein break; default: - pDstFmtFld->Modify( 0, pMsgHnt ); + pDstFmtFld->ModifyNotification( 0, pMsgHnt ); } // Die Felder die wir berechnen koennen werden hier expli. diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 307de496314e..14d7c8ef02e3 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -64,19 +64,14 @@ #include #include #include - -// --> OD 2009-07-20 #i73249# #include -// <-- +#include extern USHORT GetHtmlMode( const SwDocShell* ); using namespace ::com::sun::star; -/*-----------------17.02.98 08:35------------------- - ---------------------------------------------------*/ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const { const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts(); @@ -118,9 +113,6 @@ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const return nCount; } -/*-----------------17.02.98 08:35------------------- - ---------------------------------------------------*/ // If you change this, also update SwXFrameEnumeration in unocoll. SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType ) { @@ -161,16 +153,6 @@ SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType ) return pRetFmt; } -/* */ - -/*********************************************************************** -#* Class : SwDoc -#* Methode : SetFlyFrmAnchor -#* Beschreibung: Das Ankerattribut des FlyFrms aendert sich. -#* Datum : MA 01. Feb. 94 -#* Update : JP 09.03.98 -#***********************************************************************/ - Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, const SwFrmFmt* pFlyFmt ) { @@ -527,13 +509,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, } // <-- -/*************************************************************************** - * Methode : BOOL SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& ) - * Beschreibung: - * Erstellt : OK 14.04.94 15:40 - * Aenderung : JP 23.04.98 - ***************************************************************************/ - BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, SfxItemSet* pSet, BOOL bKeepOrient ) { @@ -617,7 +592,7 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, rFmt.MakeFrms(); if( pUndo ) - rFmt.Remove( pUndo ); + pUndo->DeRegisterFromFormat( rFmt ); SetModified(); @@ -638,15 +613,6 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName, pGrfNd->GetFileFilterNms( pGrfName, pFltName ); } -/************************************************************************* -|* -|* SwDoc::ChgAnchor() -|* -|* Ersterstellung MA 10. Jan. 95 -|* Letzte Aenderung JP 08.07.98 -|* -*************************************************************************/ - sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, RndStdIds _eAnchorType, const sal_Bool _bSameOnly, @@ -898,9 +864,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, } -/* -----------------23.07.98 13:56------------------- - * - * --------------------------------------------------*/ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) { //Die Source darf noch keinen Follow haben. @@ -999,9 +962,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA; } -/* -----------------23.07.98 13:56------------------- - * - * --------------------------------------------------*/ + int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest ) { int nErr = Chainable( rSource, rDest ); @@ -1032,8 +993,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest ) SwFmtFrmSize aSize( rSource.GetFrmSize() ); if ( aSize.GetHeightSizeType() != ATT_FIX_SIZE ) { - SwClientIter aIter( rSource ); - SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) ); + SwFlyFrm *pFly = SwIterator::FirstElement( rSource ); if ( pFly ) aSize.SetHeight( pFly->Frm().Height() ); aSize.SetHeightSizeType( ATT_FIX_SIZE ); @@ -1045,9 +1005,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest ) } return nErr; } -/* -----------------23.07.98 13:56------------------- - * - * --------------------------------------------------*/ + void SwDoc::Unchain( SwFrmFmt &rFmt ) { SwFmtChain aChain( rFmt.GetChain() ); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 810e9fb2310a..b901f63e554e 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1359,7 +1359,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) { SwFmtChg aChgFmt( pDfltCharFmt ); // dann sage mal den Frames bescheid - aCallMod.Modify( &aChgFmt, &aChgFmt ); + aCallMod.ModifyNotification( &aChgFmt, &aChgFmt ); } } } @@ -1368,7 +1368,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) { SwAttrSetChg aChgOld( aOld, aOld ); SwAttrSetChg aChgNew( aNew, aNew ); - aCallMod.Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + aCallMod.ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } // und die default-Formate wieder beim Object austragen @@ -2040,14 +2040,9 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr, pDest = FindFmtByName( rDestArr, pSrc->GetName() ); pDest->SetAuto( FALSE ); -// pDest->ResetAllAttr(); -// pDest->CopyAttrs( *pSrc, TRUE ); // kopiere Attribute -//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus! pDest->DelDiffs( *pSrc ); - // --> OD 2009-03-23 #i94285# - // copy existing instance, before copying attributes -// pDest->SetFmtAttr( pSrc->GetAttrSet() ); // kopiere Attribute - //JP 18.08.98: Bug 55115 - copy PageDescAttribute in this case + + // #i94285#: existing instance, before copying attributes const SfxPoolItem* pItem; if( &GetAttrPool() != pSrc->GetAttrSet().GetPool() && SFX_ITEM_SET == pSrc->GetAttrSet().GetItemState( @@ -2061,8 +2056,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr, { pPageDesc = aPageDescs[ MakePageDesc( rNm ) ]; } - pPageDesc->Add( &aPageDesc ); -// pDest->SetFmtAttr( aPageDesc ); + aPageDesc.RegisterToPageDesc( *pPageDesc ); SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() ); aTmpAttrSet.Put( aPageDesc ); pDest->SetFmtAttr( aTmpAttrSet ); @@ -2071,7 +2065,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr, { pDest->SetFmtAttr( pSrc->GetAttrSet() ); } - // <-- pDest->SetPoolFmtId( pSrc->GetPoolFmtId() ); pDest->SetPoolHelpId( pSrc->GetPoolHelpId() ); @@ -2159,9 +2152,9 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader, pNewFmt->ResetFmtAttr( RES_CNTNT ); } if( bCpyHeader ) - pNewFmt->Add( (SwFmtHeader*)pNewItem ); + ((SwFmtHeader*)pNewItem)->RegisterToFormat(*pNewFmt); else - pNewFmt->Add( (SwFmtFooter*)pNewItem ); + ((SwFmtFooter*)pNewItem)->RegisterToFormat(*pNewFmt); rDestFmt.SetFmtAttr( *pNewItem ); } delete pNewItem; @@ -2248,16 +2241,10 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, rDstDesc.SetFtnInfo( rSrcDesc.GetFtnInfo() ); SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO ); { - SwClientIter aIter( rDstDesc.GetMaster() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) - pLast->Modify( &aInfo, 0 ); + rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); } { - SwClientIter aIter( rDstDesc.GetLeft() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) - pLast->Modify( &aInfo, 0 ); + rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); } } } diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 092b05783977..ee4f10f37b9c 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -49,8 +49,8 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) { if( rInfo.GetFtnTxtColl() ) rInfo.GetFtnTxtColl()->Add(this); - else if ( pRegisteredIn) - pRegisteredIn->Remove(this); + else if ( GetRegisteredIn()) + GetRegisteredInNonConst()->Remove(this); if ( rInfo.aPageDescDep.GetRegisteredIn() ) ((SwModify*)rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep ); @@ -183,7 +183,7 @@ void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt ) pChFmt->Add( &((SwClient&)aAnchorCharFmtDep) ); } -void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; @@ -207,7 +207,7 @@ void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) } } else - SwClient::Modify( pOld, pNew ); + CheckRegistration( pOld, pNew ); } SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo) @@ -314,7 +314,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) { SwFmtChg aOld( pOldChrFmt ); SwFmtChg aNew( pNewChrFmt ); - pFtnInfo->Modify( &aOld, &aNew ); + pFtnInfo->ModifyNotification( &aOld, &aNew ); } // --> OD 2008-01-09 #i81002# @@ -379,7 +379,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) { SwFmtChg aOld( pOldChrFmt ); SwFmtChg aNew( pNewChrFmt ); - pEndNoteInfo->Modify( &aOld, &aNew ); + pEndNoteInfo->ModifyNotification( &aOld, &aNew ); } // --> OD 2008-01-09 #i81002# @@ -446,7 +446,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, pTxtFtn->CheckCondColl(); //#i11339# dispose UNO wrapper when a footnote is changed to an endnote or vice versa SwPtrMsgPoolItem aMsgHint( RES_FOOTNOTE_DELETED, (void*)&pTxtFtn->GetAttr() ); - GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint ); + GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint ); } } } diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 30a385442fc0..5ae6629a5715 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -53,7 +53,7 @@ #include #include #include - +#include #include #include #include @@ -132,9 +132,8 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814 { pOutlNds = new SwOutlineNodes( 8, 8 ); - SwClientIter aIter( *(SwModify*)pSplitColl ); - for( SwTxtNode* pTNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode )); - pTNd; pTNd = (SwTxtNode*)aIter.Next() ) + SwIterator aIter( *pSplitColl ); + for( SwTxtNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() ) if( pTNd->GetNodes().IsDocNodes() ) pOutlNds->Insert( pTNd ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 5244cd79606a..0413ad1c82a0 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1917,7 +1917,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) const sal_Bool bOldLockView = pStartSh->IsViewLocked(); pStartSh->LockView( sal_True ); - GetSysFldType( RES_CHAPTERFLD )->Modify( 0, 0 ); // KapitelFld + GetSysFldType( RES_CHAPTERFLD )->ModifyNotification( 0, 0 ); // KapitelFld UpdateExpFlds( 0, sal_False ); // Expression-Felder Updaten UpdateTblFlds(NULL); // Tabellen UpdateRefFlds(NULL); // Referenzen diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 68ae706a4b51..06e898561174 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -603,10 +603,8 @@ SwDoc::~SwDoc() // Delete fuer Collections // damit die Abhaengigen wech sind - SwTxtFmtColl *pFtnColl = pFtnInfo->GetFtnTxtColl(); - if ( pFtnColl ) pFtnColl->Remove(pFtnInfo); - pFtnColl = pEndNoteInfo->GetFtnTxtColl(); - if ( pFtnColl ) pFtnColl->Remove(pEndNoteInfo); + pFtnInfo->ReleaseCollection(); + pEndNoteInfo->ReleaseCollection(); ASSERT( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0], "Default-Text-Collection muss immer am Anfang stehen" ); @@ -865,10 +863,8 @@ void SwDoc::ClearDoc() // Delete fuer Collections // damit die Abhaengigen wech sind - SwTxtFmtColl* pFtnColl = pFtnInfo->GetFtnTxtColl(); - if( pFtnColl ) pFtnColl->Remove( pFtnInfo ); - pFtnColl = pEndNoteInfo->GetFtnTxtColl(); - if( pFtnColl ) pFtnColl->Remove( pEndNoteInfo ); + pFtnInfo->ReleaseCollection(); + pEndNoteInfo->ReleaseCollection(); // JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array // steht, sollte das als letztes geloescht werden, damit diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 1224c5c02f17..10818f25a96e 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -49,18 +49,15 @@ #include #include #include -#ifndef _COMCORE_HRC #include -#endif #include #include #include #include #include -// --> OD 2008-03-13 #refactorlists# #include #include -// <-- +#include #include @@ -145,8 +142,6 @@ void SwDoc::PropagateOutlineRule() // if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei { - SwClientIter aIter(*pColl); - // --> OD 2006-11-20 #i71764# // Check only the list style, which is set at the paragraph style const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( FALSE ); @@ -1353,33 +1348,17 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut ) { for( USHORT n = GetNumRuleTbl().Count(); n; ) { - // --> OD 2008-02-19 #refactorlists# -// SwNumRuleInfo aUpd( GetNumRuleTbl()[ --n ]->GetName() ); -// aUpd.MakeList( *this ); - -// for( ULONG nFirst = 0, nLast = aUpd.GetList().Count(); -// nFirst < nLast; ++nFirst ) -// { -// SwTxtNode* pTNd = aUpd.GetList().GetObject( nFirst ); -// SwClientIter aIter( *pTNd ); -// for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); -// pFrm; pFrm = (SwFrm*)aIter.Next() ) -// if( ((SwTxtFrm*)pFrm)->HasAnimation() ) -// ((SwTxtFrm*)pFrm)->StopAnimation( pOut ); -// } SwNumRule::tTxtNodeList aTxtNodeList; GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList ); for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin(); aTxtNodeIter != aTxtNodeList.end(); ++aTxtNodeIter ) { SwTxtNode* pTNd = *aTxtNodeIter; - SwClientIter aIter( *pTNd ); - for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); - pFrm; pFrm = (SwFrm*)aIter.Next() ) - if( ((SwTxtFrm*)pFrm)->HasAnimation() ) - ((SwTxtFrm*)pFrm)->StopAnimation( pOut ); + SwIterator aIter(*pTNd); + for(SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) + if( pFrm->HasAnimation() ) + pFrm->StopAnimation( pOut ); } - // <-- } } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 32d26df19141..b2540c3501c8 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -3279,7 +3279,7 @@ void SwRedline::InvalidateRange() // das Layout anstossen { aHt.nStart = n == nSttNd ? nSttCnt : 0; aHt.nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len(); - ((SwTxtNode*)pNd)->Modify( &aHt, &aHt ); + ((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt ); } } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index e6900e96c363..bbc0b9a9b934 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -75,6 +75,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -259,15 +260,16 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, const SwTOXMark* pMax = &rCurTOXMark; const SwTOXMark* pMin = &rCurTOXMark; - const SwModify* pType = rCurTOXMark.GetRegisteredIn(); - SwClientIter aIter( *(SwModify*)pType ); + const SwTOXType* pType = rCurTOXMark.GetTOXType(); + SwTOXMarks aMarks; + SwTOXMark::InsertTOXMarks( aMarks, *pType ); const SwTOXMark* pTOXMark; const SwCntntFrm* pCFrm; Point aPt; - for( pTOXMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pTOXMark; - pTOXMark = (SwTOXMark*)aIter.Next() ) + for( sal_Int32 nMark=0; nMarkGetTxtTOXMark()) && 0 != ( pTOXSrc = pMark->GetpTxtNd() ) && @@ -357,7 +359,6 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, return *pNew; } -/* */ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos, const SwTOXBase& rTOX, @@ -477,9 +478,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const } return 0; } -/* -----------------01.09.99 16:01------------------- - --------------------------------------------------*/ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const { ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); @@ -488,9 +487,7 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const ASSERT( pFmt, "invalid TOXBaseSection!" ); return pFmt->GetAttrSet(); } -/* -----------------02.09.99 07:48------------------- - --------------------------------------------------*/ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate ) { SwTOXBase** prBase = 0; @@ -512,9 +509,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate ) } return (*prBase); } -/* -----------------02.09.99 08:06------------------- - --------------------------------------------------*/ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase) { SwTOXBase** prBase = 0; @@ -640,9 +635,7 @@ USHORT SwDoc::GetTOXTypeCount(TOXTypes eTyp) const ++nCnt; return nCnt; } -/*-------------------------------------------------------------------- - --------------------------------------------------------------------*/ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const { const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData(); @@ -653,18 +646,14 @@ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const return 0; } -/*-------------------------------------------------------------------- - --------------------------------------------------------------------*/ const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp ) { SwTOXType * pNew = new SwTOXType( rTyp ); pTOXTypes->Insert( pNew, pTOXTypes->Count() ); return pNew; } -/*-------------------------------------------------------------------- - --------------------------------------------------------------------*/ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, const String* pChkStr ) const { @@ -719,9 +708,6 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, return aName += String::CreateFromInt32( ++nNum ); } -/*-------------------------------------------------------------------- - - --------------------------------------------------------------------*/ BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) { ASSERT( rTOXBase.ISA( SwTOXBaseSection ), @@ -739,7 +725,6 @@ BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) return bRet; } -/* */ const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, BYTE nLvl = 0 ) { @@ -1204,18 +1189,17 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( USHORT nLevel ) void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl, const SwTxtNode* pOwnChapterNode ) { - const SwModify* pType = SwTOXBase::GetRegisteredIn(); + const SwTOXType* pType = (SwTOXType*) SwTOXBase::GetRegisteredIn(); if( !pType->GetDepends() ) return; SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc(); TOXTypes eTOXTyp = GetTOXType()->GetType(); - SwClientIter aIter( *(SwModify*)pType ); + SwIterator aIter( *pType ); SwTxtTOXMark* pTxtMark; SwTOXMark* pMark; - for( pMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pMark; - pMark = (SwTOXMark*)aIter.Next() ) + for( pMark = aIter.First(); pMark; pMark = aIter.Next() ) { ::SetProgressState( 0, pDoc->GetDocShell() ); @@ -1329,9 +1313,8 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode ) pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei continue; - SwClientIter aIter( *pColl ); - SwTxtNode* pTxtNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode )); - for( ; pTxtNd; pTxtNd = (SwTxtNode*)aIter.Next() ) + SwIterator aIter( *pColl ); + for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() ) { ::SetProgressState( 0, pDoc->GetDocShell() ); @@ -1358,9 +1341,8 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode ) if(!pSeqFld) return; - SwClientIter aIter( *pSeqFld ); - SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); - for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pSeqFld ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); if(!pTxtFld) @@ -1388,9 +1370,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode ) } } } -/* -----------------15.09.99 14:18------------------- - --------------------------------------------------*/ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl ) { SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc(); @@ -1398,9 +1378,8 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl ) if(!pAuthFld) return; - SwClientIter aIter( *pAuthFld ); - SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); - for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pAuthFld ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); //undo @@ -2431,9 +2410,7 @@ BOOL SwTOXBase::IsTOXBaseInReadonly() const } return bRet; } -/* -----------------17.08.99 13:29------------------- - --------------------------------------------------*/ const SfxItemSet* SwTOXBase::GetAttrSet() const { const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this); @@ -2464,6 +2441,3 @@ BOOL SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const return TRUE; } -/* */ - - diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index cb0b44b66822..f79febf7dd3a 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -34,20 +34,14 @@ #include // fuer GetAttrPool #include #include -// --> OD 2006-11-22 #i71574# #include -// <-- #include #include #include #include #include - -//--> #outlinelevel added by zhaojianwei -#ifndef _SFXINTITEM_HXX +#include #include -#endif -//<--end TYPEINIT1( SwTxtFmtColl, SwFmtColl ); TYPEINIT1( SwGrfFmtColl, SwFmtColl ); @@ -141,7 +135,7 @@ namespace TxtFmtCollFunc * SwTxtFmtColl TXT */ -void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( GetDoc()->IsInDtor() ) { @@ -361,10 +355,10 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) BOOL SwTxtFmtColl::IsAtDocNodeSet() const { - SwClientIter aIter( *(SwModify*)this ); + SwIterator aIter( *this ); const SwNodes& rNds = GetDoc()->GetNodes(); - for( SwClient* pC = aIter.First(TYPE(SwCntntNode)); pC; pC = aIter.Next() ) - if( &((SwCntntNode*)pC)->GetNodes() == &rNds ) + for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() ) + if( &(pNode->GetNodes()) == &rNds ) return TRUE; return FALSE; @@ -547,6 +541,12 @@ SwCollCondition::~SwCollCondition() delete aSubCondition.pFldExpression; } +void SwCollCondition::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + + int SwCollCondition::operator==( const SwCollCondition& rCmp ) const { @@ -684,9 +684,8 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel) SetAttrOutlineLevel(nAssignedListLevel+1); // --> OD 2009-03-18 #i100277# - SwClientIter aIter( *this ); - SwTxtFmtColl* pDerivedTxtFmtColl = - dynamic_cast(aIter.First( TYPE( SwTxtFmtColl ) )); + SwIterator aIter( *this ); + SwTxtFmtColl* pDerivedTxtFmtColl = aIter.First(); while ( pDerivedTxtFmtColl != 0 ) { if ( !pDerivedTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() ) @@ -702,7 +701,7 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel) } } - pDerivedTxtFmtColl = dynamic_cast(aIter.Next()); + pDerivedTxtFmtColl = aIter.Next(); } // <-- } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 19c5d4e2bdaa..24e7b67801cb 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -34,12 +34,8 @@ #ifdef TEST_DELAYED_RESIZE #include #endif -#ifndef _WRKWIN_HXX //autogen #include -#endif -#ifndef _APP_HXX //autogen #include -#endif #include #include #include @@ -55,9 +51,9 @@ #include "viewsh.hxx" #include "tabfrm.hxx" #include "viewopt.hxx" - #include "htmltbl.hxx" #include "ndindex.hxx" +#include "switerator.hxx" using namespace ::com::sun::star; @@ -66,8 +62,6 @@ using namespace ::com::sun::star; #define MAX_TABWIDTH (USHRT_MAX - 2001) -/* */ - class SwHTMLTableLayoutConstraints { USHORT nRow; // Start-Zeile @@ -421,11 +415,10 @@ USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm( USHORT SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const { USHORT nBrowseWidth = 0; - SwClientIter aIter( *(SwModify*)pSwTable->GetFrmFmt() ); - SwClient* pCli = aIter.First( TYPE( SwTabFrm )); - if( pCli ) + SwTabFrm* pFrm = SwIterator::FirstElement( *pSwTable->GetFrmFmt() ); + if( pFrm ) { - nBrowseWidth = GetBrowseWidthByTabFrm( *(SwTabFrm*)pCli ); + nBrowseWidth = GetBrowseWidthByTabFrm( *pFrm ); } else { diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index 7e2d6164c637..cd1c9b70b69f 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -94,7 +94,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy) if ( rCpy.GetRegisteredIn() ) ((SwModify*)rCpy.GetRegisteredIn())->Add( this ); else if ( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); aType = rCpy.GetNumType(); aDivider = rCpy.GetDivider(); @@ -142,9 +142,9 @@ void SwLineNumberInfo::SetCharFmt( SwCharFmt *pChFmt ) pChFmt->Add( this ); } -void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwLineNumberInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { - SwClient::Modify( pOld, pNew ); + CheckRegistration( pOld, pNew ); SwDoc *pDoc = ((SwCharFmt*)GetRegisteredIn())->GetDoc(); SwRootFrm* pRoot = pDoc->GetCurrentLayout(); if( pRoot ) diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index e3ec73f17a1e..5f5e71e16a0d 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -663,7 +663,7 @@ BOOL SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& , }\ } -void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { USHORT nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0; diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 847c6b229fd1..b26fe6ff6dcd 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -209,7 +209,7 @@ SwNumFmt::SwNumFmt() : ---------------------------------------------------------------------------*/ SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) : SvxNumberFormat(rFmt), - SwClient( rFmt.pRegisteredIn ), + SwClient( rFmt.GetRegisteredInNonConst() ), pVertOrient(new SwFmtVertOrient( 0, rFmt.GetVertOrient())) { sal_Int16 eMyVertOrient = rFmt.GetVertOrient(); @@ -241,7 +241,7 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) : pCFmt->Add( this ); } else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); } /* -----------------------------22.02.01 13:42-------------------------------- @@ -323,9 +323,9 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt) { SvxNumberFormat::operator=(rNumFmt); if( rNumFmt.GetRegisteredIn() ) - rNumFmt.pRegisteredIn->Add( this ); + rNumFmt.GetRegisteredInNonConst()->Add( this ); else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); return *this; } /* -----------------------------23.02.01 09:28-------------------------------- @@ -334,7 +334,7 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt) BOOL SwNumFmt::operator==( const SwNumFmt& rNumFmt) const { BOOL bRet = SvxNumberFormat::operator==(rNumFmt) && - pRegisteredIn == rNumFmt.pRegisteredIn; + GetRegisteredIn() == rNumFmt.GetRegisteredIn(); return bRet; } @@ -346,17 +346,18 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt) if( pChFmt ) pChFmt->Add( this ); else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); } /* -----------------------------22.02.01 13:45-------------------------------- ---------------------------------------------------------------------------*/ -void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { // dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses // NumFormat gesetzt ist. Das Format muss es nicht geben! const SwCharFmt* pFmt = 0; - switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ) + USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; + switch( nWhich ) { case RES_ATTRSET_CHG: case RES_FMT_CHG: @@ -367,7 +368,7 @@ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pFmt && !pFmt->GetDoc()->IsInDtor() ) UpdateNumNodes( (SwDoc*)pFmt->GetDoc() ); else - SwClient::Modify( pOld, pNew ); + CheckRegistration( pOld, pNew ); } /* -----------------------------23.02.01 11:08-------------------------------- @@ -381,11 +382,18 @@ void SwNumFmt::SetCharFmtName(const String& rSet) ---------------------------------------------------------------------------*/ const String& SwNumFmt::GetCharFmtName() const { - if((SwCharFmt*)pRegisteredIn) - return ((SwCharFmt*)pRegisteredIn)->GetName(); + if((SwCharFmt*)GetRegisteredIn()) + return ((SwCharFmt*)GetRegisteredIn())->GetName(); else return aEmptyStr; } + +void SwNumFmt::ForgetCharFmt() +{ + if ( GetRegisteredIn() ) + GetRegisteredInNonConst()->Remove( this ); +} + /* -----------------------------22.02.01 16:05-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 6119184d3209..a8b81ddf9c4b 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -61,6 +61,7 @@ #include #include #include +#include using namespace com::sun::star; using namespace com::sun::star::uno; @@ -210,20 +211,14 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ); for ( USHORT i = 0; i < GetTabLines().Count(); ++i ) \ { \ SwFrmFmt* pFmt = GetTabLines()[i]->GetFrmFmt(); \ - SwClientIter aIter( *pFmt ); \ - SwClient* pLast = aIter.GoStart(); \ - if( pLast ) \ + SwIterator aIter( *pFmt ); \ + for (SwRowFrm* pFrm=aIter.First(); pFrm; pFrm=aIter.Next())\ { \ - do \ - { \ - SwFrm *pFrm = PTR_CAST( SwFrm, pLast ); \ - if ( pFrm && \ - ((SwRowFrm*)pFrm)->GetTabLine() == GetTabLines()[i] ) \ + if ( pFrm->GetTabLine() == GetTabLines()[i] ) \ { \ ASSERT( pFrm->GetUpper()->IsTabFrm(), \ "Table layout does not match table structure" ) \ } \ - } while ( 0 != ( pLast = aIter++ ) ); \ } \ } \ } @@ -529,11 +524,10 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, USHORT nCpyCnt, SwRowFrm* GetRowFrm( SwTableLine& rLine ) { - SwClientIter aIter( *rLine.GetFrmFmt() ); - for( SwClient* pFrm = aIter.First( TYPE( SwRowFrm )); pFrm; - pFrm = aIter.Next() ) - if( ((SwRowFrm*)pFrm)->GetTabLine() == &rLine ) - return (SwRowFrm*)pFrm; + SwIterator aIter( *rLine.GetFrmFmt() ); + for( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) + if( pFrm->GetTabLine() == &rLine ) + return pFrm; return 0; } @@ -629,7 +623,7 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, //Lines fuer das Layout-Update herausuchen. const BOOL bLayout = !IsNewModel() && - 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) ); + 0 != SwIterator::FirstElement( *GetFrmFmt() ); if ( bLayout ) { @@ -750,7 +744,7 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt ) SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen //Lines fuer das Layout-Update herausuchen. - const BOOL bLayout = 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) ); + const BOOL bLayout = 0 != SwIterator::FirstElement( *GetFrmFmt() ); if( bLayout ) { aFndBox.SetTableLines( *this ); @@ -3758,8 +3752,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType, if( GetFrmFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && !rSz.GetWidthPercent() ) { - SwTabFrm* pTabFrm = (SwTabFrm*)SwClientIter( - *GetFrmFmt() ).First( TYPE( SwTabFrm )); + SwTabFrm* pTabFrm = SwIterator::FirstElement( *GetFrmFmt() ); if( pTabFrm && pTabFrm->Prt().Width() != rSz.GetWidth() ) { diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index ac9e6957707b..efc71eac9b23 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -92,7 +92,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) SwUpdateAttr aUpdateAttr( *pAttr->GetStart(), *pAttr->GetEnd(), RES_FMT_CHG ); - ((SwTxtNode*)pTxtNd)->Modify( &aUpdateAttr, &aUpdateAttr ); + ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr ); } if( bAction ) diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 9c2ce7af3139..982f1b0a902e 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -455,7 +455,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const SwNodeIndex aInsPos( *pEndNd ); SwTable& rTbl = (SwTable&)pTblNd->GetTable(); - pTblFmt->Add( &rTbl ); // das Frame-Format setzen + rTbl.RegisterToFormat( *pTblFmt ); rTbl.SetRowsToRepeat( GetTable().GetRowsToRepeat() ); rTbl.SetTblChgMode( GetTable().GetTblChgMode() ); diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 651533c618ca..a14a4f61e4bc 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -575,7 +575,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes ) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->Modify( &aMsgHint, &aMsgHint ); + pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } // A ClearRedo could result in a rekursive call of this function and delete some section @@ -1082,21 +1082,9 @@ SwFrm* SwClearDummies( SwFrm* pFrm ) SwSectionNode::~SwSectionNode() { - { - SwClientIter aIter( *(m_pSection->GetFmt()) ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pSectFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pSectFrm, TRUE ); - pLast = aIter.GoStart(); - } - else - pLast = aIter++; - } - } + // mba: test if iteration works as clients will be removed in callback + m_pSection->GetFmt()->CallSwClientNotify( RES_OBJECTDYING ); + SwDoc* pDoc = GetDoc(); SwSectionFmt* pFmt = m_pSection->GetFmt(); @@ -1415,7 +1403,7 @@ void SwSectionNode::NodesArrChgd() if( !rNds.IsDocNodes() ) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->Modify( &aMsgHint, &aMsgHint ); + pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } pFmt->LockModify(); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 07b4c9a99d49..5caa0fc899be 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -29,17 +29,11 @@ #include "precompiled_sw.hxx" #include - -#ifdef WTC -#define private public -#endif #include - #include #include #include #include -// OD 06.08.2003 #i17174# #include #include #include @@ -83,23 +77,17 @@ #include #include #include -#ifndef _COMCORE_HRC #include -#endif #include "docsh.hxx" #include #include - #include #include - #include #include -// --> OD 2005-12-05 #i27138# #include -// <-- #include - +#include #ifndef DBG_UTIL #define CHECK_TABLE(t) @@ -498,7 +486,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, } SwTable * pNdTbl = &pTblNd->GetTable(); - pTableFmt->Add( pNdTbl ); // das Frame-Format setzen + pNdTbl->RegisterToFormat( *pTableFmt ); pNdTbl->SetRowsToRepeat( nRowsToRepeat ); pNdTbl->SetTableModel( bNewModel ); @@ -794,7 +782,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, //Orientation am Fmt der Table setzen pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); - pTableFmt->Add( pNdTbl ); // das Frame-Format setzen + pNdTbl->RegisterToFormat( *pTableFmt ); if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) ) { @@ -1149,10 +1137,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > SwUndoTxtToTbl* pUndo = 0; if( DoesUndo() ) { -// StartUndo( UNDO_TEXTTOTABLE ); -// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt ); -// AppendUndo( pUndo ); - // das Splitten vom TextNode nicht in die Undohistory aufnehmen DoUndo( FALSE ); } @@ -1204,8 +1188,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); // die Tabelle bekommt USHRT_MAX als default SSize pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); -// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) -// pTableFmt->SetAttr( SwFmtLayoutSplit( FALSE )); /* #106283# If the first node in the selection is a context node and if it has an item FRAMEDIR set (no default) propagate the item to the @@ -1228,13 +1210,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > SwTable * pNdTbl = &pTblNd->GetTable(); ASSERT( pNdTbl, "kein Tabellen-Node angelegt." ) - pTableFmt->Add( pNdTbl ); // das Frame-Format setzen - -// const USHORT nRowsToRepeat = -// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? -// rInsTblOpts.mnRowsToRepeat : -// 0; -// pNdTbl->SetRowsToRepeat( nRowsToRepeat ); + pNdTbl->RegisterToFormat( *pTableFmt ); BOOL bUseBoxFmt = FALSE; if( !pBoxFmt->GetDepends() ) @@ -1244,28 +1220,11 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > bUseBoxFmt = TRUE; pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() ); delete pBoxFmt; -// eAdjust = HORI_NONE; } - //Orientation am Fmt der Table setzen -// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) ); -// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen - - ULONG nIdx = pTblNd->GetIndex(); aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 ); - { -// SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang -// rTmp.DeleteMark(); -// rTmp.GetPoint()->nNode = *pTblNd; -// SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode ); -// rTmp.GetPoint()->nContent.Assign( pCNd, 0 ); - } - -// if( pUndo ) -// EndUndo( UNDO_TEXTTOTABLE ); - SetModified(); SetFieldsDirty( true, NULL, 0 ); return pNdTbl; @@ -2451,7 +2410,7 @@ SwTableNode::~SwTableNode() SwFrmFmt* pTblFmt = GetTable().GetFrmFmt(); SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pTblFmt ); - pTblFmt->Modify( &aMsgHint, &aMsgHint ); + pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint ); DelFrms(); delete pTable; } @@ -2537,14 +2496,12 @@ void SwTableNode::DelFrms() //Sie muessen etwas umstaendlich zerstort werden, damit die Master //die Follows mit in's Grab nehmen. - SwClientIter aIter( *(pTable->GetFrmFmt()) ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) + SwIterator aIter( *(pTable->GetFrmFmt()) ); + SwTabFrm *pFrm = aIter.First(); + while ( pFrm ) { BOOL bAgain = FALSE; - if ( pLast->IsA( TYPE(SwFrm) ) ) { - SwTabFrm *pFrm = (SwTabFrm*)pLast; if ( !pFrm->IsFollow() ) { while ( pFrm->HasFollow() ) @@ -2570,7 +2527,7 @@ void SwTableNode::DelFrms() bAgain = TRUE; } } - pLast = bAgain ? aIter.GoStart() : aIter++; + pFrm = bAgain ? aIter.First() : aIter.Next(); } } @@ -3044,7 +3001,7 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, USHORT nSet ) SwMsgPoolItem aChg( RES_TBLHEADLINECHG ); rTable.SetRowsToRepeat( nSet ); - rTable.GetFrmFmt()->Modify( &aChg, &aChg ); + rTable.GetFrmFmt()->ModifyNotification( &aChg, &aChg ); SetModified(); } @@ -3568,7 +3525,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter, pOldTblFmt->GetDoc()->GetDfltFrmFmt() ); *pNewTblFmt = *pOldTblFmt; - pNewTblFmt->Add( &pNewTblNd->GetTable() ); + pNewTblNd->GetTable().RegisterToFormat( *pNewTblFmt ); // neue Size errechnen ? (lcl_ChgTblSize nur das 2. aufrufen, wenn es // beim 1. schon geklappt hat; also absolute Groesse hat) diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 985ef3cdbc57..8842e0e758de 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -28,11 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#ifdef WTC -#define private public -#endif - #include "hintids.hxx" #include #include @@ -60,6 +55,7 @@ #include "docary.hxx" #include "ndindex.hxx" #include "undobj.hxx" +#include "switerator.hxx" using namespace ::com::sun::star; @@ -462,12 +458,12 @@ BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly ) for ( i = 0; i < aRowArr.Count(); ++i ) { - SwClientIter aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() ); - SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); + SwIterator aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() ); + SwFrm* pFrm = aIter.First(); while ( pFrm ) { nHeight = Max( nHeight, pFrm->Frm().Height() ); - pFrm = (SwFrm*)aIter.Next(); + pFrm = aIter.Next(); } } SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 4a6b87893474..327b1cd42004 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -28,12 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include - -// --> OD 2005-02-21 #i42921# #include -// <-- #include #include #include @@ -71,13 +67,11 @@ #include #include #include -// --> OD 2005-12-05 #i27138# #include -// <-- #include -// --> OD 2007-10-31 #i83479# #include -// <-- +#include +#include "ndole.hxx" using namespace ::com::sun::star::i18n; @@ -787,10 +781,9 @@ SwFrmFmt* SwNode::GetFlyFmt() const { if( IsCntntNode() ) { - SwClientIter aIter( *(SwCntntNode*)this ); - SwClient* pCli = aIter.First( TYPE( SwCntntFrm )); - if( pCli ) - pRet = ((SwCntntFrm*)pCli)->FindFlyFrm()->GetFmt(); + SwCntntFrm* pFrm = SwIterator::FirstElement( *(SwCntntNode*)this ); + if( pFrm ) + pRet = pFrm->FindFlyFrm()->GetFmt(); } if( !pRet ) { @@ -1060,7 +1053,7 @@ SwCntntNode::~SwCntntNode() ((SwAttrSet*)mpAttrSet.get())->SetModifyAtAttr( 0 ); } -void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) +void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { USHORT nWhich = pOldValue ? pOldValue->Which() : pNewValue ? pNewValue->Which() : 0 ; @@ -1072,7 +1065,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject; // nicht umhaengen wenn dieses das oberste Format ist !! - if( pRegisteredIn == pFmt ) + if( GetRegisteredIn() == pFmt ) { if( pFmt->GetRegisteredIn() ) { @@ -1139,7 +1132,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) break; } - SwModify::Modify( pOldValue, pNewValue ); + NotifyClients( pOldValue, pNewValue ); } BOOL SwCntntNode::InvalidateNumRule() @@ -1218,8 +1211,6 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) { SwFmtChg aTmp1( pOldColl ); SwFmtChg aTmp2( pNewColl ); - // damit alles was im Modify passiert hier nicht noch impl. - // werden muss SwCntntNode::Modify( &aTmp1, &aTmp2 ); } } @@ -1386,60 +1377,7 @@ void SwCntntNode::DelFrms() if( !GetDepends() ) return; - SwClientIter aIter( *this ); - SwCntntFrm *pFrm; - - for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm; - pFrm = (SwCntntFrm*)aIter.Next() ) - { - // --> OD 2005-12-01 #i27138# - // notify accessibility paragraphs objects about changed - // CONTENT_FLOWS_FROM/_TO relation. - // Relation CONTENT_FLOWS_FROM for current next paragraph will change - // and relation CONTENT_FLOWS_TO for current previous paragraph will change. - if ( pFrm->IsTxtFrm() ) - { - ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); - if ( pViewShell && pViewShell->GetLayout() && - pViewShell->GetLayout()->IsAnyShellAccessible() ) - { - pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast(pFrm->FindNextCnt( true )), - dynamic_cast(pFrm->FindPrevCnt( true )) ); - } - } - // <-- - if( pFrm->HasFollow() ) - pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() ); - if( pFrm->IsFollow() ) - { - SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster(); - pMaster->SetFollow( pFrm->GetFollow() ); - pFrm->_SetIsFollow( FALSE ); - } - pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt. - //Andernfalls kann es sein, dass ein Follow - //vor seinem Master zerstoert wird, der Master - //greift dann ueber den ungueltigen - //Follow-Pointer auf fremdes Memory zu. - //Die Kette darf hier zerknauscht werden, weil - //sowieso alle zerstoert werden. - if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() && - !pFrm->GetIndPrev() ) - { - SwFtnFrm *pFtn = pFrm->FindFtnFrm(); - ASSERT( pFtn, "You promised a FtnFrm?" ); - SwCntntFrm* pCFrm; - if( !pFtn->GetFollow() && !pFtn->GetMaster() && - 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) - { - ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); - ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); - } - } - pFrm->Cut(); - delete pFrm; - } + SwCntntFrm::DelFrms(*this); if( IsTxtNode() ) { ((SwTxtNode*)this)->SetWrong( NULL ); @@ -1510,7 +1448,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const case RES_CONTENT_VISIBLE: { ((SwPtrMsgPoolItem&)rInfo).pObject = - SwClientIter( *(SwCntntNode*)this ).First( TYPE(SwFrm) ); + SwIterator::FirstElement(*this); } return FALSE; } @@ -1548,7 +1486,7 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } return bRet; @@ -1624,7 +1562,7 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) // einige Sonderbehandlungen fuer Attribute SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } return bRet; @@ -1674,7 +1612,7 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen mpAttrSet.reset();//DELETEZ( mpAttrSet ); @@ -1715,7 +1653,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt } } if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen @@ -1754,7 +1692,7 @@ USHORT SwCntntNode::ResetAllAttr() { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen mpAttrSet.reset();//DELETEZ( mpAttrSet ); @@ -1894,7 +1832,7 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl ) { SwFmtChg aTmp1( pOldColl ? pOldColl : GetFmtColl() ); SwFmtChg aTmp2( pColl ? pColl : GetFmtColl() ); - SwModify::Modify( &aTmp1, &aTmp2 ); + NotifyClients( &aTmp1, &aTmp2 ); } if( IsInCache() ) { @@ -2074,6 +2012,24 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos, } // <-- +SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize ) +{ + SwOLENodes *pNodes = 0; + SwIterator aIter( rColl ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) + { + SwOLENode *pONd = pNd->GetOLENode(); + if ( pONd && (!bOnlyWithInvalidSize || pONd->IsOLESizeInvalid()) ) + { + if ( !pNodes ) + pNodes = new SwOLENodes; + pNodes->Insert( pONd, pNodes->Count() ); + } + } + + return pNodes; +} + //FEATURE::CONDCOLL // Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !! // os: nur fuer ICC, da der zum optimieren zu dumm ist diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 62fa380097d3..d7ac37dc4bd8 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -28,8 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include // SwClientIter +#include +#include #include #include #include @@ -42,14 +42,14 @@ #include "section.hxx" #include "node2lay.hxx" - /* -----------------25.02.99 10:31------------------- * Die SwNode2LayImpl-Klasse erledigt die eigentliche Arbeit, * die SwNode2Layout-Klasse ist nur die der Oefffentlichkeit bekannte Schnittstelle * --------------------------------------------------*/ class SwNode2LayImpl { - SwClientIter *pIter; // Der eigentliche Iterator + SwIterator* pIter; + SwModify* pMod; SvPtrarr *pUpperFrms;// Zum Einsammeln der Upper ULONG nIndex; // Der Index des einzufuegenden Nodes BOOL bMaster : 1; // TRUE => nur Master , FALSE => nur Frames ohne Follow @@ -77,6 +77,71 @@ public: * vor oder hinter den eingefuegt werden soll. * --------------------------------------------------*/ +SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx) +{ + if( pIdx->GetIndex() >= rNodes.Count() - 1 ) + return 0; + + SwNodeIndex aTmp(*pIdx, +1); + SwNode* pNd = 0; + while( aTmp < rNodes.Count()-1 ) + { + pNd = &aTmp.GetNode(); + bool bFound = false; + if ( pNd->IsCntntNode() ) + bFound = ( SwIterator::FirstElement(*(SwCntntNode*)pNd) != 0); + else if ( pNd->IsTableNode() ) + bFound = ( SwIterator::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 ); + else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() ) + { + pNd = 0; + break; + } + if ( bFound ) + break; + aTmp++; + } + + if( aTmp == rNodes.Count()-1 ) + pNd = 0; + else if( pNd ) + (*pIdx) = aTmp; + return pNd; +} + +SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx) +{ + if( !pIdx->GetIndex() ) + return 0; + + SwNodeIndex aTmp( *pIdx, -1 ); + SwNode* pNd(0); + while( aTmp.GetIndex() ) + { + pNd = &aTmp.GetNode(); + bool bFound = false; + if ( pNd->IsCntntNode() ) + bFound = ( SwIterator::FirstElement(*(SwCntntNode*)pNd) != 0); + else if ( pNd->IsTableNode() ) + bFound = ( SwIterator::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 ); + else if( pNd->IsStartNode() && !pNd->IsSectionNode() ) + { + pNd = 0; + break; + } + if ( bFound ) + break; + aTmp--; + } + + if( !aTmp.GetIndex() ) + pNd = 0; + else if( pNd ) + (*pIdx) = aTmp; + return pNd; +} + + SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) : pUpperFrms( NULL ), nIndex( nIdx ), bInit( FALSE ) { @@ -88,7 +153,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) if( !bSearch && rNode.GetIndex() < nIndex ) { SwNodeIndex aTmp( *rNode.EndOfSectionNode(), +1 ); - pNd = rNode.GetNodes().GoPreviousWithFrm( &aTmp ); + pNd = GoPreviousWithFrm( &aTmp ); if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() ) pNd = NULL; // Nicht ueber den Bereich hinausschiessen bMaster = FALSE; @@ -96,7 +161,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) else { SwNodeIndex aTmp( rNode, -1 ); - pNd = rNode.GetNodes().GoNextWithFrm( &aTmp ); + pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp ); bMaster = TRUE; if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() ) pNd = NULL; // Nicht ueber den Bereich hinausschiessen @@ -109,7 +174,6 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) } if( pNd ) { - SwModify *pMod; if( pNd->IsCntntNode() ) pMod = (SwModify*)pNd->GetCntntNode(); else @@ -117,10 +181,13 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) ASSERT( pNd->IsTableNode(), "For Tablenodes only" ); pMod = pNd->GetTableNode()->GetTable().GetFrmFmt(); } - pIter = new SwClientIter( *pMod ); + pIter = new SwIterator( *pMod ); } else + { pIter = NULL; + pMod = 0; + } } /* -----------------25.02.99 10:41------------------- @@ -141,11 +208,11 @@ SwFrm* SwNode2LayImpl::NextFrm() return FALSE; if( !bInit ) { - pRet = (SwFrm*)pIter->First(TYPE(SwFrm)); + pRet = pIter->First(); bInit = TRUE; } else - pRet = (SwFrm*)pIter->Next(); + pRet = pIter->Next(); while( pRet ) { SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet ); @@ -188,7 +255,7 @@ SwFrm* SwNode2LayImpl::NextFrm() } return pRet; } - pRet = (SwFrm*)pIter->Next(); + pRet = pIter->Next(); } return NULL; } @@ -215,6 +282,7 @@ void SwNode2LayImpl::SaveUpperFrms() } delete pIter; pIter = NULL; + pMod = 0; } SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode ) @@ -358,9 +426,8 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos, const SwPosition *pPos, const BOOL bCalcFrm ) const { - return pIter ? ::GetFrmOfModify( 0, pIter->GetModify(), USHRT_MAX, - pDocPos, pPos, bCalcFrm ) - : 0; + // mba: test if change of member pIter -> pMod broke anything + return pMod ? ::GetFrmOfModify( 0, *pMod, USHRT_MAX, pDocPos, pPos, bCalcFrm ) : 0; } SwNode2Layout::SwNode2Layout( const SwNode& rNd, ULONG nIdx ) diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 9a234d93f4c2..724fa0fae14a 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -366,7 +366,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, SwPtrMsgPoolItem aMsgHint( nDelMsg, (void*)&pAttr->GetAttr() ); rNds.GetDoc()->GetUnoCallBack()-> - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); } } } @@ -663,7 +663,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt(); SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pTblFmt ); - pTblFmt->Modify( &aMsgHint, &aMsgHint ); + pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } } if( bNewFrms ) @@ -1525,79 +1525,6 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const return (SwCntntNode*)pNd; } -SwNode* SwNodes::GoNextWithFrm(SwNodeIndex *pIdx) const -{ - if( pIdx->GetIndex() >= Count() - 1 ) - return 0; - - SwNodeIndex aTmp(*pIdx, +1); - SwNode* pNd = 0; - while( aTmp < Count()-1 ) - { - pNd = &aTmp.GetNode(); - SwModify *pMod = 0; - if ( pNd->IsCntntNode() ) - pMod = (SwCntntNode*)pNd; - else if ( pNd->IsTableNode() ) - pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt(); - else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() ) - { - pNd = 0; - break; - } - if ( pMod && pMod->GetDepends() ) - { - SwClientIter aIter( *pMod ); - if( aIter.First( TYPE(SwFrm) ) ) - break; - } - aTmp++; - } - if( aTmp == Count()-1 ) - pNd = 0; - else if( pNd ) - (*pIdx) = aTmp; - return pNd; -} - -SwNode* SwNodes::GoPreviousWithFrm(SwNodeIndex *pIdx) const -{ - if( !pIdx->GetIndex() ) - return 0; - - SwNodeIndex aTmp( *pIdx, -1 ); - SwNode* pNd(0); - while( aTmp.GetIndex() ) - { - pNd = &aTmp.GetNode(); - SwModify *pMod = 0; - if ( pNd->IsCntntNode() ) - pMod = (SwCntntNode*)pNd; - else if ( pNd->IsTableNode() ) - pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt(); - else if( pNd->IsStartNode() && !pNd->IsSectionNode() ) - { - pNd = 0; - break; - } - if ( pMod && pMod->GetDepends() ) - { - SwClientIter aIter( *pMod ); - if( aIter.First( TYPE(SwFrm) ) ) - break; - } - aTmp--; - } - - if( !aTmp.GetIndex() ) - pNd = 0; - else if( pNd ) - (*pIdx) = aTmp; - return pNd; -} - - - /************************************************************************* |* |* BOOL SwNodes::CheckNodesRange() diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 2d54cb88f2e6..678a4c454f09 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -28,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -38,7 +37,6 @@ #include #include #include - #include #include #include @@ -64,11 +62,10 @@ #include #include #include -// --> FME 2004-06-22 #114856# edit in readonly sections #include -// <-- #include #include +#include using namespace ::com::sun::star; @@ -250,7 +247,7 @@ SwSection::~SwSection() // dann melden wir noch schnell unser Format um ans dflt FrameFmt, // damit es keine Abhaengigkeiten gibt if( pFmt->DerivedFrom() != pDoc->GetDfltFrmFmt() ) - pDoc->GetDfltFrmFmt()->Add( pFmt ); + pFmt->RegisterToFormat( *pDoc->GetDfltFrmFmt() ); } else { @@ -269,7 +266,7 @@ SwSection::~SwSection() // ist die Section der letzte Client im Format, kann dieses // geloescht werden SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->Modify( &aMsgHint, &aMsgHint ); + pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); if( !pFmt->GetDepends() ) { // Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher @@ -336,7 +333,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) // erstmal allen Childs sagen, das sie versteckt sind SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN ); - pFmt->Modify( &aMsgItem, &aMsgItem ); + pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); // alle Frames loeschen pFmt->DelFrms(); @@ -353,7 +350,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) // erstmal allen Childs sagen, das der Parent nicht mehr // versteckt ist SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN ); - pFmt->Modify( &aMsgItem, &aMsgItem ); + pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); pFmt->MakeFrms(); } @@ -438,7 +435,7 @@ void SwSection::SetEditInReadonly(bool const bFlag) } // <-- -void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { bool bRemake = false; bool bUpdateFtn = false; @@ -487,7 +484,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pNew ) { bool bNewFlag = - static_cast(pNew)->IsCntntProtected(); + static_cast(pNew)->IsCntntProtected(); if( !bNewFlag ) { // Abschalten: teste ob nicht vielleich ueber die Parents @@ -511,7 +508,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pNew ) { const bool bNewFlag = - static_cast(pNew)->GetValue(); + static_cast(pNew)->GetValue(); m_Data.SetEditInReadonlyFlag( bNewFlag ); } return; @@ -543,6 +540,10 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) bUpdateFtn = true; } break; + + default: + CheckRegistration( pOld, pNew ); + break; } if( bRemake ) @@ -557,7 +558,6 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pSectNd ) pSectNd->GetDoc()->GetFtnIdxs().UpdateFtn(SwNodeIndex( *pSectNd )); } - SwClient::Modify( pOld, pNew ); } void SwSection::SetRefObject( SwServerObject* pObj ) @@ -700,19 +700,10 @@ SwSectionFmt::~SwSectionFmt() rSect.SetHidden(false); } } - SwClientIter aIter( *this ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pFrm, TRUE ); - pLast = aIter.GoStart(); - } - else - pLast = aIter++; - } + + // mba: test iteration; objects are removed while iterating + CallSwClientNotify( RES_OBJECTDYING ); + // hebe die Section doch mal auf SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() ); GetDoc()->GetNodes().SectionUp( &aRg ); @@ -726,14 +717,7 @@ SwSectionFmt::~SwSectionFmt() SwSection * SwSectionFmt::GetSection() const { - if( GetDepends() ) - { - SwClientIter aIter( *(SwSectionFmt*)this ); - return (SwSectionPtr)aIter.First( TYPE(SwSection) ); - } - - ASSERT( FALSE, "keine Section als Client." ) - return 0; + return SwIterator::FirstElement( *this ); } extern void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd ); @@ -746,34 +730,19 @@ void SwSectionFmt::DelFrms() if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() && 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { - SwClientIter aIter( *this ); - SwClient *pLast = aIter.GoStart(); - // --> OD 2007-08-14 #147431# - // First delete the of the instance - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pFrm, FALSE ); - pLast = aIter.GoStart(); - } - else - { - pLast = aIter++; - } - } + // #147431# : First delete the of the instance + // mba: test iteration as objects are removed in iteration + CallSwClientNotify( RES_OBJECTDYING ); + // Then delete frames of the nested instances - pLast = aIter.GoStart(); + SwIterator aIter( *this ); + SwSectionFmt *pLast = aIter.First(); while ( pLast ) { - if ( pLast->IsA( TYPE(SwSectionFmt) ) ) - { - ((SwSectionFmt*)pLast)->DelFrms(); - } - pLast = aIter++; + pLast->DelFrms(); + pLast = aIter.Next(); } - // <-- + ULONG nEnde = pSectNd->EndOfSectionIndex(); ULONG nStart = pSectNd->GetIndex()+1; lcl_DeleteFtn( pSectNd, nStart, nEnde ); @@ -790,7 +759,7 @@ void SwSectionFmt::DelFrms() if( pCNd ) { const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC ); - pCNd->Modify( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem ); + pCNd->ModifyNotification( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem ); } } } @@ -810,18 +779,7 @@ void SwSectionFmt::MakeFrms() } } -void lcl_ClientIter( SwSectionFmt* pFmt, const SfxPoolItem* pOld, - const SfxPoolItem* pNew ) -{ - SwClientIter aIter( *pFmt ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) - do { - pLast->Modify( (SfxPoolItem*)pOld, (SfxPoolItem*)pNew ); - } while( 0 != ( pLast = aIter++ )); -} - -void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { BOOL bClients = FALSE; USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -836,7 +794,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( SFX_ITEM_SET == pNewSet->GetItemState( RES_PROTECT, FALSE, &pItem )) { - lcl_ClientIter( this, pItem, pItem ); + ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); pNewSet->ClearItem( RES_PROTECT ); pOldSet->ClearItem( RES_PROTECT ); } @@ -845,7 +803,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( SFX_ITEM_SET == pNewSet->GetItemState( RES_EDIT_IN_READONLY, FALSE, &pItem ) ) { - lcl_ClientIter( this, pItem, pItem ); + ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); pNewSet->ClearItem( RES_EDIT_IN_READONLY ); pOldSet->ClearItem( RES_EDIT_IN_READONLY ); } @@ -854,16 +812,14 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( SFX_ITEM_SET == pNewSet->GetItemState( RES_FTN_AT_TXTEND, FALSE, &pItem )) { - lcl_ClientIter( this, &pOldSet->Get( RES_FTN_AT_TXTEND ), - pItem ); + ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_FTN_AT_TXTEND ), (SfxPoolItem*)pItem ); pNewSet->ClearItem( RES_FTN_AT_TXTEND ); pOldSet->ClearItem( RES_FTN_AT_TXTEND ); } if( SFX_ITEM_SET == pNewSet->GetItemState( RES_END_AT_TXTEND, FALSE, &pItem )) { - lcl_ClientIter( this, &pOldSet->Get( RES_END_AT_TXTEND ), - pItem ); + ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_END_AT_TXTEND ), (SfxPoolItem*)pItem ); pNewSet->ClearItem( RES_END_AT_TXTEND ); pOldSet->ClearItem( RES_END_AT_TXTEND ); } @@ -883,12 +839,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pSect && ( bClients || ( RES_SECTION_HIDDEN == nWhich ? !pSect->IsHiddenFlag() : pSect->IsHiddenFlag() ) ) ) { - // selbst ueber die Clients iterieren, sollte schneller sein! - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); - do { - pLast->Modify( pOld, pNew ); - } while( 0 != ( pLast = aIter++ )); + ModifyBroadcast( pOld, pNew ); } } return ; @@ -901,12 +852,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) // diese Messages bis zum Ende des Baums durchreichen ! if( GetDepends() ) { - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do { - pLast->Modify( pOld, pNew ); - } while( 0 != ( pLast = aIter++ )); + ModifyBroadcast( pOld, pNew ); } return; // das wars @@ -958,17 +904,16 @@ BOOL SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const case RES_CONTENT_VISIBLE: { - SwFrm* pFrm = (SwFrm*)SwClientIter( *(SwSectionFmt*)this ).First( TYPE(SwFrm) ); + SwFrm* pFrm = SwIterator::FirstElement(*this); // if the current section has no own frame search for the children if(!pFrm) { - SwClientIter aFormatIter( *(SwSectionFmt*)this ); - SwSectionFmt* pChild = (SwSectionFmt*)aFormatIter. - First( TYPE(SwSectionFmt) ); + SwIterator aFormatIter(*this); + SwSectionFmt* pChild = aFormatIter.First(); while(pChild && !pFrm) { - pFrm = (SwFrm*)SwClientIter( *pChild ).First( TYPE(SwFrm) ); - pChild = (SwSectionFmt*)aFormatIter.Next(); + pFrm = SwIterator::FirstElement(*pChild); + pChild = aFormatIter.Next(); } } ((SwPtrMsgPoolItem&)rInfo).pObject = pFrm; @@ -1027,15 +972,14 @@ USHORT SwSectionFmt::GetChildSections( SwSections& rArr, if( GetDepends() ) { - SwClientIter aIter( *this ); - SwClient * pLast; + SwIterator aIter(*this); const SwNodeIndex* pIdx; - for( pLast = aIter.First(TYPE(SwSectionFmt)); pLast; pLast = aIter.Next() ) + for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() ) if( bAllSections || - ( 0 != ( pIdx = ((SwSectionFmt*)pLast)->GetCntnt(FALSE). + ( 0 != ( pIdx = pLast->GetCntnt(FALSE). GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() )) { - const SwSection* Dummy=((SwSectionFmt*)pLast)->GetSection(); + const SwSection* Dummy = pLast->GetSection(); rArr.C40_INSERT( SwSection, Dummy, rArr.Count() ); @@ -1085,8 +1029,8 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert // <-- bool bIsHidden = false; - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); + SwClientIter aIter( *this ); // TODO + ::SwClient * pLast = aIter.GoStart(); if( pLast ) // konnte zum Anfang gesprungen werden ?? do { if( pLast->IsA( TYPE(SwSectionFmt) ) ) @@ -1115,7 +1059,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert if (!pProtect->IsCntntProtected() != !pSection->IsProtectFlag()) { - pLast->Modify( (SfxPoolItem*)pProtect, + pLast->ModifyNotification( (SfxPoolItem*)pProtect, (SfxPoolItem*)pProtect ); } @@ -1123,7 +1067,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert if (!pEditInReadonly->GetValue() != !pSection->IsEditInReadonlyFlag()) { - pLast->Modify( (SfxPoolItem*)pEditInReadonly, + pLast->ModifyNotification( (SfxPoolItem*)pEditInReadonly, (SfxPoolItem*)pEditInReadonly ); } // <-- @@ -1133,7 +1077,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert SwMsgPoolItem aMsgItem( static_cast(bIsHidden ? RES_SECTION_HIDDEN : RES_SECTION_NOT_HIDDEN ) ); - pLast->Modify( &aMsgItem, &aMsgItem ); + pLast->ModifyNotification( &aMsgItem, &aMsgItem ); } } else if( !pSection && diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index cb804b102c0e..507b5b831b79 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -80,7 +80,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) // them havent't a loaded Graphic. - #86501# rGrfNd.LockModify(); - SwClientIter aIter( rGrfNd ); + SwClientIter aIter( rGrfNd ); // TODO for( int n = 0; n < 2; ++n ) { SwClient * pLast = aIter.GoStart(); @@ -88,7 +88,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) { do { if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) ) - pLast->Modify( &rItem, &rItem ); + pLast->ModifyNotification( &rItem, &rItem ); } while( 0 != ( pLast = aIter++ )); } } @@ -218,7 +218,7 @@ void SwBaseLink::DataChanged( const String& rMimeType, if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) ) { SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); - pCntntNode->Modify( &aMsgHint, &aMsgHint ); + pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint ); bUpdate = FALSE; } } @@ -283,7 +283,7 @@ void SwBaseLink::DataChanged( const String& rMimeType, } else { - pCntntNode->Modify( &aMsgHint, &aMsgHint ); + pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint ); } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 6ba70d9cfbcc..44643550139f 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,7 @@ #include #include #include - +#include #include using namespace ::com::sun::star; @@ -309,13 +310,13 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible, return; } - if ( !pRegisteredIn ) + if ( !GetRegisteredIn() ) { ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing frame format!" ); return; } - const IDocumentDrawModelAccess* pIDDMA = static_cast(pRegisteredIn)->getIDocumentDrawModelAccess(); + const IDocumentDrawModelAccess* pIDDMA = static_cast(GetRegisteredInNonConst())->getIDocumentDrawModelAccess(); if ( !pIDDMA ) { ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no writer document!" ); @@ -408,7 +409,7 @@ sal_uInt32 SwContact::GetMinOrdNum() const { sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 ); - std::vector< SwAnchoredObject* > aObjs; + std::list< SwAnchoredObject* > aObjs; GetAnchoredObjs( aObjs ); while ( !aObjs.empty() ) @@ -438,7 +439,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const { sal_uInt32 nMaxOrdNum( 0L ); - std::vector< SwAnchoredObject* > aObjs; + std::list< SwAnchoredObject* > aObjs; GetAnchoredObjs( aObjs ); while ( !aObjs.empty() ) @@ -543,88 +544,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster ) mpMasterObj = static_cast(_pNewMaster); } -/************************************************************************* -|* -|* SwFlyDrawContact::CreateNewRef() -|* -|* Ersterstellung MA 14. Dec. 94 -|* Letzte Aenderung MA 24. Apr. 95 -|* -|*************************************************************************/ - -SwVirtFlyDrawObj *SwFlyDrawContact::CreateNewRef( SwFlyFrm *pFly ) -{ - SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *GetMaster(), pFly ); - pDrawObj->SetModel( GetMaster()->GetModel() ); - pDrawObj->SetUserCall( this ); - - //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu - //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden - //die Master aus der Liste entfernt und fuehren von da an ein - //Schattendasein. - SdrPage* pPg( 0L ); - if ( 0 != ( pPg = GetMaster()->GetPage() ) ) - { - const UINT32 nOrdNum = GetMaster()->GetOrdNum(); - pPg->ReplaceObject( pDrawObj, nOrdNum ); - } - // --> OD 2004-08-16 #i27030# - insert new instance - // into drawing page with correct order number - else - { - GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )-> - InsertObject( pDrawObj, _GetOrdNumForNewRef( pFly ) ); - } - // <-- - // --> OD 2004-12-13 #i38889# - assure, that new instance - // is in a visible layer. - MoveObjToVisibleLayer( pDrawObj ); - // <-- - return pDrawObj; -} - -/** method to determine new order number for new instance of - - OD 2004-08-16 #i27030# - Used in method - - @author OD -*/ -sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm ) -{ - sal_uInt32 nOrdNum( 0L ); - - // search for another Writer fly frame registered at same frame format - SwClientIter aIter( *GetFmt() ); - const SwFlyFrm* pFlyFrm( 0L ); - for ( pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) ); - pFlyFrm; - pFlyFrm = (SwFlyFrm*)aIter.Next() ) - { - if ( pFlyFrm != _pFlyFrm ) - { - break; - } - } - - if ( pFlyFrm ) - { - // another Writer fly frame found. Take its order number - nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum(); - } - else - { - // no other Writer fly frame found. Take order number of 'master' object - // --> OD 2004-11-11 #i35748# - use method instead - // of method to avoid a recalculation of the order number, - // which isn't intended. - nOrdNum = GetMaster()->GetOrdNumDirect(); - // <-- - } - - return nOrdNum; -} - /************************************************************************* |* |* SwFlyDrawContact::Modify() @@ -634,7 +553,7 @@ sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm ) |* |*************************************************************************/ -void SwFlyDrawContact::Modify( SfxPoolItem *, SfxPoolItem * ) +void SwFlyDrawContact::Modify( const SfxPoolItem*, const SfxPoolItem * ) { } @@ -716,17 +635,10 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj ) @author */ -void SwFlyDrawContact::GetAnchoredObjs( std::vector& _roAnchoredObjs ) const +void SwFlyDrawContact::GetAnchoredObjs( std::list& _roAnchoredObjs ) const { const SwFrmFmt* pFmt = GetFmt(); - - SwClientIter aIter( *(const_cast(pFmt)) ); - for( SwFlyFrm* pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) ); - pFlyFrm; - pFlyFrm = (SwFlyFrm*)aIter.Next() ) - { - _roAnchoredObjs.push_back( pFlyFrm ); - } + SwFlyFrm::GetAnchoredObjects( _roAnchoredObjs, *pFmt ); } /************************************************************************* @@ -769,7 +681,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) : meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY ) // <-- { - // clear vector containing 'virtual' drawing objects. + // clear list containing 'virtual' drawing objects. maDrawVirtObjs.clear(); // --> OD 2004-09-22 #i33909# - assure, that drawing object is inserted @@ -818,6 +730,45 @@ SwDrawContact::~SwDrawContact() } } +void SwDrawContact::GetTextObjectsFromFmt( std::list& rTextObjects, SwDoc* pDoc ) +{ + for( sal_Int32 n=0; nGetSpzFrmFmts()->Count(); n++ ) + { + SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[n]; + if( pFly->IsA( TYPE(SwDrawFrmFmt) ) ) + { + std::list aTextObjs; + SwDrawContact* pContact = SwIterator::FirstElement(*pFly); + if( pContact ) + { + SdrObject* pSdrO = pContact->GetMaster(); + if ( pSdrO ) + { + if ( pSdrO->IsA( TYPE(SdrObjGroup) ) ) + { + SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS ); + //iterate inside of a grouped object + while( aListIter.IsMore() ) + { + SdrObject* pSdrOElement = aListIter.Next(); + if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) && + static_cast( pSdrOElement)->HasText() ) + { + rTextObjects.push_back((SdrTextObj*) pSdrOElement); + } + } + } + else if( pSdrO->IsA( TYPE(SdrTextObj) ) && + static_cast( pSdrO )->HasText() ) + { + rTextObjects.push_back((SdrTextObj*) pSdrO); + } + } + } + } + } +} + // OD 2004-03-29 #i26791# const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj ) const { @@ -1405,7 +1356,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj, { if(::CheckControlLayer(maAnchoredDrawObj.DrawObj())) { - const IDocumentDrawModelAccess* pIDDMA = static_cast(pRegisteredIn)->getIDocumentDrawModelAccess(); + const IDocumentDrawModelAccess* pIDDMA = static_cast(GetRegisteredInNonConst())->getIDocumentDrawModelAccess(); const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer()); const SdrLayerID aControlLayerID(pIDDMA->GetControlsId()); const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId()); @@ -1621,7 +1572,7 @@ namespace |* |*************************************************************************/ -void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { // OD 10.10.2003 #112299# ASSERT( !mbDisconnectInProgress, @@ -1834,7 +1785,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer ) // drawing page, move the 'master' drawing object into the corresponding // invisible layer. { - //((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> + //((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> // RemoveObject( GetMaster()->GetOrdNum() ); // OD 21.08.2003 #i18447# - in order to consider group object correct // use new method @@ -1855,7 +1806,7 @@ void SwDrawContact::RemoveMasterFromDrawPage() GetMaster()->SetUserCall( 0 ); if ( GetMaster()->IsInserted() ) { - ((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> + ((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> RemoveObject( GetMaster()->GetOrdNum() ); } } @@ -1947,7 +1898,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) } // <-- - SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)pRegisteredIn; + SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)GetRegisteredIn(); if( !pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) return; @@ -2009,8 +1960,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) { SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode ); SwCntntNode* pCNd = pDrawFrmFmt->GetDoc()->GetNodes().GoNext( &aIdx ); - SwClientIter aIter( *pCNd ); - if ( aIter.First( TYPE(SwFrm) ) ) + if ( SwIterator::FirstElement( *pCNd ) ) pModify = pCNd; else { @@ -2042,11 +1992,9 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) pModify = pAnch->GetCntntAnchor()->nNode.GetNode().GetCntntNode(); } } - SwClientIter aIter( *pModify ); + SwIterator aIter( *pModify ); SwFrm* pAnchorFrmOfMaster = 0; - for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); - pFrm; - pFrm = (SwFrm*)aIter.Next() ) + for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { // append drawing object, if // (1) proposed anchor frame isn't a follow and @@ -2216,7 +2164,7 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster ) @author */ -void SwDrawContact::GetAnchoredObjs( std::vector& _roAnchoredObjs ) const +void SwDrawContact::GetAnchoredObjs( std::list& _roAnchoredObjs ) const { _roAnchoredObjs.push_back( const_cast(&maAnchoredDrawObj) ); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 83a2e29a2be7..aca39b5b29b7 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -444,7 +444,7 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj, const std::vector& _rMovedChildObjs ) const { // determine 'repeated' objects of already moved object <_rMovedAnchoredObj> - std::vector aAnchoredObjs; + std::list aAnchoredObjs; { const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() ); ASSERT( pContact, diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 1e4f699fa203..ffe6ada138a8 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -45,7 +45,7 @@ #include #include #include - +#include /*-------------------------------------------------------------------- Beschreibung: Feldtypen zu einer ResId zaehlen @@ -202,7 +202,7 @@ void SwEditShell::FieldToText( SwFieldType* pType ) BOOL bDDEFld = RES_DDEFLD == pType->Which(); // Modify-Object gefunden, trage alle Felder ins Array ein - SwClientIter aIter( *pType ); + SwClientIter aIter( *pType ); // TODO SwClient * pLast = aIter.GoStart(); if( pLast ) // konnte zum Anfang gesprungen werden ?? @@ -579,13 +579,13 @@ BOOL SwEditShell::IsAnyDatabaseFieldInDoc()const case RES_DBNUMSETFLD: case RES_DBSETNUMBERFLD: { - SwClientIter aIter( rFldType ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( rFldType ); + SwFmtFld* pFld = aIter.First(); while(pFld) { if(pFld->IsFldInDoc()) return TRUE; - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } } break; diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx index 1bc78a5a7482..821daba8a500 100644 --- a/sw/source/core/edit/edfldexp.cxx +++ b/sw/source/core/edit/edfldexp.cxx @@ -29,9 +29,7 @@ #include "precompiled_sw.hxx" #include #include -#ifndef _DBMGR_HXX #include -#endif #include #include #include @@ -42,13 +40,11 @@ #include #include #include +#include using namespace com::sun::star; using ::rtl::OUString; -/* -----------------28.11.2002 17:53----------------- - * - * --------------------------------------------------*/ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const { const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes(); @@ -70,8 +66,8 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const { case RES_DBFLD: { - SwClientIter aIter( rFldType ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( rFldType ); + SwFmtFld* pFld = aIter.First(); while(pFld) { if(pFld->IsFldInDoc()) @@ -88,7 +84,7 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const return FALSE; } } - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } } break; diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 7725ae834176..2e38e3c9957f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -66,7 +66,7 @@ #include #include #include - +#include using namespace com::sun::star; @@ -423,8 +423,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly ) pNd->SetContour( pPoly ); SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); - pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur, - (SwFmtSurround*)&rSur ); + pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); GetDoc()->SetModified(); EndAllAction(); } @@ -439,8 +438,7 @@ void SwEditShell::ClearAutomaticContour() pNd->SetContour( NULL, FALSE ); SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); - pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur, - (SwFmtSurround*)&rSur ); + pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); GetDoc()->SetModified(); EndAllAction(); } @@ -811,14 +809,13 @@ USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) const SwCharFmts* pFmts = GetDoc()->GetCharFmts(); for( USHORT n = pFmts->Count(); 1 < n; ) { - SwClientIter aIter( *(*pFmts)[ --n ] ); - - for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt )); - pFnd; pFnd = aIter.Next() ) - if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) && + SwIterator aIter(*(*pFmts)[--n]); + for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) + { + if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) && pTxtNd->GetNodes().IsDocNodes() ) { - SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd; + SwTxtINetFmt& rAttr = *pFnd; String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(), *rAttr.GetEnd() - *rAttr.GetStart() ) ); @@ -832,6 +829,7 @@ USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) } } } + } return rArr.Count(); } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 90a34ea32a00..938ce6c36ae5 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -35,9 +35,7 @@ #include -#ifndef _COMCORE_HRC #include -#endif #include #include #include @@ -57,9 +55,7 @@ #include // SwShellCrsr #include // SwWrongList #include // Statusanzeige -#ifndef _STATSTR_HRC #include // StatLine-String -#endif #include #include #include @@ -67,7 +63,7 @@ #include // SwRedlineTbl #include #include - +#include using namespace ::svx; using namespace ::com::sun::star; @@ -77,8 +73,6 @@ using namespace ::com::sun::star::linguistic2; #define C2U(cChar) rtl::OUString::createFromAscii(cChar) -extern void repaintTextFrames( SwModify& rModify ); - /************************************************************************* * class SwLinguIter *************************************************************************/ @@ -1969,7 +1963,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) pWrong = pNode->GetWrong(); if( pWrong ) pWrong->RemoveEntry( nStart, nEnd ); - ::repaintTextFrames( *pNode ); + SwTxtFrm::repaintTextFrames( *pNode ); } ++aIdx; nStart = 0; diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 230e45f71079..89e1d6b570c4 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -365,13 +365,15 @@ void SwEditShell::ApplyAutoMark() { //1. const SwTOXType* pTOXType = GetTOXType(TOX_INDEX, 0); - SwClientIter aIter(*(SwTOXType*)pTOXType); - SwTOXMark* pMark = (SwTOXMark*)aIter.First(TYPE(SwTOXMark)); - while( pMark ) + + SwTOXMarks aMarks; + SwTOXMark::InsertTOXMarks( aMarks, *pTOXType ); + for( sal_uInt16 nMark=0; nMarkIsAutoGenerated() && pMark->GetTxtTOXMark()) + // mba: test iteration; objects are deleted in iteration DeleteTOXMark(pMark); - pMark = (SwTOXMark*)aIter.Next(); } //2. diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 2c6fe50625ac..b32f01074038 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -40,9 +40,7 @@ #include #include #include -#ifndef _COMCORE_HRC #include -#endif #include #include #include @@ -54,11 +52,9 @@ #include #include #include -#ifndef _UNOFLDMID_H #include -#endif #include - +#include #include using namespace ::com::sun::star::uno; @@ -77,9 +73,6 @@ SV_DECL_PTRARR_DEL( SortKeyArr, TOXSortKeyPtr, 5, 5 ) SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr ) -/* -----------------16.09.99 11:53------------------- - - --------------------------------------------------*/ SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy) : nRefCount(0) { @@ -95,10 +88,6 @@ BOOL SwAuthEntry::operator==(const SwAuthEntry& rComp) return TRUE; } // -------------------------------------------------------- - -/* -----------------14.09.99 16:15------------------- - - --------------------------------------------------*/ SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc) : SwFieldType( RES_AUTHORITY ), m_pDoc(pDoc), @@ -129,9 +118,6 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType) m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i); } -/* -----------------17.09.99 13:52------------------- - - --------------------------------------------------*/ SwAuthorityFieldType::~SwAuthorityFieldType() { // DBG_ASSERT(!m_pDataArr->Count(), "Array is not empty"); @@ -140,16 +126,12 @@ SwAuthorityFieldType::~SwAuthorityFieldType() delete m_pSequArr; delete m_pDataArr; } -/*-- 14.09.99 16:22:09--------------------------------------------------- - -----------------------------------------------------------------------*/ SwFieldType* SwAuthorityFieldType::Copy() const { return new SwAuthorityFieldType(m_pDoc); } -/* -----------------17.09.99 13:43------------------- - --------------------------------------------------*/ void SwAuthorityFieldType::RemoveField(long nHandle) { #ifdef DBG_UTIL @@ -178,9 +160,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle) DBG_ASSERT(bRemoved, "Field unknown" ); #endif } -/* -----------------17.09.99 13:43------------------- - --------------------------------------------------*/ long SwAuthorityFieldType::AddField(const String& rFieldContents) { long nRet = 0; @@ -210,9 +190,7 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents) } return nRet; } -/* -----------------17.09.99 14:18------------------- - --------------------------------------------------*/ BOOL SwAuthorityFieldType::AddField(long nHandle) { BOOL bRet = FALSE; @@ -232,9 +210,7 @@ BOOL SwAuthorityFieldType::AddField(long nHandle) DBG_ASSERT(bRet, "::AddField(long) failed"); return bRet; } -/* -----------------17.09.99 14:52------------------- - --------------------------------------------------*/ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const { const SwAuthEntry* pRet = 0; @@ -251,9 +227,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const ASSERT( pRet, "invalid Handle" ); return pRet; } -/* -----------------21.09.99 13:34------------------- - --------------------------------------------------*/ void SwAuthorityFieldType::GetAllEntryIdentifiers( SvStringsDtor& rToFill )const { @@ -264,9 +238,7 @@ void SwAuthorityFieldType::GetAllEntryIdentifiers( AUTH_FIELD_IDENTIFIER )), rToFill.Count() ); } } -/* -----------------21.09.99 13:34------------------- - --------------------------------------------------*/ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier( const String& rIdentifier)const { @@ -282,9 +254,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier( } return pRet; } -/* -----------------------------21.12.99 13:20-------------------------------- - ---------------------------------------------------------------------------*/ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) { bool bChanged = false; @@ -303,9 +273,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) } return bChanged; } -/*-- 11.10.99 08:49:22--------------------------------------------------- - Description: appends a new entry (if new) and returns the array position +/*------------------------------------------------------------------------- + appends a new entry (if new) and returns the array position -----------------------------------------------------------------------*/ USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) { @@ -327,9 +297,6 @@ USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) return nRet; } -/*-- 11.10.99 08:49:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ long SwAuthorityFieldType::GetHandle(USHORT nPos) { long nRet = 0; @@ -340,9 +307,7 @@ long SwAuthorityFieldType::GetHandle(USHORT nPos) } return nRet; } -/* -----------------19.10.99 13:46------------------- - --------------------------------------------------*/ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) { //find the field in a sorted array of handles, @@ -354,12 +319,11 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) if(!m_pSequArr->Count()) { SwTOXSortTabBases aSortArr; - SwClientIter aIter( *this ); + SwIterator aIter( *this ); SwTOXInternational aIntl(m_eLanguage, 0, m_sSortAlgorithm); - for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); if(!pTxtFld || !pTxtFld->GetpTxtNode()) @@ -439,9 +403,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) ASSERT(bCurrentFieldWithoutTextNode || nRet, "Handle not found") return nRet; } -/* -----------------------------15.11.00 17:33-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const { switch( nWhichId ) @@ -496,9 +458,7 @@ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const } return TRUE; } -/* -----------------------------15.11.00 17:33-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId ) { sal_Bool bRet = TRUE; @@ -571,25 +531,19 @@ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId ) } return bRet; } -/* -----------------19.10.99 13:25------------------- - --------------------------------------------------*/ -void SwAuthorityFieldType::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwAuthorityFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { //re-generate positions of the fields DelSequenceArray(); - SwModify::Modify( pOld, pNew ); + NotifyClients( pOld, pNew ); } -/* -----------------20.10.99 13:38------------------- - --------------------------------------------------*/ USHORT SwAuthorityFieldType::GetSortKeyCount() const { return m_pSortKeyArr->Count(); } -/* -----------------20.10.99 13:38------------------- - --------------------------------------------------*/ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const { SwTOXSortKey* pRet = 0; @@ -598,9 +552,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const DBG_ASSERT(pRet, "Sort key not found"); return pRet; } -/* -----------------20.10.99 13:38------------------- - --------------------------------------------------*/ void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[]) { m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count()); @@ -610,9 +562,6 @@ void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[]) m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++); } -/* -----------------14.09.99 16:15------------------- - - --------------------------------------------------*/ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType, const String& rFieldContents ) : SwField(pInitType), @@ -620,9 +569,7 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType, { m_nHandle = pInitType->AddField( rFieldContents ); } -/* -----------------17.09.99 14:24------------------- - --------------------------------------------------*/ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType, long nSetHandle ) : SwField( pInitType ), @@ -631,16 +578,12 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType, { pInitType->AddField( m_nHandle ); } -/* -----------------15.09.99 15:00------------------- - --------------------------------------------------*/ SwAuthorityField::~SwAuthorityField() { ((SwAuthorityFieldType* )GetTyp())->RemoveField(m_nHandle); } -/*-- 14.09.99 16:20:59--------------------------------------------------- - -----------------------------------------------------------------------*/ String SwAuthorityField::Expand() const { SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp(); @@ -666,45 +609,33 @@ String SwAuthorityField::Expand() const sRet += pAuthType->GetSuffix(); return sRet; } -/*-- 14.09.99 16:21:00--------------------------------------------------- - -----------------------------------------------------------------------*/ SwField* SwAuthorityField::Copy() const { SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp(); return new SwAuthorityField(pAuthType, m_nHandle); } -/* -----------------21.09.99 12:55------------------- - --------------------------------------------------*/ const String& SwAuthorityField::GetFieldText(ToxAuthorityField eField) const { SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp(); const SwAuthEntry* pEntry = pAuthType->GetEntryByHandle( m_nHandle ); return pEntry->GetAuthorField( eField ); } -/* -----------------21.09.99 14:57------------------- - --------------------------------------------------*/ void SwAuthorityField::SetPar1(const String& rStr) { SwAuthorityFieldType* pInitType = (SwAuthorityFieldType* )GetTyp(); pInitType->RemoveField(m_nHandle); m_nHandle = pInitType->AddField(rStr); } -/* -----------------11.10.99 09:43------------------- - --------------------------------------------------*/ String SwAuthorityField::GetDescription() const { return SW_RES(STR_AUTHORITY_ENTRY); } - -/* -----------------------------15.11.00 17:33-------------------------------- - - ---------------------------------------------------------------------------*/ const char* aFieldNames[] = { "Identifier", @@ -739,9 +670,7 @@ const char* aFieldNames[] = "Custom5", "ISBN" }; -/* -----------------------------16.11.00 12:27-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const { if(!GetTyp()) @@ -763,9 +692,7 @@ BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const rAny <<= aRet; return FALSE; } -/* -----------------------------15.11.00 17:33-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int16 lcl_Find(const OUString& rFieldName) { for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++) @@ -809,9 +736,7 @@ BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ ) return FALSE; } -/* -----------------11.10.99 09:43------------------- - --------------------------------------------------*/ SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp ) { SwAuthorityFieldType* pSrcTyp = (SwAuthorityFieldType*)GetTyp(), diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index a06e5bc9eb64..9556fd70b39c 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -724,20 +724,6 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox ) { -/* - - // oder besser ueber die Box den Frame suchen - - SwClientIter aIter( *pBox->GetFrmFmt() ); - ULONG nMinPos = ULONG_MAX; - const SwFrm* pFnd = 0; - for( SwFrm* pF = (SwFrm*)aIter.First( TYPE( SwCellFrm )); pF; - pF = (SwFrm*)aIter.Next() ) - { - if( pF->Frm().Y() < - } -*/ - SwNodeIndex aIdx( *rBox.GetSttNd() ); SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx ); ASSERT( pCNd, "Box hat keinen TextNode" ); diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 15c44286921c..78d7bd70c522 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -44,16 +44,12 @@ #include #include #include -#ifndef _DBMGR_HXX #include -#endif #include #include #include -#ifndef _UNOFLDMID_H #include -#endif - +#include using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star; @@ -128,9 +124,6 @@ void SwDBFieldType::ReleaseRef() } } -/* -----------------24.02.99 14:51------------------- - * - * --------------------------------------------------*/ BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -152,9 +145,7 @@ BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/* -----------------24.02.99 14:51------------------- - * - * --------------------------------------------------*/ + BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -172,8 +163,8 @@ BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId ) if( sTmp != sColumn ) { sColumn = sTmp; - SwClientIter aIter( *this ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *this ); + SwFmtFld* pFld = aIter.First(); while(pFld) { // Feld im Undo? @@ -184,7 +175,7 @@ BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId ) pDBField->ClearInitialized(); pDBField->InitContent(); } - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } } } @@ -420,9 +411,7 @@ void SwDBField::SetSubType(USHORT nType) nSubType = nType; } -/*-----------------06.03.98 16:15------------------- ---------------------------------------------------*/ BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -454,9 +443,7 @@ BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const return TRUE; } -/*-----------------06.03.98 16:15------------------- ---------------------------------------------------*/ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -481,8 +468,8 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId ) //invalidate text node if(GetTyp()) { - SwClientIter aIter( *GetTyp() ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *GetTyp() ); + SwFmtFld* pFld = aIter.First(); while(pFld) { SwTxtFld *pTxtFld = pFld->GetTxtFld(); @@ -492,7 +479,7 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId ) pTxtFld->NotifyContentChange(*pFld); break; } - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } } } @@ -564,9 +551,6 @@ String SwDBNameInfField::GetCntnt(BOOL bName) const return lcl_DBTrennConv(sStr); } -/*-----------------06.03.98 16:55------------------- - ---------------------------------------------------*/ BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -591,9 +575,7 @@ BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/*-----------------06.03.98 16:55------------------- ---------------------------------------------------*/ BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -625,16 +607,12 @@ BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId ) } return TRUE; } -/* -----------------4/10/2003 15:03------------------ - --------------------------------------------------*/ USHORT SwDBNameInfField::GetSubType() const { return nSubType; } -/* -----------------4/10/2003 15:03------------------ - --------------------------------------------------*/ void SwDBNameInfField::SetSubType(USHORT nType) { nSubType = nType; @@ -709,9 +687,7 @@ void SwDBNextSetField::SetPar1(const String& rStr) { aCond = rStr; } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { BOOL bRet = TRUE; @@ -725,9 +701,7 @@ BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return bRet; } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = TRUE; @@ -742,21 +716,6 @@ BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ -/* -String SwDBNextSetField::GetPar2() const -{ - return GetDBName(); -} - -void SwDBNextSetField::SetPar2(const String& rStr) -{ - GetDBName() = rStr; -} -*/ - /*-------------------------------------------------------------------- Beschreibung: Datensatz mit bestimmter ID --------------------------------------------------------------------*/ @@ -845,9 +804,7 @@ void SwDBNumSetField::SetPar2(const String& rStr) { aPar2 = rStr; } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { BOOL bRet = TRUE; @@ -864,9 +821,7 @@ BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return bRet; } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNumSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = TRUE; @@ -946,16 +901,12 @@ SwField* SwDBNameField::Copy() const return pTmp; } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { return SwDBNameInfField::QueryValue(rAny, nWhichId ); } -/*-----------------06.03.98 16:16------------------- ---------------------------------------------------*/ BOOL SwDBNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { return SwDBNameInfField::PutValue(rAny, nWhichId ); @@ -997,7 +948,6 @@ String SwDBSetNumberField::Expand() const return aEmptyStr; else return FormatNumber((USHORT)nNumber, GetFormat()); - //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat())); } //------------------------------------------------------------------------------ @@ -1025,9 +975,7 @@ SwField* SwDBSetNumberField::Copy() const pTmp->SetSubType(GetSubType()); return pTmp; } -/*-----------------06.03.98 16:15------------------- ---------------------------------------------------*/ BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { BOOL bRet = TRUE; @@ -1044,9 +992,7 @@ BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return bRet; } -/*-----------------06.03.98 16:15------------------- ---------------------------------------------------*/ BOOL SwDBSetNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = TRUE; diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index f208ac71dbb3..c4473b8510bc 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -40,9 +40,7 @@ #include #include #include -#ifndef _UNOFLDMID_H #include -#endif #include using rtl::OUString; @@ -124,7 +122,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType, int bCallModify = FALSE; rFldType.LockModify(); - SwClientIter aIter( rFldType ); + SwClientIter aIter( rFldType ); // TODO SwClient * pLast = aIter.GoStart(); if( pLast ) // konnte zum Anfang gesprungen werden ?? do { @@ -139,7 +137,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType, else if( pSh ) pSh->StartAction(); } - pLast->Modify( 0, &aUpdateDDE ); + pLast->ModifyNotification( 0, &aUpdateDDE ); bCallModify = TRUE; } } while( 0 != ( pLast = aIter++ )); @@ -186,7 +184,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const { // hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen const SwNode* pNd = 0; - SwClientIter aIter( rFldType ); + SwClientIter aIter( rFldType ); // TODO SwClient * pLast = aIter.GoStart(); if( pLast ) // konnte zum Anfang gesprungen werden ?? do { @@ -213,7 +211,7 @@ BOOL SwIntrnlRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd, { // hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen SwNodes* pNds = &rFldType.GetDoc()->GetNodes(); - SwClientIter aIter( rFldType ); + SwClientIter aIter( rFldType ); // TODO SwClient * pLast = aIter.GoStart(); if( pLast ) // konnte zum Anfang gesprungen werden ?? do { @@ -401,8 +399,8 @@ SwDDEField::SwDDEField( SwDDEFieldType* pInitType ) SwDDEField::~SwDDEField() { - if( GetTyp()->IsLastDepend() ) // der Letzte mach das - ((SwDDEFieldType*)GetTyp())->Disconnect(); // Licht aus + if( GetTyp()->IsLastDepend() ) + ((SwDDEFieldType*)GetTyp())->Disconnect(); } String SwDDEField::Expand() const diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index 1756690d1384..f7764ed2ebca 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -62,10 +62,12 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType, const SwNode& rNd = *GetTabSortBoxes()[0]->GetSttNd(); if( rNd.GetNodes().IsDocNodes() ) { - // "aktivieren der Updates" (Modify nicht noch mal rufen) - aDepend.LockModify(); + // mba: swclient refactoring - this code shouldn't have done anything! + // the ModifyLock Flag is evaluated in SwModify only, though it was accessible via SwClient + // This has been fixed now +// aDepend.LockModify(); pDDEType->IncRefCnt(); - aDepend.UnlockModify(); +// aDepend.UnlockModify(); // Setzen der Werte in die einzelnen Boxen // update box content only if update flag is set (false in import) @@ -91,7 +93,7 @@ __EXPORT SwDDETable::~SwDDETable() } } -void SwDDETable::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( pNew && RES_UPDATEDDETBL == pNew->Which() ) ChangeContent(); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 862a073d9884..3fd6dc105238 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -103,6 +103,7 @@ #include #include +#include #define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS @@ -176,14 +177,11 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage, if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem( RES_PAGEDESC, n ) ) && pDesc->GetNumOffset() && pDesc->GetDefinedIn() ) { - if( pDesc->GetDefinedIn()->ISA( SwCntntNode )) + SwCntntNode* pNd = PTR_CAST( SwCntntNode, pDesc->GetDefinedIn() ); + if( pNd ) { - SwClientIter aIter( *(SwModify*)pDesc->GetDefinedIn() ); - if( aIter.First( TYPE( SwFrm ) ) ) - { + if ( SwIterator::FirstElement(*pNd) ) bVirtuell = sal_True; - break; - } } else if( pDesc->GetDefinedIn()->ISA( SwFmt )) { @@ -249,9 +247,6 @@ sal_uInt16 SwPageNumberField::GetSubType() const return nSubType; } -/*-----------------05.03.98 10:25------------------- - ---------------------------------------------------*/ BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -282,9 +277,7 @@ BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 10:25------------------- ---------------------------------------------------*/ BOOL SwPageNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = TRUE; @@ -383,9 +376,6 @@ SwField* SwAuthorField::Copy() const return pTmp; } -/*-----------------05.03.98 11:15------------------- - ---------------------------------------------------*/ BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { sal_Bool bVal; @@ -410,9 +400,7 @@ BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 11:15------------------- ---------------------------------------------------*/ BOOL SwAuthorField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -529,9 +517,6 @@ SwField* SwFileNameField::Copy() const return pTmp; } -/*-----------------05.03.98 08:59------------------- - ---------------------------------------------------*/ BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -571,9 +556,7 @@ BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 09:01------------------- ---------------------------------------------------*/ BOOL SwFileNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -705,9 +688,6 @@ SwField* SwTemplNameField::Copy() const return pTmp; } -/*-----------------05.03.98 08:59------------------- - ---------------------------------------------------*/ BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch ( nWhichId ) @@ -733,9 +713,7 @@ BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 09:01------------------- ---------------------------------------------------*/ BOOL SwTemplNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch ( nWhichId ) @@ -860,9 +838,6 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm ) pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() ); } -/*-----------------05.03.98 11:38------------------- - ---------------------------------------------------*/ BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch ( nWhichId ) @@ -875,9 +850,7 @@ BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 11:38------------------- ---------------------------------------------------*/ BOOL SwDocStatField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = FALSE; @@ -912,9 +885,7 @@ SwDocInfoFieldType::SwDocInfoFieldType(SwDoc* pDc) { } -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ +// --------------------------------------------------------------------------- SwFieldType* SwDocInfoFieldType::Copy() const { SwDocInfoFieldType* pTyp = new SwDocInfoFieldType(GetDoc()); @@ -934,9 +905,7 @@ void lcl_GetLocalDataWrapper( ULONG nLang, SvxCreateLocale( static_cast(nLang) ) ); } -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ +// --------------------------------------------------------------------------- String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, sal_uInt16 nLang, const String& rName ) const { @@ -1084,9 +1053,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, return aStr; } -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ +// --------------------------------------------------------------------------- SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt) : SwValueField(pTyp, nFmt), nSubType(nSub) { @@ -1101,9 +1068,8 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const aContent = rValue; } -/* --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ template double lcl_TimeToDouble( const T& rTime ) { @@ -1748,9 +1714,7 @@ SwField* SwHiddenParaField::Copy() const return pFld; } -/*-----------------05.03.98 13:25------------------- ---------------------------------------------------*/ BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch ( nWhichId ) @@ -1770,9 +1734,7 @@ BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 13:25------------------- ---------------------------------------------------*/ BOOL SwHiddenParaField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch ( nWhichId ) @@ -1913,9 +1875,6 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const return (mpText) ? mpText->Count() : 1; } -/*-----------------05.03.98 13:42------------------- - ---------------------------------------------------*/ BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -1976,10 +1935,6 @@ BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const return sal_True; } - -/*-----------------05.03.98 13:42------------------- - ---------------------------------------------------*/ BOOL SwPostItField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -2121,9 +2076,6 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub) nType = nSub; } -/*-----------------05.03.98 14:14------------------- - ---------------------------------------------------*/ BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -2149,9 +2101,7 @@ BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 14:14------------------- ---------------------------------------------------*/ BOOL SwExtUserField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -2199,7 +2149,7 @@ SwFieldType* SwRefPageSetFieldType::Copy() const ---------------------------------------------------------------------------*/ // ueberlagert, weil es nichts zum Updaten gibt! -void SwRefPageSetFieldType::Modify( SfxPoolItem *, SfxPoolItem * ) +void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * ) { } @@ -2241,9 +2191,6 @@ void SwRefPageSetField::SetPar2(const String& rStr) SetOffset( (short) rStr.ToInt32() ); } -/*-----------------05.03.98 14:52------------------- - ---------------------------------------------------*/ BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -2259,9 +2206,7 @@ BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 14:52------------------- ---------------------------------------------------*/ BOOL SwRefPageSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -2297,7 +2242,7 @@ SwFieldType* SwRefPageGetFieldType::Copy() const /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { // Update auf alle GetReferenz-Felder if( !pNew && !pOld && GetDepends() ) @@ -2306,30 +2251,26 @@ void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) _SetGetExpFlds aTmpLst( 10, 5 ); if( MakeSetList( aTmpLst ) ) { - SwClientIter aIter( *this ); - if( aIter.GoStart() ) - do { + SwIterator aIter( *this ); + for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) // nur die GetRef-Felder Updaten - SwFmtFld* pFmtFld = (SwFmtFld*)aIter(); if( pFmtFld->GetTxtFld() ) UpdateField( pFmtFld->GetTxtFld(), aTmpLst ); - } while( aIter++ ); } } // weiter an die Text-Felder, diese "Expandieren" den Text - SwModify::Modify( pOld, pNew ); + NotifyClients( pOld, pNew ); } /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) { - SwClientIter aIter( *pDoc->GetSysFldType( RES_REFPAGESETFLD)); - if( aIter.GoStart() ) - do { + SwIterator aIter(*pDoc->GetSysFldType( RES_REFPAGESETFLD)); + for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + { // nur die GetRef-Felder Updaten - SwFmtFld* pFmtFld = (SwFmtFld*)aIter(); const SwTxtFld* pTFld = pFmtFld->GetTxtFld(); if( pTFld ) { @@ -2369,7 +2310,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) if( !rTmpLst.Insert( pNew )) delete pNew; } - } while( aIter++ ); + } return rTmpLst.Count(); } @@ -2421,7 +2362,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, } } // dann die Formatierung anstossen - ((SwFmtFld&)pTxtFld->GetFld()).Modify( 0, 0 ); + ((SwFmtFld&)pTxtFld->GetFld()).ModifyNotification( 0, 0 ); } /*-------------------------------------------------------------------- @@ -2512,9 +2453,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); } } -/*-----------------05.03.98 14:52------------------- ---------------------------------------------------*/ BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -2530,9 +2469,7 @@ BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 14:52------------------- ---------------------------------------------------*/ BOOL SwRefPageGetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -2648,9 +2585,6 @@ void SwJumpEditField::SetPar2(const String& rStr) sHelp = rStr; } -/*-----------------05.03.98 15:00------------------- - ---------------------------------------------------*/ BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -2682,9 +2616,7 @@ BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return sal_True; } -/*-----------------05.03.98 15:00------------------- ---------------------------------------------------*/ BOOL SwJumpEditField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 25b0cf932e83..d8f54e6c9242 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -63,6 +63,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::text; @@ -276,10 +277,10 @@ SwFieldType* SwGetExpFieldType::Copy() const return new SwGetExpFieldType(GetDoc()); } -void SwGetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* pNew ) +void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew ) { if( pNew && RES_DOCPOS_UPDATE == pNew->Which() ) - SwModify::Modify( 0, pNew ); + NotifyClients( 0, pNew ); // sonst nichts weiter expandieren } @@ -420,9 +421,6 @@ void SwGetExpField::SetLanguage(USHORT nLng) SwValueField::SetLanguage(nLng); } -/*-----------------07.03.98 16:08------------------- - ---------------------------------------------------*/ BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -459,9 +457,7 @@ BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/*-----------------07.03.98 16:08------------------- ---------------------------------------------------*/ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { sal_Int32 nTmp = 0; @@ -502,10 +498,6 @@ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId ) return TRUE; } -/*-----------------JP: 17.06.93 ------------------- - Set-Expression-Type - --------------------------------------------------*/ - SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, USHORT nTyp ) : SwValueFieldType( pDc, RES_SETEXPFLD ), sName( rName ), @@ -533,16 +525,15 @@ const String& SwSetExpFieldType::GetName() const return sName; } -void SwSetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* ) +void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* ) { return; // nicht weiter expandieren } void SwSetExpFieldType::SetSeqFormat(ULONG nFmt) { - SwClientIter aIter(*this); - for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFld; pFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter(*this); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) pFld->GetFld()->ChangeFormat( nFmt ); } @@ -567,10 +558,9 @@ extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 ); // dann testmal, ob die Nummer schon vergeben ist oder ob eine neue // bestimmt werden muss. - SwClientIter aIter( *this ); + SwIterator aIter( *this ); const SwTxtNode* pNd; - for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF; - pF = (SwFmtFld*)aIter.Next() ) + for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) if( pF->GetFld() != &rFld && pF->GetTxtFld() && 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && pNd->GetNodes().IsDocNodes() ) @@ -605,10 +595,9 @@ USHORT SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList ) if( rList.Count() ) rList.Remove( 0, rList.Count() ); - SwClientIter aIter( *this ); + SwIterator aIter( *this ); const SwTxtNode* pNd; - for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF; - pF = (SwFmtFld*)aIter.Next() ) + for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) if( pF->GetTxtFld() && 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && pNd->GetNodes().IsDocNodes() ) @@ -652,9 +641,6 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd ) } } -/* -----------------24.03.99 09:44------------------- - * - * --------------------------------------------------*/ BOOL SwSetExpFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -911,7 +897,7 @@ void SwGetExpField::SetValue( const double& rAny ) sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny, GetFormat(), GetLanguage()); } -/* -----------------14.07.99 12:21------------------- +/* ------------------------------------------------- Description: Find the index of the reference text following the current field --------------------------------------------------*/ @@ -1066,9 +1052,6 @@ String SwInputField::Expand() const return sRet; } -/*-----------------06.03.98 11:12------------------- - ---------------------------------------------------*/ BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -1090,9 +1073,7 @@ BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/*-----------------06.03.98 11:12------------------- ---------------------------------------------------*/ BOOL SwInputField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { switch( nWhichId ) @@ -1176,9 +1157,7 @@ void SwInputField::SetSubType(USHORT nSub) { nSubType = nSub; } -/*-----------------05.03.98 17:22------------------- ---------------------------------------------------*/ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -1243,9 +1222,7 @@ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/*-----------------05.03.98 17:22------------------- ---------------------------------------------------*/ BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { sal_Int32 nTmp32 = 0; diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx index abf688cbbf5f..2d55cdf70fa4 100644 --- a/sw/source/core/fields/fldlst.cxx +++ b/sw/source/core/fields/fldlst.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include "switerator.hxx" #include "editsh.hxx" #include "doc.hxx" #include @@ -63,10 +63,8 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, BOOL bBuildTmpLst ) if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType ) { - SwClientIter aIter( *pFldType ); - for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFld; pFld = (SwFmtFld*)aIter.Next() ) - + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { const SwTxtFld* pTxtFld = pFld->GetTxtFld(); @@ -161,9 +159,8 @@ USHORT SwInputFieldList::BuildSortLst() if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType ) { - SwClientIter aIter( *pFldType ); - for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFld; pFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { const SwTxtFld* pTxtFld = pFld->GetTxtFld(); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 1d76dce43117..57c9a09ada24 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -47,7 +47,7 @@ #include #include #include - +#include namespace { @@ -93,9 +93,8 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLa SwCntntNode* pNode = rPos.nNode.GetNode().GetCntntNode(); // getfirstcontentnode // getnext... if( !pNode ) return aRet; - SwClientIter aIter( *pNode ); - SwTxtFrm *pTxtFrm; - for( pTxtFrm = (SwTxtFrm*)aIter.First( TYPE( SwTxtFrm )); pTxtFrm; pTxtFrm = (SwTxtFrm*)aIter.Next() ) + SwIterator aIter( *pNode ); + for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() ) { if( !pTxtFrm->IsFollow() ) { diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 4ca163c25dcb..f116bfd252c2 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -57,25 +57,18 @@ #include #include #include -// --> OD 2007-10-18 #i81002# #include -// <-- #include #include -#ifndef _UNOFLDMID_H #include -#endif #include #include #include -#ifndef _POOLFMT_HRC #include -#endif -#ifndef _COMCORE_HRC #include -#endif #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::text; @@ -586,9 +579,6 @@ String SwGetRefField::GetPar2() const return Expand(); } -/*-----------------06.03.98 13:34------------------- - ---------------------------------------------------*/ BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { switch( nWhichId ) @@ -660,9 +650,7 @@ BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return TRUE; } -/*-----------------06.03.98 13:34------------------- ---------------------------------------------------*/ BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { String sTmp; @@ -737,9 +725,7 @@ BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId ) } return TRUE; } -/* -----------------------------11.01.2002 12:50------------------------------ - ---------------------------------------------------------------------------*/ void SwGetRefField::ConvertProgrammaticToUIName() { if(GetTyp() && REF_SEQUENCEFLD == nSubType) @@ -771,10 +757,6 @@ void SwGetRefField::ConvertProgrammaticToUIName() } } } -/*-----------------JP: 18.06.93 ------------------- - Get-Referenz-Type - --------------------------------------------------*/ - SwGetRefFieldType::SwGetRefFieldType( SwDoc* pDc ) : SwFieldType( RES_GETREFFLD ), pDoc( pDc ) @@ -787,14 +769,13 @@ SwFieldType* SwGetRefFieldType::Copy() const } -void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { // Update auf alle GetReferenz-Felder if( !pNew && !pOld ) { - SwClientIter aIter( *this ); - for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFld; pFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *this ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { // nur die GetRef-Felder Updaten //JP 3.4.2001: Task 71231 - we need the correct language @@ -814,7 +795,7 @@ void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) } } // weiter an die Text-Felder, diese "Expandieren" den Text - SwModify::Modify( pOld, pNew ); + NotifyClients( pOld, pNew ); } SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark, @@ -845,9 +826,8 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark, if( pFldType && pFldType->GetDepends() && nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)pFldType)->GetType() ) { - SwClientIter aIter( *pFldType ); - for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFld; pFld = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pFldType ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { if( pFld->GetTxtFld() && nSeqNo == ((SwSetExpField*)pFld->GetFld())->GetSeqNumber() ) @@ -958,22 +938,20 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, if( bField ) { const SwTxtNode* pNd; - SwModify* pMod; - if( 0 != ( pMod = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) )) + SwFieldType* pType; + if( 0 != ( pType = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) )) { - SwClientIter aIter( *pMod ); - for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF; - pF = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pType ); + for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) if( pF->GetTxtFld() && 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && pNd->GetNodes().IsDocNodes() ) aIds.Insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() ); } - if( 0 != ( pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) )) + if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) )) { - SwClientIter aIter( *pMod ); - for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF; - pF = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pType ); + for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) if( pF->GetTxtFld() && 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && pNd->GetNodes().IsDocNodes() ) @@ -1019,12 +997,11 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, // Id umsetzen if( bField ) { - SwModify* pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false ); - if( pMod ) + SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ); + if( pType ) { - SwClientIter aIter( *pMod ); - for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF; - pF = (SwFmtFld*)aIter.Next() ) + SwIterator aIter( *pType ); + for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) if( pF->GetTxtFld() && nSeqNo == ((SwSetExpField*)pF->GetFld())->GetSeqNumber() ) ((SwSetExpField*)pF->GetFld())->SetSeqNumber( n ); @@ -1062,11 +1039,10 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc ) _RefIdsMap aFntMap( aEmptyStr ); _RefIdsMaps aFldMap; - SwClientIter aIter( *this ); - for( SwClient* pFld = aIter.First( TYPE( SwFmtFld )); - pFld; pFld = aIter.Next() ) + SwIterator aIter( *this ); + for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) { - SwGetRefField& rRefFld = *(SwGetRefField*)((SwFmtFld*)pFld)->GetFld(); + SwGetRefField& rRefFld = *(SwGetRefField*)pFld->GetFld(); switch( rRefFld.GetSubType() ) { case REF_SEQUENCEFLD: diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index ae340b9a7ba5..04daffde2412 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include #include #include #include // fuer GetBodyTxtNode @@ -37,9 +37,7 @@ #include #include #include // fuer _SetGetExpFld -#ifndef _UNOFLDMID_H #include -#endif using namespace ::com::sun::star; using ::rtl::OUString; @@ -115,15 +113,10 @@ const SwNode* SwTblField::GetNodeOfFormula() const if( !GetTyp()->GetDepends() ) return 0; - SwClientIter aIter( *GetTyp() ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do { - const SwFmtFld* pFmtFld = (SwFmtFld*)pLast; + SwIterator aIter( *GetTyp() ); + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) if( this == pFmtFld->GetFld() ) return (SwTxtNode*)&pFmtFld->GetTxtFld()->GetTxtNode(); - - } while( 0 != ( pLast = aIter++ )); return 0; } @@ -191,9 +184,6 @@ void SwTblField::SetPar2(const String& rStr) } -/*-----------------04.03.98 10:33------------------- - ---------------------------------------------------*/ BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const { BOOL bRet = TRUE; @@ -225,9 +215,7 @@ BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const } return bRet; } -/*-----------------04.03.98 10:33------------------- ---------------------------------------------------*/ BOOL SwTblField::PutValue( const uno::Any& rAny, USHORT nWhichId ) { BOOL bRet = TRUE; diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index f9437cd0fbd5..004d14d23ce0 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -235,12 +235,12 @@ const String& SwUserFieldType::GetName() const return aName; } -void SwUserFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !pOld && !pNew ) ChgValid( sal_False ); - SwModify::Modify( pOld, pNew ); + NotifyClients( pOld, pNew ); // und ggfs. am UserFeld haengende InputFelder updaten! GetDoc()->GetSysFldType( RES_INPUTFLD )->UpdateFlds(); } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 844d2b569547..5feae7816aa7 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -47,10 +47,7 @@ #include #include #include - -#ifndef _POOLFMT_HRC #include // fuer InitFldTypes -#endif #include #include #include @@ -84,12 +81,10 @@ #include "txtfrm.hxx" #include "txatbase.hxx" #include "mdiexp.hxx" // fuer Update der Statuszeile bei drag -// OD 2004-05-24 #i28701# #include -// --> OD 2006-03-06 #125892# #include -// <-- #include +#include #define SCROLLVAL 75 @@ -141,10 +136,6 @@ extern BOOL bNoInterrupt; // in swapp.cxx /************************************************************************* |* |* SwFEShell::SelectObj() -|* -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung MA 22. Oct. 96 -|* *************************************************************************/ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj ) @@ -267,9 +258,6 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj ) |* |* sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) |* -|* Created AMA 05/28/2002 -|* Last modify AMA 05/30/2002 -|* |* Description: MoveAnchor( nDir ) looked for an another Anchor for |* the selected drawing object (or fly frame) in the given direction. |* An object "as character" doesn't moves anyway. @@ -541,9 +529,6 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) |* |* SwFEShell::GetSelFrmType() |* -|* Ersterstellung MA 12. Jan. 93 -|* Letzte Aenderung JP 19.03.96 -|* *************************************************************************/ const SdrMarkList* SwFEShell::_GetMarkList() const @@ -608,9 +593,6 @@ bool SwFEShell::IsSelContainsControl() const |* |* SwFEShell::Scroll() |* -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 27. Jul. 95 -|* *************************************************************************/ void SwFEShell::ScrollTo( const Point &rPt ) @@ -629,9 +611,6 @@ void SwFEShell::ScrollTo( const Point &rPt ) |* |* SwFEShell::SetDragMode() |* -|* Ersterstellung MA 30. Jan. 95 -|* Letzte Aenderung MA 30. Jan. 95 -|* *************************************************************************/ void SwFEShell::SetDragMode( UINT16 eDragMode ) @@ -644,9 +623,6 @@ void SwFEShell::SetDragMode( UINT16 eDragMode ) |* |* SwFEShell::BeginDrag() |* -|* Ersterstellung MS 10.06.92 -|* Letzte Aenderung MA 13. Mar. 96 -|* *************************************************************************/ long SwFEShell::BeginDrag( const Point* pPt, BOOL ) @@ -666,9 +642,6 @@ long SwFEShell::BeginDrag( const Point* pPt, BOOL ) |* |* SwFEShell::Drag() |* -|* Ersterstellung MS 10.06.92 -|* Letzte Aenderung MA 13. Mar. 96 -|* *************************************************************************/ long SwFEShell::Drag( const Point *pPt, BOOL ) @@ -689,9 +662,6 @@ long SwFEShell::Drag( const Point *pPt, BOOL ) |* |* SwFEShell::EndDrag() |* -|* Ersterstellung MS 10.06.92 -|* Letzte Aenderung MA 13. Mar. 96 -|* *************************************************************************/ long SwFEShell::EndDrag( const Point *, BOOL ) @@ -718,7 +688,7 @@ long SwFEShell::EndDrag( const Point *, BOOL ) //pView->ShowShownXor( GetOut() ); pView->EndDragObj(); - // JP 18.08.95: DrawUndo-Action auf FlyFrames werden nicht gespeichert + // DrawUndo-Action auf FlyFrames werden nicht gespeichert // Die Fly aendern das Flag GetDoc()->SetNoDrawUndoObj( FALSE ); ChgAnchor( 0, TRUE ); @@ -742,9 +712,6 @@ long SwFEShell::EndDrag( const Point *, BOOL ) |* |* SwFEShell::BreakDrag() |* -|* Ersterstellung OM 02. Okt. 95 -|* Letzte Aenderung OM 02. Okt. 95 -|* *************************************************************************/ void SwFEShell::BreakDrag() @@ -761,9 +728,6 @@ void SwFEShell::BreakDrag() |* |* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in |* den ersten CntntFrm -|* Ersterstellung MA 11. Dec. 92 -|* Letzte Aenderung MA 07. Oct. 96 -|* *************************************************************************/ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr() @@ -775,8 +739,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr() if( pFly ) { - // --> OD 2004-06-11 #i28701# - no format here -// pFly->GetAnchorFrm()->Calc(); SwCntntFrm *pCFrm = pFly->ContainsCntnt(); if ( pCFrm ) { @@ -809,9 +771,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr() |* |* Beschreibung Selektion nach oben/unten (Z-Order) |* -|* Ersterstellung MA 05. Nov. 92 -|* Letzte Aenderung MA 03. Jun. 96 -|* *************************************************************************/ void lcl_NotifyNeighbours( const SdrMarkList *pLst ) @@ -941,9 +900,6 @@ void SwFEShell::SelectionToBottom( BOOL bBottom ) |* |* Beschreibung Objekt ueber/unter dem Dokument? |* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 20. Dec. 94 -|* *************************************************************************/ short SwFEShell::GetLayerId() const @@ -976,8 +932,6 @@ short SwFEShell::GetLayerId() const |* SwFEShell::SelectionToHeaven(), SelectionToHell() |* |* Beschreibung Objekt ueber/unter dem Dokument -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung AMA 04. Jun. 98 |* *************************************************************************/ // OD 25.06.2003 #108784# @@ -1037,9 +991,6 @@ void SwFEShell::SelectionToHell() |* |* SwFEShell::IsObjSelected(), IsFrmSelected() |* -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung MA 17. Jan. 95 -|* *************************************************************************/ USHORT SwFEShell::IsObjSelected() const @@ -1072,9 +1023,6 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const |* |* SwFEShell::EndTextEdit() |* -|* Ersterstellung MA 19. Feb. 96 -|* Letzte Aenderung MA 19. Feb. 96 -|* *************************************************************************/ void SwFEShell::EndTextEdit() @@ -1133,9 +1081,6 @@ void SwFEShell::EndTextEdit() |* |* SwFEShell::IsInsideSelectedObj() |* -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung MA 08. Nov. 96 -|* *************************************************************************/ int SwFEShell::IsInsideSelectedObj( const Point &rPt ) @@ -1157,9 +1102,6 @@ int SwFEShell::IsInsideSelectedObj( const Point &rPt ) |* |* SwFEShell::IsObjSelectable() |* -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung MA 02. Feb. 95 -|* *************************************************************************/ bool SwFEShell::IsObjSelectable( const Point& rPt ) @@ -1291,11 +1233,9 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) |* |* Beschreibung Wenn ein Obj selektiert ist, gehen wir von dessen |* TopLeft aus, andernfalls von der Mitte des aktuellen CharRects. -|* Ersterstellung MA 01. Jun. 95 -|* Letzte Aenderung MA 30. Apr. 96 |* *************************************************************************/ -/* -----------------23.09.98 10:29------------------- +/* ------------------------------------ * Beinhaltet das Objekt ein Control oder Gruppen, * die nur aus Controls bestehen * --------------------------------------------------*/ @@ -1540,9 +1480,6 @@ BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType ) |* |* SwFEShell::BeginCreate() |* -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 21. Mar. 95 -|* *************************************************************************/ BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos ) @@ -1591,9 +1528,6 @@ BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, UINT32 eOb |* |* SwFEShell::MoveCreate() |* -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 24. Jan. 95 -|* *************************************************************************/ void SwFEShell::MoveCreate( const Point &rPos ) @@ -1611,14 +1545,11 @@ void SwFEShell::MoveCreate( const Point &rPos ) |* |* SwFEShell::EndCreate(), ImpEndCreate() |* -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 14. Oct. 96 -|* *************************************************************************/ BOOL SwFEShell::EndCreate( UINT16 eSdrCreateCmd ) { - // JP 18.08.95: Damit das Undo-Object aus der DrawEngine nicht bei uns + // Damit das Undo-Object aus der DrawEngine nicht bei uns // gespeichert wird, (wir erzeugen ein eigenes Undo-Object!) hier kurz // das Undo abschalten ASSERT( Imp()->HasDrawView(), "EndCreate without DrawView?" ); @@ -1652,7 +1583,7 @@ BOOL SwFEShell::ImpEndCreate() if( rSdrObj.GetSnapRect().IsEmpty() ) { - //JP 10.04.95: das Object vergessen wir lieber, fuerht nur + // das Object vergessen wir lieber, fuerht nur // zu Problemen Imp()->GetDrawView()->DeleteMarked(); Imp()->GetDrawView()->UnmarkAll(); @@ -1696,7 +1627,7 @@ BOOL SwFEShell::ImpEndCreate() Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 ); GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080317 - //JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt + //Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt if( !aPos.nNode.GetNode().IsProtect() ) { pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, &aPos ); @@ -1741,7 +1672,7 @@ BOOL SwFEShell::ImpEndCreate() SwPosition aPos( GetDoc()->GetNodes() ); GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); - //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen + //nicht in ReadnOnly-Inhalt setzen if( aPos.nNode.GetNode().IsProtect() ) // dann darf er nur seitengebunden sein. Oder sollte man // die naechste nicht READONLY Position suchen? @@ -1780,7 +1711,7 @@ BOOL SwFEShell::ImpEndCreate() pAnch = ::FindAnchor( pPage, aPt, bBodyOnly ); aPos.nNode = *((SwCntntFrm*)pAnch)->GetNode(); - //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen + //nicht in ReadnOnly-Inhalt setzen if( aPos.nNode.GetNode().IsProtect() ) // dann darf er nur seitengebunden sein. Oder sollte man // die naechste nicht READONLY Position suchen? @@ -1989,9 +1920,6 @@ BOOL SwFEShell::ImpEndCreate() |* |* SwFEShell::BreakCreate() |* -|* Ersterstellung MA 20. Dec. 94 -|* Letzte Aenderung MA 09. Jan. 95 -|* *************************************************************************/ void SwFEShell::BreakCreate() @@ -2005,9 +1933,6 @@ void SwFEShell::BreakCreate() |* |* SwFEShell::IsDrawCreate() |* -|* Ersterstellung OM 16. Mar. 95 -|* Letzte Aenderung OM 16. Mar. 95 -|* *************************************************************************/ BOOL SwFEShell::IsDrawCreate() const @@ -2019,9 +1944,6 @@ BOOL SwFEShell::IsDrawCreate() const |* |* SwFEShell::BeginMark() |* -|* Ersterstellung OM 07. Feb. 95 -|* Letzte Aenderung OM 07. Feb. 95 -|* *************************************************************************/ BOOL SwFEShell::BeginMark( const Point &rPos ) @@ -2046,9 +1968,6 @@ BOOL SwFEShell::BeginMark( const Point &rPos ) |* |* SwFEShell::MoveMark() |* -|* Ersterstellung OM 07. Feb. 95 -|* Letzte Aenderung OM 07. Feb. 95 -|* *************************************************************************/ void SwFEShell::MoveMark( const Point &rPos ) @@ -2074,9 +1993,6 @@ void SwFEShell::MoveMark( const Point &rPos ) |* |* SwFEShell::EndMark() |* -|* Ersterstellung OM 07. Feb. 95 -|* Letzte Aenderung MA 08. Feb. 95 -|* *************************************************************************/ BOOL SwFEShell::EndMark() @@ -2142,9 +2058,6 @@ BOOL SwFEShell::EndMark() |* |* SwFEShell::BreakSelect() |* -|* Ersterstellung OM 07. Feb. 95 -|* Letzte Aenderung OM 07. Feb. 95 -|* *************************************************************************/ void SwFEShell::BreakMark() @@ -2157,9 +2070,6 @@ void SwFEShell::BreakMark() |* |* SwFEShell::GetAnchorId() |* -|* Ersterstellung MA 30. Jan. 95 -|* Letzte Aenderung MA 30. Jan. 95 -|* *************************************************************************/ short SwFEShell::GetAnchorId() const @@ -2196,9 +2106,6 @@ short SwFEShell::GetAnchorId() const |* |* SwFEShell::ChgAnchor() |* -|* Ersterstellung MA 10. Jan. 95 -|* Letzte Aenderung MA 30. May. 96 -|* *************************************************************************/ void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr ) @@ -2223,9 +2130,6 @@ void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr ) |* |* SwFEShell::DelSelectedObj() |* -|* Ersterstellung MA 03. Nov. 92 -|* Letzte Aenderung MA 14. Nov. 95 -|* *************************************************************************/ void SwFEShell::DelSelectedObj() @@ -2246,8 +2150,6 @@ void SwFEShell::DelSelectedObj() |* |* Beschreibung Fuer die Statuszeile zum Erfragen der aktuellen |* Verhaeltnisse -|* Ersterstellung MA 25. Apr. 95 -|* Letzte Aenderung MA 25. Apr. 95 |* *************************************************************************/ @@ -2305,9 +2207,6 @@ Point SwFEShell::GetObjAbsPos() const |* |* SwFEShell::IsGroupSelected() |* -|* Ersterstellung MA 30. Jan. 95 -|* Letzte Aenderung MA 30. May. 96 -|* *************************************************************************/ BOOL SwFEShell::IsGroupSelected() @@ -2418,8 +2317,6 @@ bool SwFEShell::IsGroupAllowed() const |* |* Beschreibung Die Gruppe bekommt den Anker und das Contactobjekt |* des ersten in der Selektion -|* Ersterstellung MA 30. Jan. 95 -|* Letzte Aenderung MA 23. Apr. 95 |* *************************************************************************/ @@ -2443,8 +2340,6 @@ void SwFEShell::GroupSelection() |* |* Beschreibung Die Einzelobjekte bekommen eine Kopie vom Anker und |* Contactobjekt der Gruppe. -|* Ersterstellung MA 30. Jan. 95 -|* Letzte Aenderung MA 01. Feb. 95 |* *************************************************************************/ @@ -2466,9 +2361,6 @@ void SwFEShell::UnGroupSelection() |* |* SwFEShell::MirrorSelection() |* -|* Ersterstellung MA 06. Aug. 95 -|* Letzte Aenderung MA 06. Aug. 95 -|* *************************************************************************/ void SwFEShell::MirrorSelection( BOOL bHorizontal ) @@ -2500,14 +2392,12 @@ static BYTE __READONLY_DATA aChkArr[ 4 ] = { { SET_CURR_SHELL( this ); - SwClientIter aIter( *(SwModify*)pFlyFmt ); - SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm )); + SwFlyFrm* pFrm = SwIterator::FirstElement( *pFlyFmt ); if( pFrm ) { - ASSERT( pFrm->IsFlyFrm(), "Wrong FrmType" ); if( bSelFrm ) { - SelectObj( pFrm->Frm().Pos(), 0, ((SwFlyFrm*)pFrm)->GetVirtDrawObj() ); + SelectObj( pFrm->Frm().Pos(), 0, pFrm->GetVirtDrawObj() ); if( !ActionPend() ) MakeVisible( pFrm->Frm() ); } @@ -2800,9 +2690,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource, } return SW_CHAIN_NOT_FOUND; } -/* -----------------------------09.08.2002 07:40------------------------------ - ---------------------------------------------------------------------------*/ int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest ) { return GetDoc()->Chain(rSource, rDest); @@ -2911,30 +2799,20 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const do { // Ist es der Gewuenschte? - if( pSect->GetRegisteredIn() == &rFmt ) + if( pSect->KnowsFormat( rFmt ) ) return pSect->Frm().Width(); // fuer geschachtelte Bereiche pSect = pSect->GetUpper()->FindSctFrm(); } while( pSect ); } - SwClientIter aIter( rFmt ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm* pSct = (SwSectionFrm*)pLast; + SwIterator aIter( rFmt ); + for ( SwSectionFrm* pSct = aIter.First(); pFrm; pFrm = aIter.Next() ) if( !pSct->IsFollow() ) return pSct->Frm().Width(); - } - pLast = aIter++; - } return 0; } -/* -----------------------------2002/06/24 15:07------------------------------ - ---------------------------------------------------------------------------*/ void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, USHORT nSlotId) { @@ -3221,9 +3099,7 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const return bRet; } -/* -----------------20.03.2003 14:35----------------- - --------------------------------------------------*/ Point SwFEShell::GetRelativePagePosition(const Point& rDocPos) { Point aRet(-1, -1); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 9f48c725dc4b..dd0de07fc125 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -52,9 +52,9 @@ #include #include #include -// OD 26.08.2003 #i18103# #include #include +#include //siehe auch swtable.cxx #define COLFUZZY 20L @@ -1607,31 +1607,6 @@ SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish, return nRet; } -/* MA: 20. Sep. 93 wird nicht mehr gebraucht. -static const SwLayoutFrm *GetPrevCell( const SwLayoutFrm *pCell ) -{ - const SwLayoutFrm *pLay = pCell->GetPrevLayoutLeaf(); - if ( pLay && pLay->IsLayoutFrm() && !pLay->IsTab() ) - { - //GetPrevLayoutLeaf() liefert ggf. auch die Umgebung einer Tab zurueck - //(naehmlich genau dann, wenn die Zelle noch Vorgaenger hat). - const SwFrm *pFrm = pLay->Lower(); - while ( pFrm->GetNext() ) - pFrm = pFrm->GetNext(); - pLay = pFrm->IsTabFrm() ? (SwLayoutFrm*)pFrm : 0; - } - if ( pLay && pLay->IsTabFrm() ) - { - //GetPrevLayoutLeaf() liefert ggf. auch Tabellen zurueck die letzte - //Zelle dieser Tabelle ist das das gesuchte Blatt. - pLay = ((SwTabFrm*)pLay)->FindLastCntnt()->GetUpper(); - while ( !pLay->IsCellFrm() ) - pLay = pLay->GetUpper(); - } - return pLay; -} -*/ - void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart, const SwLayoutFrm *&rpEnd, const int bChkProtected ) @@ -2309,14 +2284,10 @@ void _FndBox::DelFrms( SwTable &rTable ) for ( USHORT i = nStPos; i <= nEndPos; ++i) { SwFrmFmt *pFmt = rTable.GetTabLines()[i]->GetFrmFmt(); - SwClientIter aIter( *pFmt ); - SwClient* pLast = aIter.GoStart(); - if( pLast ) + SwIterator aIter( *pFmt ); + for ( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { - do { - SwFrm *pFrm = PTR_CAST( SwFrm, pLast ); - if ( pFrm && - ((SwRowFrm*)pFrm)->GetTabLine() == rTable.GetTabLines()[i] ) + if ( pFrm->GetTabLine() == rTable.GetTabLines()[i] ) { BOOL bDel = TRUE; SwTabFrm *pUp = !pFrm->GetPrev() && !pFrm->GetNext() ? @@ -2404,7 +2375,6 @@ void _FndBox::DelFrms( SwTable &rTable ) delete pFrm; } } - } while( 0 != ( pLast = aIter++ )); } } } @@ -2472,13 +2442,12 @@ void _FndBox::MakeFrms( SwTable &rTable ) --nEndPos; } //Jetzt die grosse Einfuegeoperation fuer alle Tabllen. - SwClientIter aTabIter( *rTable.GetFrmFmt() ); - for ( SwTabFrm *pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable; - pTable = (SwTabFrm*)aTabIter.Next() ) + SwIterator aTabIter( *rTable.GetFrmFmt() ); + for ( SwTabFrm *pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() ) { if ( !pTable->IsFollow() ) { - SwFrm *pSibling = 0; + SwRowFrm *pSibling = 0; SwFrm *pUpperFrm = 0; int i; for ( i = rTable.GetTabLines().Count()-1; @@ -2486,19 +2455,19 @@ void _FndBox::MakeFrms( SwTable &rTable ) { SwTableLine *pLine = pLineBehind ? pLineBehind : rTable.GetTabLines()[static_cast(i)]; - SwClientIter aIter( *pLine->GetFrmFmt() ); - pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) ); + SwIterator aIter( *pLine->GetFrmFmt() ); + pSibling = aIter.First(); while ( pSibling && ( - static_cast(pSibling)->GetTabLine() != pLine || + pSibling->GetTabLine() != pLine || !lcl_IsLineOfTblFrm( *pTable, *pSibling ) || - static_cast(pSibling)->IsRepeatedHeadline() || + pSibling->IsRepeatedHeadline() || // --> FME 2005-08-24 #i53647# If !pLineBehind, // IsInSplitTableRow() should be checked. ( pLineBehind && pSibling->IsInFollowFlowRow() ) || (!pLineBehind && pSibling->IsInSplitTableRow() ) ) ) // <-- { - pSibling = (SwFrm*)aIter.Next(); + pSibling = aIter.Next(); } } if ( pSibling ) @@ -2546,32 +2515,31 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber, (nBfPos != USHRT_MAX ? nBfPos + 1 : 0)) / (nNumber + 1); //Den Master-TabFrm suchen - SwClientIter aTabIter( *rTable.GetFrmFmt() ); + SwIterator aTabIter( *rTable.GetFrmFmt() ); SwTabFrm *pTable; - for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable; - pTable = (SwTabFrm*)aTabIter.Next() ) + for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() ) { if( !pTable->IsFollow() ) { - SwFrm *pSibling = 0; + SwRowFrm* pSibling = 0; SwLayoutFrm *pUpperFrm = 0; if ( bBehind ) { if ( pLineBehind ) { - SwClientIter aIter( *pLineBehind->GetFrmFmt() ); - pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) ); + SwIterator aIter( *pLineBehind->GetFrmFmt() ); + pSibling = aIter.First(); while ( pSibling && ( // only consider row frames associated with pLineBehind: - static_cast(pSibling)->GetTabLine() != pLineBehind || + pSibling->GetTabLine() != pLineBehind || // only consider row frames that are in pTables Master-Follow chain: !lcl_IsLineOfTblFrm( *pTable, *pSibling ) || // only consider row frames that are not repeated headlines: - static_cast(pSibling)->IsRepeatedHeadline() || + pSibling->IsRepeatedHeadline() || // only consider row frames that are not follow flow rows pSibling->IsInFollowFlowRow() ) ) { - pSibling = (SwFrm*)aIter.Next(); + pSibling = aIter.Next(); } } if ( pSibling ) @@ -2602,16 +2570,16 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber, { SwTableLine* pLine = pLineBefore ? pLineBefore : rTable.GetTabLines()[i]; - SwClientIter aIter( *pLine->GetFrmFmt() ); - pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) ); + SwIterator aIter( *pLine->GetFrmFmt() ); + pSibling = aIter.First(); while ( pSibling && ( // only consider row frames associated with pLineBefore: - static_cast(pSibling)->GetTabLine() != pLine || + pSibling->GetTabLine() != pLine || // only consider row frames that are in pTables Master-Follow chain: !lcl_IsLineOfTblFrm( *pTable, *pSibling ) || // only consider row frames that are not repeated headlines: - static_cast(pSibling)->IsRepeatedHeadline() || + pSibling->IsRepeatedHeadline() || // 1. case: pLineBefore == 0: // only consider row frames that are not follow flow rows // 2. case: pLineBefore != 0: @@ -2622,13 +2590,13 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber, ( pLineBefore && pSibling->IsInSplitTableRow() ) ) ) ) // <-- { - pSibling = (SwFrm*)aIter.Next(); + pSibling = aIter.Next(); } } pUpperFrm = pSibling->GetUpper(); if ( pLineBefore ) - pSibling = pSibling->GetNext(); + pSibling = (SwRowFrm*) pSibling->GetNext(); USHORT nMax = nBhPos != USHRT_MAX ? nBhPos - nCnt : @@ -2651,8 +2619,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber, ( ( !bBehind && ( nBfPos == USHRT_MAX || nBfPos + 1 < nRowsToRepeat ) ) || ( bBehind && ( ( nBfPos == USHRT_MAX && nRowsToRepeat > 1 ) || nBfPos + 2 < nRowsToRepeat ) ) ) ) { - for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable; - pTable = (SwTabFrm*)aTabIter.Next() ) + for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() ) { if ( pTable->Lower() ) { @@ -2703,9 +2670,8 @@ BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const { // ups. sollte unsere zu wiederholende Kopfzeile geloescht worden // sein?? - SwClientIter aIter( *rTable.GetFrmFmt() ); - for( SwTabFrm* pTable = (SwTabFrm*)aIter.First( TYPE( SwFrm )); - pTable; pTable = (SwTabFrm*)aIter.Next() ) + SwIterator aIter( *rTable.GetFrmFmt() ); + for( SwTabFrm* pTable = aIter.First(); pTable; pTable = aIter.Next() ) { if( pTable->IsFollow() ) { diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 772f776d92c2..0f6c29015dfc 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -216,7 +216,7 @@ BOOL SwGrfNode::ReRead( if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) ) { SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE ); - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); } // --> OD 2006-11-03 #i59688# // do not load linked graphic, if it isn't a new linked graphic. @@ -310,7 +310,7 @@ BOOL SwGrfNode::ReRead( if( bReadGrf && bNewGrf ) { SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR ); - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); } return bReadGrf; @@ -438,7 +438,7 @@ short SwGrfNode::SwapIn( BOOL bWaitForData ) // keine default Bitmap mehr, also neu Painten! aGrfObj.SetGraphic( Graphic() ); SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); } } else if( aGrfObj.IsSwappedOut() ) { @@ -488,7 +488,7 @@ short SwGrfNode::SwapIn( BOOL bWaitForData ) if( 1 == nRet ) { SwMsgPoolItem aMsg( RES_GRAPHIC_SWAPIN ); - Modify( &aMsg, &aMsg ); + ModifyNotification( &aMsg, &aMsg ); } } else @@ -1176,7 +1176,7 @@ void SwGrfNode::ApplyInputStream( mbIsStreamReadOnly = bIsStreamReadOnly; mbLinkedInputStreamReady = true; SwMsgPoolItem aMsgHint( RES_LINKED_GRAPHIC_STREAM_ARRIVED ); - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); } } } @@ -1188,7 +1188,7 @@ void SwGrfNode::UpdateLinkWithInputStream() GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly ); GetLink()->Update(); SwMsgPoolItem aMsgHint( RES_GRAPHIC_ARRIVED ); - Modify( &aMsgHint, &aMsgHint ); + ModifyNotification( &aMsgHint, &aMsgHint ); // --> OD 2008-06-18 #i88291# mxInputStream.clear(); diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index 90c6a44fa239..e51ae5139881 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -104,9 +104,6 @@ namespace sw { namespace mark virtual ~MarkBase(); - // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - const ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XTextContent> & GetXBookmark() const { return m_wXBookmark; } @@ -115,6 +112,9 @@ namespace sw { namespace mark { m_wXBookmark = xBkmk; } protected: + // SwClient + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + MarkBase(const SwPaM& rPaM, const ::rtl::OUString& rName); ::boost::scoped_ptr m_pPos1; diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index 2f2b81e6ebe9..832126a710ee 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -41,13 +41,13 @@ class SwCellFrm: public SwLayoutFrm protected: virtual void Format( const SwBorderAttrs *pAttrs = 0 ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true ); ~SwCellFrm(); virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index 5050c5172606..cb8d7baf386c 100644 --- a/sw/source/core/inc/cntfrm.hxx +++ b/sw/source/core/inc/cntfrm.hxx @@ -53,7 +53,7 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm // <-- virtual void MakeAll(); - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &, + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL& ); @@ -64,7 +64,7 @@ protected: BOOL MakePrtArea( const SwBorderAttrs & ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); @@ -108,6 +108,9 @@ public: inline SwCntntFrm* GetNextCntntFrm() const; inline SwCntntFrm* GetPrevCntntFrm() const; + static bool CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, long nBottom, bool bSkipRowSpanCells ); + void RegisterToNode( SwCntntNode& ); + static void DelFrms( const SwCntntNode& ); }; inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index a346fd5a9e2d..3f65b63ad22e 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -28,6 +28,7 @@ #define _FLYFRM_HXX #include "layfrm.hxx" +#include class SwPageFrm; class SwFlyFrmFmt; @@ -38,8 +39,10 @@ class SwVirtFlyDrawObj; class SwSpzFrmFmts; class SwAttrSetChg; class PolyPolygon; +class SwFlyDrawContact; +class SwDrawContact; +class SwFmt; -// OD 2004-03-22 #i26791# #include //Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen. @@ -64,11 +67,14 @@ class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject void InitDrawObj( BOOL bNotify ); //Wird von den CToren gerufen. void FinitDrawObj(); //Wird vom CTor gerufen. - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &, + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); using SwLayoutFrm::CalcRel; + sal_uInt32 _GetOrdNumForNewRef( const SwFlyDrawContact* ); + SwVirtFlyDrawObj* CreateNewRef( SwFlyDrawContact* ); + protected: SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit @@ -141,20 +147,17 @@ protected: */ virtual void RegisterAtCorrectPage(); - // --> OD 2006-08-10 #i68520# virtual bool _SetObjTop( const SwTwips _nTop ); virtual bool _SetObjLeft( const SwTwips _nLeft ); - // <-- - // --> OD 2006-10-05 #i70122# virtual const SwRect GetObjBoundRect() const; - // <-- + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + public: // OD 2004-03-23 #i26791# TYPEINFO(); virtual ~SwFlyFrm(); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; @@ -282,5 +285,6 @@ public: @author OD */ virtual bool IsFormatPossible() const; + static void GetAnchoredObjects( std::list&, const SwFmt& rFmt ); }; #endif diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index a648c1175138..b76aadb871ad 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -132,9 +132,8 @@ public: SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); SwFlyLayFrm( SwFlyLayFrm& ); - - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); }; //Die Flys, die an einem Cntnt haengen nicht aber im Inhalt @@ -154,6 +153,7 @@ protected: @author OD */ virtual void RegisterAtCorrectPage(); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: // --> OD 2004-06-29 #i28701# @@ -161,8 +161,6 @@ public: SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - void SetAbsPos( const Point &rNew ); // OD 2004-03-23 #i26791# @@ -193,6 +191,7 @@ protected: virtual void NotifyBackground( SwPageFrm *pPage, const SwRect& rRect, PrepareHint eHint); virtual void MakeAll(); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: // --> OD 2004-06-29 #i28701# @@ -202,7 +201,6 @@ public: virtual ~SwFlyInCntFrm(); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); void SetRefPoint( const Point& rPoint, const Point &rRelAttr, const Point &rRelPos ); diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 7e34fdd67d2d..4a1e3fef6e79 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -30,6 +30,7 @@ #include "swtypes.hxx" // fuer SwTwips #include "swrect.hxx" #include "calbck.hxx" // fuer SwClient +#include class SwLayoutFrm; class SwRootFrm; @@ -54,11 +55,9 @@ class SwSelectionList; struct SwPosition; struct SwCrsrMoveState; class SwPrtOptions; - -// --> OD 2004-07-06 #i28701# +class SwFmt; class SwSortedObjs; class SwAnchoredObject; -// <-- //Jeder FrmTyp findet sich hier in einem Bit wieder. //Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt @@ -239,7 +238,7 @@ enum MakePageType //typedef SdrObject* SdrObjectPtr; //SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1); -class SwFrm: public SwClient +class SwFrm: public SwClient, public SfxBroadcaster { //Der verkappte Frm friend class SwFlowFrm; @@ -344,7 +343,7 @@ class SwFrm: public SwClient SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false ); - void _UpdateAttrFrm( SfxPoolItem*, SfxPoolItem*, BYTE & ); + void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, BYTE & ); SwFrm* _GetIndNext(); void SetDirFlags( BOOL bVert ); @@ -422,8 +421,8 @@ protected: virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0; virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0; - SwModify *GetDep() { return pRegisteredIn; } - const SwModify *GetDep() const { return pRegisteredIn; } + SwModify *GetDep() { return GetRegisteredInNonConst(); } + const SwModify *GetDep() const { return GetRegisteredIn(); } SwFrm( SwModify*, SwFrm* ); @@ -460,6 +459,7 @@ protected: //Schatten und Umrandung painten void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const; + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: TYPEINFO(); //Bereits in Basisklasse Client drin. @@ -602,7 +602,6 @@ public: //Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines). BOOL IsFtnAllowed() const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); virtual void CheckDirection( BOOL bVert ); @@ -910,6 +909,8 @@ public: // FME 2007-08-30 #i81146# new loop control void ValidateThisAndAllLowers( const USHORT nStage ); + bool KnowsFormat( const SwFmt& rFmt ) const; + void RegisterToFormat( SwFmt& rFmt ); }; inline BOOL SwFrm::IsInDocBody() const diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index dcc24294ca4b..bfc14d2b8185 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -568,7 +568,7 @@ class SwDeletionChecker SwDeletionChecker( const SwFrm* pFrm ) : mpFrm( pFrm ), - mpRegIn( pFrm ? pFrm->GetRegisteredIn() : 0 ) + mpRegIn( pFrm ? const_cast(pFrm)->GetRegisteredIn() : 0 ) { } diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index b2e6f45f6c67..ee4f1483e1d1 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -51,11 +51,11 @@ class SwNoTxtFrm: public SwCntntFrm void PaintPicture( OutputDevice*, const SwRect& ) const; protected: virtual void MakeAll(); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwNoTxtFrm( SwNoTxtNode * const, SwFrm* ); ~SwNoTxtFrm(); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual void Paint(const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0) const; diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 9c0b8af55e95..fc1489c7af3f 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -92,7 +92,7 @@ class SwPageFrm: public SwFtnBossFrm static const sal_Int8 mnBorderPxWidth; static const sal_Int8 mnShadowPxWidth; - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &, + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); // Anpassen der max. Fussnotenhoehen in den einzelnen Spalten @@ -191,6 +191,7 @@ class SwPageFrm: public SwFtnBossFrm protected: virtual void MakeAll(); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm) @@ -251,7 +252,6 @@ public: virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // erfrage vom Client Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx index 18ce78dc41ff..4a8d3607d54b 100644 --- a/sw/source/core/inc/rowfrm.hxx +++ b/sw/source/core/inc/rowfrm.hxx @@ -54,13 +54,13 @@ class SwRowFrm: public SwLayoutFrm protected: virtual void MakeAll(); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwRowFrm( const SwTableLine &, SwFrm*, bool bInsertContent = true ); ~SwRowFrm(); virtual void Cut(); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); //Zum Anmelden der Flys nachdem eine Zeile erzeugt _und_ eingefuegt wurde. //Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index f32d5cdba1e3..0c09ca46612b 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -45,7 +45,7 @@ class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm { SwSection* pSection; - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &, + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); void _Cut( BOOL bRemove ); // Is there a FtnContainer? @@ -59,6 +59,9 @@ protected: virtual void MakeAll(); virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat ); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); + public: SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt! SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows @@ -69,7 +72,6 @@ public: virtual void Cut(); virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); inline const SwSectionFrm *GetFollow() const; inline SwSectionFrm *GetFollow(); diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index f5f8975c228e..7fc8b35a5f15 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -102,7 +102,7 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep ); bool Join(); - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &, + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat ); @@ -112,6 +112,7 @@ protected: virtual void Format( const SwBorderAttrs *pAttrs = 0 ); //Aendert nur die Framesize, nicht die PrtArea-SSize virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das //Regist Flys rufen! @@ -127,7 +128,6 @@ public: inline SwTabFrm *GetFollow(); SwTabFrm* FindMaster( bool bFirstMaster = false ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual BOOL GetInfo( SfxPoolItem &rHnt ) const; virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 42593b174314..a371f3557985 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -227,6 +227,8 @@ class SwTxtFrm: public SwCntntFrm xub_StrLen nInsertPos, xub_StrLen nActPos, xub_StrLen &nChgStart, xub_StrLen &nChgEnd, xub_StrLen &nInvStart, xub_StrLen &nInvEnd); +protected: + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); public: @@ -293,7 +295,6 @@ public: void PaintExtraData( const SwRect & rRect ) const; //Seitennummer usw. SwRect Paint(); virtual void Paint( const SwRect &, const SwPrtOptions *pPrintData = NULL ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual sal_Bool GetInfo( SfxPoolItem & ) const; //Layoutorientiertes Cursortravelling: Linker, rechter Rand, @@ -609,6 +610,8 @@ public: { return mnHeightOfLastLine; } + + static void repaintTextFrames( const SwTxtNode& rNode ); }; /************************************************************************* diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index cc645e674e70..3f85c7fbad62 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -98,24 +98,17 @@ #include #include #include -/// OD 22.08.2002 #99657# -/// include definition of class SvxBrushItem and GraphicObject -/// in order to determine, if background is transparent. #include #include - #include #include -#ifndef _COMCORE_HRC #include -#endif #include // #111827# -// OD 2004-05-24 #i28701# #include -// --> OD 2006-03-06 #125892# #include -// <-- #include +#include +#include using namespace ::com::sun::star; using ::rtl::OUString; @@ -191,7 +184,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt ) { // Klammer, weil im DTOR SwClientIter das Flag bTreeChg zurueck // gesetzt wird. Unguenstig, wenn das Format vorher zerstoert wird. - SwClientIter aIter( *pFmt ); + SwClientIter aIter( *pFmt ); // TODO SwClient *pLast = aIter.GoStart(); if( pLast ) do { @@ -225,16 +218,12 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt ) if ( pNode->IsCntntNode() && ((SwCntntNode*)pNode)->GetDepends() ) { - SwClientIter aIter( *(SwCntntNode*)pNode ); - do + SwCrsrShell *pShell = SwIterator::FirstElement( *(SwCntntNode*)pNode ); + if( pShell ) { - if( aIter()->ISA( SwCrsrShell ) ) - { - ((SwCrsrShell*)aIter())->ParkCrsr( aIdx ); + pShell->ParkCrsr( aIdx ); aIdx = nEnd-1; - break; - } - } while ( aIter++ ); + } } aIdx++; pNode = pDoc->GetNodes()[ aIdx ]; @@ -538,7 +527,7 @@ SwFmtHeader::SwFmtHeader( sal_Bool bOn ) int SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return ( pRegisteredIn == ((SwFmtHeader&)rAttr).GetRegisteredIn() && + return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() && bActive == ((SwFmtHeader&)rAttr).IsActive() ); } @@ -547,6 +536,11 @@ SfxPoolItem* SwFmtHeader::Clone( SfxItemPool* ) const return new SwFmtHeader( *this ); } +void SwFmtHeader::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add(this); +} + // class SwFmtFooter // Implementierung teilweise inline im hxx @@ -577,10 +571,15 @@ SwFmtFooter::SwFmtFooter( sal_Bool bOn ) DelHFFormat( this, GetFooterFmt() ); } +void SwFmtFooter::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add(this); +} + int SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return ( pRegisteredIn == ((SwFmtFooter&)rAttr).GetRegisteredIn() && + return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() && bActive == ((SwFmtFooter&)rAttr).IsActive() ); } @@ -654,6 +653,21 @@ SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc ) SwFmtPageDesc::~SwFmtPageDesc() {} +void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rFmt ) +{ + rFmt.Add(this); +} + +bool SwFmtPageDesc::KnowsPageDesc() const +{ + return (GetRegisteredIn() != 0); +} + +bool SwFmtPageDesc::IsRegisteredAt( SwEndNoteInfo* pInfo ) const +{ + return (pInfo->GetPageDescDep() == this); +} + int SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); @@ -667,7 +681,7 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const return new SwFmtPageDesc( *this ); } -void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !pDefinedIn ) return; @@ -2443,7 +2457,7 @@ SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const TYPEINIT1( SwFrmFmt, SwFmt ); IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 ) -void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { SwFmtHeader *pH = 0; SwFmtFooter *pF = 0; @@ -2465,13 +2479,13 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if( pH && pH->IsActive() && !pH->GetHeaderFmt() ) { //Hat er keinen, mach ich ihm einen SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_HEADER, 0 ); - pFmt->Add( pH ); + pH->RegisterToFormat( *pFmt ); } if( pF && pF->IsActive() && !pF->GetFooterFmt() ) { //Hat er keinen, mach ich ihm einen SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_FOOTER, 0 ); - pFmt->Add( pF ); + pF->RegisterToFormat( *pFmt ); } // MIB 24.3.98: Modify der Basisklasse muss immer gerufen werden, z.B. @@ -2489,16 +2503,13 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) void SwFrmFmt::DelFrms() { - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); + SwIterator aIter( *this ); + SwFrm * pLast = aIter.First(); if( pLast ) do { - if ( pLast->ISA(SwFrm) ) - { - ((SwFrm*)pLast)->Cut(); + pLast->Cut(); delete pLast; - } - } while( 0 != ( pLast = aIter++ )); + } while( 0 != ( pLast = aIter.Next() )); } void SwFrmFmt::MakeFrms() @@ -2522,7 +2533,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint, SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 ); pFrm = aTmp.NextFrm(); - if( pFrm && pFrm->GetRegisteredIn() != this ) + if( pFrm && !pFrm->KnowsFormat(*this) ) { // die Section hat keinen eigenen frame::Frame, also falls // jemand die tatsaechliche Groe?e braucht, so muss das @@ -2560,8 +2571,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint, SwContact* SwFrmFmt::FindContactObj() { - SwClientIter aIter( *this ); - return (SwContact*)aIter.First( TYPE( SwContact ) ); + return SwIterator::FirstElement( *this ); } SdrObject* SwFrmFmt::FindSdrObject() @@ -2590,12 +2600,10 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const { //Auch eine Verkettung von Innen nach aussen oder von aussen //nach innen ist nicht zulaessig. - SwClientIter aIter( *(SwModify*)this ); - SwFlyFrm *pSFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) ); + SwFlyFrm *pSFly = SwIterator::FirstElement(*this); if( pSFly ) { - SwClientIter aOtherIter( (SwModify&)rFmt ); - SwFlyFrm *pAskFly = (SwFlyFrm*)aOtherIter.First( TYPE(SwFlyFrm) ); + SwFlyFrm *pAskFly = SwIterator::FirstElement(rFmt); if( pAskFly ) return pSFly->IsLowerOf( pAskFly ); } @@ -2677,22 +2685,20 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwFlyFrmFmt, 10, 10 ) SwFlyFrmFmt::~SwFlyFrmFmt() { - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); + SwIterator aIter( *this ); + SwFlyFrm * pLast = aIter.First(); if( pLast ) do { - if ( pLast->ISA( SwFlyFrm ) ) delete pLast; + } while( 0 != ( pLast = aIter.Next() )); - } while( 0 != ( pLast = aIter++ )); - - pLast = aIter.GoStart(); - if( pLast ) + SwIterator a2ndIter( *this ); + SwFlyDrawContact* pC = a2ndIter.First(); + if( pC ) do { - if ( pLast->ISA( SwFlyDrawContact ) ) - delete pLast; + delete pC; - } while( 0 != ( pLast = aIter++ )); + } while( 0 != ( pC = a2ndIter.Next() )); } //Erzeugen der Frms wenn das Format einen Absatzgebundenen Rahmen beschreibt. @@ -2735,8 +2741,7 @@ void SwFlyFrmFmt::MakeFrms() if ( pCNd ) // <-- { - SwClientIter aIter( *pCNd ); - if ( aIter.First( TYPE(SwFrm) ) ) + if( SwIterator::FirstElement( *pCNd ) ) { pModify = pCNd; } @@ -2769,12 +2774,10 @@ void SwFlyFrmFmt::MakeFrms() { SwCntntNode *pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); - SwClientIter aIter( *pCNd ); - do + SwIterator aIter( *pCNd ); + for (SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { - if( aIter()->ISA( SwFrm ) ) - { - pPage = ((SwFrm*)aIter())->FindPageFrm(); + pPage = pFrm->FindPageFrm(); if( pPage ) { nPgNum = pPage->GetPhyPageNum(); @@ -2785,7 +2788,6 @@ void SwFlyFrmFmt::MakeFrms() } break; } - } while ( aIter++ ); } while ( pPage ) { @@ -2806,10 +2808,8 @@ void SwFlyFrmFmt::MakeFrms() if( pModify ) { - SwClientIter aIter( *pModify ); - for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); - pFrm; - pFrm = (SwFrm*)aIter.Next() ) + SwIterator aIter( *pModify ); + for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { BOOL bAdd = !pFrm->IsCntntFrm() || !((SwCntntFrm*)pFrm)->IsFollow(); @@ -2908,8 +2908,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const { case RES_CONTENT_VISIBLE: { - ((SwPtrMsgPoolItem&)rInfo).pObject = - SwClientIter( *(SwFlyFrmFmt*)this ).First( TYPE(SwFrm) ); + ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator::FirstElement( *this ); } return sal_False; @@ -2935,7 +2934,7 @@ void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast ) SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() ); SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle ); pMasterObject->SetTitle( rTitle ); - Modify( &aOld, &aNew ); + ModifyNotification( &aOld, &aNew ); } else { @@ -2971,7 +2970,7 @@ void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() ); SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription ); pMasterObject->SetDescription( rDescription ); - Modify( &aOld, &aNew ); + ModifyNotification( &aOld, &aNew ); } else { @@ -3079,33 +3078,32 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt, { // determine 'old' number of anchor frames sal_uInt32 nOldNumOfAnchFrm( 0L ); - SwClientIter aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) ); - for( aOldIter.First( TYPE(SwFrm) ); aOldIter(); aOldIter.Next() ) + SwIterator aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) ); + for( SwFrm* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() ) { ++nOldNumOfAnchFrm; } // determine 'new' number of anchor frames sal_uInt32 nNewNumOfAnchFrm( 0L ); - SwClientIter aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) ); - for( aNewIter.First( TYPE(SwFrm) ); aNewIter(); aNewIter.Next() ) + SwIterator aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) ); + for( SwFrm* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() ) { ++nNewNumOfAnchFrm; } if ( nOldNumOfAnchFrm != nNewNumOfAnchFrm ) { // delete existing fly frames except <_pKeepThisFlyFrm> - SwClientIter aIter( mrFlyFrmFmt ); - SwClient* pLast = aIter.GoStart(); - if ( pLast ) + SwIterator aIter( mrFlyFrmFmt ); + SwFrm* pFrm = aIter.First(); + if ( pFrm ) { do { - SwFrm* pFrm( dynamic_cast(pLast) ); - if ( pFrm && pFrm != _pKeepThisFlyFrm ) + if ( pFrm != _pKeepThisFlyFrm ) { pFrm->Cut(); delete pFrm; } - } while( 0 != ( pLast = aIter++ )); + } while( 0 != ( pFrm = aIter.Next() )); } // indicate, that re-creation of fly frames necessary mbAnchorNodeChanged = true; @@ -3219,7 +3217,7 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint, if( !pFly ) { - pFly = (SwFlyFrm*) SwClientIter( *(SwFrmFmt*)this ).First( TYPE( SwFlyFrm )); + pFly = SwIterator::FirstElement( *this ); if( !pFly ) return 0; } diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 3a295a80cbb0..5382ef4c9f61 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -45,6 +45,7 @@ #include "bodyfrm.hxx" // ColumnFrms jetzt mit BodyFrm #include "rootfrm.hxx" // wg. RemoveFtns #include "sectfrm.hxx" // wg. FtnAtEnd-Flag +#include "switerator.hxx" // ftnfrm.cxx: void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes ); @@ -143,8 +144,8 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount ) if ( pCont->IsBodyFrm() ) pAttrOwner = pCont->FindPageFrm(); SwLayoutFrm *pNeighbourCol = 0; - SwClientIter aIter( *pAttrOwner->GetFmt() ); - SwLayoutFrm *pNeighbour = (SwLayoutFrm*)aIter.First( TYPE(SwLayoutFrm) ); + SwIterator aIter( *pAttrOwner->GetFmt() ); + SwLayoutFrm *pNeighbour = aIter.First(); USHORT nAdd = 0; SwFrm *pCol = pCont->Lower(); @@ -157,7 +158,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount ) pNeighbourCol != pCont ) break; pNeighbourCol = 0; - pNeighbour = (SwLayoutFrm*)aIter.Next(); + pNeighbour = aIter.Next(); } BOOL bRet; diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 11f39261ad0b..52ca109c4e91 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -47,8 +47,8 @@ #include "ftnfrm.hxx" #include "txtftn.hxx" #include "fmtftn.hxx" -// OD 09.01.2004 #i11859# #include // SwTxtFrm +#include /************************************************************************* |* @@ -1683,13 +1683,10 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren GetTabBox()->FindStartOfRowSpan( *pTable, nMax ) : GetTabBox()->FindEndOfRowSpan( *pTable, nMax ); - SwClientIter aIter( const_cast( *rMasterBox.GetFrmFmt()) ); + SwIterator aIter( *rMasterBox.GetFrmFmt() ); - for ( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + for ( SwCellFrm* pMasterCell = aIter.First(); pMasterCell; pMasterCell = aIter.Next() ) { - ASSERT( ((SwFrm*)pLast)->IsCellFrm(), "Non-row frame registered in table line" ) - const SwCellFrm* pMasterCell = static_cast(pLast); - if ( pMasterCell->GetTabBox() == &rMasterBox ) { const SwTabFrm* pMasterTable = static_cast(pMasterCell->GetUpper()->GetUpper()); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 4c35ff65ea27..724eeb2a5b92 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -51,7 +51,6 @@ #include #include #include - #include "ftnfrm.hxx" #include "txtfrm.hxx" #include "tabfrm.hxx" @@ -63,15 +62,11 @@ #include "section.hxx" #include "dbg_lay.hxx" #include "lineinfo.hxx" -// OD 2004-03-02 #106629# #include -// --> OD 2004-06-23 #i28701# #include #include -// <-- -// --> OD 2004-10-15 #i26945# #include -// <-- +#include BOOL SwFlowFrm::bMoveBwdJump = FALSE; @@ -739,20 +734,13 @@ SwSectionFrm* SwSectionFrm::FindMaster() const { ASSERT( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" ); - SwClientIter aIter( *pSection->GetFmt() ); - SwClient *pLast = aIter.GoStart(); - - while ( pLast ) + SwIterator aIter( *pSection->GetFmt() ); + SwSectionFrm* pSect = aIter.First(); + while ( pSect ) { - if ( pLast->ISA( SwFrm ) ) - { - ASSERT( ((SwFrm*)pLast)->IsSctFrm(), - "Non-section frame registered in section format" ) - SwSectionFrm* pSect = (SwSectionFrm*)pLast; if( pSect->GetFollow() == this ) return pSect; - } - pLast = aIter++; + pSect = aIter.Next(); } ASSERT( FALSE, "Follow ist lost in Space." ); @@ -763,17 +751,10 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const { ASSERT( IsFollow(), "SwTabFrm::FindMaster(): !IsFollow" ); - SwClientIter aIter( *GetTable()->GetFrmFmt() ); - SwClient* pLast = aIter.GoStart(); - - while ( pLast ) + SwIterator aIter( *GetTable()->GetFrmFmt() ); + SwTabFrm* pTab = aIter.First(); + while ( pTab ) { - if ( pLast->ISA( SwFrm ) ) - { - ASSERT( ((SwFrm*)pLast)->IsTabFrm(), - "Non-table frame registered in table format" ) - SwTabFrm* pTab = (SwTabFrm*)pLast; - if ( bFirstMaster ) { // @@ -797,8 +778,8 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const if ( pTab->GetFollow() == this ) return pTab; } - } - pLast = aIter++; + + pTab = aIter.Next(); } ASSERT( FALSE, "Follow ist lost in Space." ); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index e8d0493ea7e9..aa121d93bf9e 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -50,27 +50,16 @@ #include #include #include - -// --> OD 2010-09-14 #i113730# #include -// <-- -// OD 16.04.2003 #i13147# - for #include -// OD 29.10.2003 #113049# #include -// OD 06.11.2003 #i22305# #include -// --> OD 2004-06-28 #i28701# #include #include -// <-- -// OD 2004-04-06 #i26791# #include -// --> OD 2006-01-31 #i53298# #include -// <-- #include - +#include #include "doc.hxx" #include "viewsh.hxx" #include "layouter.hxx" @@ -99,6 +88,7 @@ #include "sectfrm.hxx" #include #include // FRound +#include "switerator.hxx" using namespace ::com::sun::star; @@ -388,15 +378,81 @@ void SwFlyFrm::DeleteCnt() |* Letzte Aenderung MA 30. Nov. 95 |* |*************************************************************************/ + +sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact ) +{ + sal_uInt32 nOrdNum( 0L ); + + // search for another Writer fly frame registered at same frame format + SwIterator aIter( *pContact->GetFmt() ); + const SwFlyFrm* pFlyFrm( 0L ); + for ( pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() ) + { + if ( pFlyFrm != this ) + { + break; + } + } + + if ( pFlyFrm ) + { + // another Writer fly frame found. Take its order number + nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum(); + } + else + { + // no other Writer fly frame found. Take order number of 'master' object + // --> OD 2004-11-11 #i35748# - use method instead + // of method to avoid a recalculation of the order number, + // which isn't intended. + nOrdNum = pContact->GetMaster()->GetOrdNumDirect(); + // <-- + } + + return nOrdNum; +} + +SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact ) +{ + SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *pContact->GetMaster(), this ); + pDrawObj->SetModel( pContact->GetMaster()->GetModel() ); + pDrawObj->SetUserCall( pContact ); + + //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu + //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden + //die Master aus der Liste entfernt und fuehren von da an ein + //Schattendasein. + SdrPage* pPg( 0L ); + if ( 0 != ( pPg = pContact->GetMaster()->GetPage() ) ) + { + const UINT32 nOrdNum = pContact->GetMaster()->GetOrdNum(); + pPg->ReplaceObject( pDrawObj, nOrdNum ); + } + // --> OD 2004-08-16 #i27030# - insert new instance + // into drawing page with correct order number + else + { + pContact->GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )-> + InsertObject( pDrawObj, _GetOrdNumForNewRef( pContact ) ); + } + // <-- + // --> OD 2004-12-13 #i38889# - assure, that new instance + // is in a visible layer. + pContact->MoveObjToVisibleLayer( pDrawObj ); + // <-- + return pDrawObj; +} + + + void SwFlyFrm::InitDrawObj( BOOL bNotify ) { //ContactObject aus dem Format suchen. Wenn bereits eines existiert, so //braucht nur eine neue Ref erzeugt werden, anderfalls ist es jetzt an //der Zeit das Contact zu erzeugen. - SwClientIter aIter( *GetFmt() ); - SwFlyDrawContact *pContact = (SwFlyDrawContact*) - aIter.First( TYPE(SwFlyDrawContact) ); + IDocumentDrawModelAccess* pIDDMA = GetFmt()->getIDocumentDrawModelAccess(); + SwFlyDrawContact *pContact = SwIterator::FirstElement( *GetFmt() ); if ( !pContact ) { // --> OD 2005-08-08 #i52858# - method name changed @@ -406,7 +462,7 @@ void SwFlyFrm::InitDrawObj( BOOL bNotify ) } ASSERT( pContact, "InitDrawObj failed" ); // OD 2004-03-22 #i26791# - SetDrawObj( *(pContact->CreateNewRef( this )) ); + SetDrawObj( *(CreateNewRef( pContact )) ); //Den richtigen Layer setzen. // OD 2004-01-19 #110582# @@ -458,18 +514,19 @@ void SwFlyFrm::FinitDrawObj() SwFlyDrawContact *pMyContact = 0; if ( GetFmt() ) { - SwClientIter aIter( *GetFmt() ); - aIter.GoStart(); - do { - if ( aIter()->ISA(SwFrm) && (SwFrm*)aIter() != this ) + bool bContinue = true; + SwIterator aFrmIter( *GetFmt() ); + for ( SwFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() ) + if ( pFrm != this ) { - pMyContact = 0; + // don't delete Contact if there is still a Frm + bContinue = false; break; } - if( !pMyContact && aIter()->ISA(SwFlyDrawContact) ) - pMyContact = (SwFlyDrawContact*)aIter(); - aIter++; - } while( aIter() ); + + if ( bContinue ) + // no Frm left, find Contact object to destroy + pMyContact = SwIterator::FirstElement( *GetFmt() ); } // OD, OS 2004-03-31 #116203# - clear user call of Writer fly frame 'master' @@ -617,8 +674,8 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch ) pLay = pLay->GetUpper(); } - SwClientIter aIter( rChain ); - SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm ) ); + SwIterator aIter( rChain ); + SwFlyFrm *pFly = aIter.First(); if ( pLay ) { while ( pFly ) @@ -633,7 +690,7 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch ) else if ( pLay == pFly->FindFooterOrHeader() ) break; } - pFly = (SwFlyFrm*)aIter.Next(); + pFly = aIter.Next(); } } else if ( pFly ) @@ -736,7 +793,7 @@ BOOL SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize ) |* |*************************************************************************/ -void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BYTE nInvFlags = 0; @@ -804,7 +861,7 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) // <-- } -void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, +void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { @@ -2876,3 +2933,11 @@ bool SwFlyFrm::IsFormatPossible() const return SwAnchoredObject::IsFormatPossible() && !IsLocked() && !IsColLocked(); } + +void SwFlyFrm::GetAnchoredObjects( std::list& aList, const SwFmt& rFmt ) +{ + SwIterator aIter( rFmt ); + for( SwFlyFrm* pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() ) + aList.push_back( pFlyFrm ); +} + diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 7f3dc5e2a027..4a7b816acd73 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -101,7 +101,7 @@ TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm); |* |*************************************************************************/ -void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { USHORT nWhich = pNew ? pNew->Which() : 0; const SwFmtAnchor *pAnch = 0; diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 2d64357e0e20..4b0e0890aa6d 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -123,7 +123,7 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint, |* Letzte Aenderung MA 02. Sep. 93 |* |*************************************************************************/ -void SwFlyInCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { BOOL bCallPrepare = FALSE; USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 26445d82a9e0..813688e27eb6 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -566,7 +566,7 @@ TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm); |* |*************************************************************************/ -void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { USHORT nWhich = pNew ? pNew->Which() : 0; diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index ae27eb8ed805..f6dedb46a66f 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -28,13 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "doc.hxx" #include "node.hxx" #include - - #include #include "flypos.hxx" #include "frmfmt.hxx" @@ -43,8 +39,7 @@ #include "flyfrm.hxx" #include "dflyobj.hxx" #include "ndindex.hxx" - - +#include "switerator.hxx" SV_IMPL_OP_PTRARR_SORT( SwPosFlyFrms, SwPosFlyFrmPtr ) @@ -60,22 +55,27 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, } else if( pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { - SwClientIter aIter( (SwFmt&)*pFmt ); if( RES_FLYFRMFMT == pFmt->Which() ) { // Schauen, ob es ein SdrObject dafuer gibt - if( aIter.First( TYPE( SwFlyFrm) ) ) - nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(), + SwFlyFrm* pFly = SwIterator::FirstElement(*pFmt); + if( pFly ) + { + nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum(); bFnd = TRUE; } + } else if( RES_DRAWFRMFMT == pFmt->Which() ) { // Schauen, ob es ein SdrObject dafuer gibt - if( aIter.First( TYPE(SwDrawContact) ) ) - nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(), + SwDrawContact* pContact = SwIterator::FirstElement(*pFmt); + if( pContact ) + { + nOrdNum = pContact->GetMaster()->GetOrdNum(); bFnd = TRUE; } } + } if( !bFnd ) { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 7da50d2d0dae..8bfa04a13858 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -38,10 +38,8 @@ #include #include #include -// OD 08.01.2004 #i11859# #include - #include #include #include @@ -79,18 +77,13 @@ #include "hints.hxx" #include #include - #include - #include "mdiexp.hxx" #include "statstr.hrc" -// OD 21.05.2003 #108789# #include -// OD 2004-05-24 #i28701# #include -// --> OD 2005-03-04 #b6234250# #include -// <-- +#include // ftnfrm.cxx: void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes ); @@ -107,14 +100,7 @@ BOOL StackHack::bLocked = FALSE; -/************************************************************************* -|* -|* SwFrmNotify::SwFrmNotify() -|* -|* Ersterstellung MA 27. Nov. 92 -|* Letzte Aenderung MA 09. Apr. 97 -|* -|*************************************************************************/ +/*************************************************************************/ SwFrmNotify::SwFrmNotify( SwFrm *pF ) : pFrm( pF ), @@ -122,9 +108,7 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) : aPrt( pF->Prt() ), bInvaKeep( FALSE ), bValidSize( pF->GetValidSizeFlag() ), - // --> OD 2005-07-29 #i49383# - mbFrmDeleted( false ) - // <-- + mbFrmDeleted( false ) // #i49383# { if ( pF->IsTxtFrm() ) { @@ -142,23 +126,15 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) : FALSE; } -/************************************************************************* -|* -|* SwFrmNotify::~SwFrmNotify() -|* -|* Ersterstellung MA 27. Nov. 92 -|* Letzte Aenderung MA 09. Apr. 97 -|* -|*************************************************************************/ +/*************************************************************************/ SwFrmNotify::~SwFrmNotify() { - // --> OD 2005-07-29 #i49383# + // #i49383# if ( mbFrmDeleted ) { return; } - // <-- SWRECTFN( pFrm ) const BOOL bAbsP = POS_DIFF( aFrm, pFrm->Frm() ); @@ -218,19 +194,18 @@ SwFrmNotify::~SwFrmNotify() pFrm->SetCompletePaint(); SwFrm* pNxt = pFrm->GetIndNext(); - // --> OD 2005-05-20 #121888# - skip empty section frames + // #121888# - skip empty section frames while ( pNxt && pNxt->IsSctFrm() && !static_cast(pNxt)->GetSection() ) { pNxt = pNxt->GetIndNext(); } - // <-- if ( pNxt ) pNxt->InvalidatePos(); else { - // OD 04.11.2002 #104100# - correct condition for setting retouche + // #104100# - correct condition for setting retouche // flag for vertical layout. if( pFrm->IsRetoucheFrm() && (aFrm.*fnRect->fnTopDist)( (pFrm->Frm().*fnRect->fnGetTop)() ) > 0 ) @@ -261,7 +236,7 @@ SwFrmNotify::~SwFrmNotify() } else { - // OD 13.11.2002 #97597# - consider case that *only* margins between + // #97597# - consider case that *only* margins between // frame and printing area has changed. Then, frame has to be repainted, // in order to force paint of the margin areas. if ( !bAbsP && (bChgWidth || bChgHeight) ) @@ -457,15 +432,7 @@ SwFrmNotify::~SwFrmNotify() } } -/************************************************************************* -|* -|* SwLayNotify::SwLayNotify() -|* -|* Ersterstellung MA 17. Nov. 92 -|* Letzte Aenderung MA 03. Jun. 93 -|* -|*************************************************************************/ - +/*************************************************************************/ SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) : SwFrmNotify( pLayFrm ), @@ -473,14 +440,7 @@ SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) : { } -/************************************************************************* -|* -|* SwLayNotify::~SwLayNotify() -|* -|* Ersterstellung MA 17. Nov. 92 -|* Letzte Aenderung MA 13. Jun. 96 -|* -|*************************************************************************/ +/*************************************************************************/ // OD 2004-05-11 #i28701# - local method to invalidate the position of all // frames inclusive its floating screen objects, which are lowers of the given @@ -692,14 +652,7 @@ SwLayNotify::~SwLayNotify() ((SwFlyFrm*)pLay)->AnchorFrm()->InvalidateSize(); } -/************************************************************************* -|* -|* SwFlyNotify::SwFlyNotify() -|* -|* Ersterstellung MA 17. Nov. 92 -|* Letzte Aenderung MA 26. Aug. 93 -|* -|*************************************************************************/ +/*************************************************************************/ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) : SwLayNotify( pFlyFrm ), @@ -711,14 +664,7 @@ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) : { } -/************************************************************************* -|* -|* SwFlyNotify::~SwFlyNotify() -|* -|* Ersterstellung MA 17. Nov. 92 -|* Letzte Aenderung MA 09. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwFlyNotify::~SwFlyNotify() { @@ -827,14 +773,7 @@ SwFlyNotify::~SwFlyNotify() } } -/************************************************************************* -|* -|* SwCntntNotify::SwCntntNotify() -|* -|* Ersterstellung MA 24. Nov. 92 -|* Letzte Aenderung MA 16. May. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) : SwFrmNotify( pCntntFrm ), @@ -862,14 +801,7 @@ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) : } } -/************************************************************************* -|* -|* SwCntntNotify::~SwCntntNotify() -|* -|* Ersterstellung MA 24. Nov. 92 -|* Letzte Aenderung MA 09. Apr. 97 -|* -|*************************************************************************/ +/*************************************************************************/ SwCntntNotify::~SwCntntNotify() { @@ -1110,17 +1042,7 @@ SwCntntNotify::~SwCntntNotify() // <-- } -/************************************************************************* -|* -|* InsertCnt -|* -|* Beschreibung Hilfsfunktionen, die friend von irgendwem sind, damit -|* nicht immer gleich 'ne ganze Klasse befreundet werden -|* muss. -|* Ersterstellung MA 13. Apr. 93 -|* Letzte Aenderung MA 11. May. 95 -|* -|*************************************************************************/ +/*************************************************************************/ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, SwFrm *pFrm, SwPageFrm *pPage ) @@ -1202,13 +1124,12 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib ) { - SwClientIter aIter( *pFmt ); + SwIterator aIter( *pFmt ); if ( RES_FLYFRMFMT == pFmt->Which() ) { const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; const SwFlyFrm* pTmpFrm; - for( pTmpFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm )); pTmpFrm; - pTmpFrm = (SwFlyFrm*)aIter.Next() ) + for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() ) { if(! pRoot || pRoot == pTmpFrm->getRootFrm() ) return true; @@ -1216,8 +1137,8 @@ bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib ) } else { - SwDrawContact *pContact; - if ( 0 != (pContact = (SwDrawContact*)aIter.First( TYPE(SwDrawContact)))) + SwDrawContact *pContact = SwIterator::FirstElement(*pFmt); + if ( pContact ) return pContact->GetAnchorFrm() != 0; } return false; @@ -1933,14 +1854,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, } -/************************************************************************* -|* -|* SwBorderAttrs::Ctor, DTor -|* -|* Ersterstellung MA 19. May. 93 -|* Letzte Aenderung MA 25. Jan. 97 -|* -|*************************************************************************/ +/*************************************************************************/ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor ) : SwCacheObj( pMod ), @@ -1993,8 +1907,6 @@ SwBorderAttrs::~SwBorderAttrs() |* der Sicherheitsabstand wird nur einkalkuliert, wenn Umrandung und/oder |* Schatten im Spiel sind; er soll vermeiden, dass aufgrund der |* groben physikalischen Gegebenheiten Raender usw. uebermalt werden. -|* Ersterstellung MA 19. May. 93 -|* Letzte Aenderung MA 08. Jul. 93 |* |*************************************************************************/ @@ -2076,8 +1988,6 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const |* Es kann auch ohne Linien ein Abstand erwuenscht sein, |* dieser wird dann nicht vom Attribut sondern hier |* beruecksichtigt (bBorderDist, z.B. fuer Zellen). -|* Ersterstellung MA 21. May. 93 -|* Letzte Aenderung MA 07. Jun. 99 |* |*************************************************************************/ @@ -2117,14 +2027,7 @@ void SwBorderAttrs::_CalcRightLine() bRightLine = FALSE; } -/************************************************************************* -|* -|* SwBorderAttrs::_IsLine() -|* -|* Ersterstellung MA 29. Sep. 94 -|* Letzte Aenderung MA 29. Sep. 94 -|* -|*************************************************************************/ +/*************************************************************************/ void SwBorderAttrs::_IsLine() { @@ -2151,9 +2054,6 @@ void SwBorderAttrs::_IsLine() |* 3. Die Umrandungen links und rechts vor Vorgaenger bzw. Nachfolger |* sind identisch. |* -|* Ersterstellung MA 22. Mar. 95 -|* Letzte Aenderung MA 22. May. 95 -|* |*************************************************************************/ inline int CmpLines( const SvxBorderLine *pL1, const SvxBorderLine *pL2 ) { @@ -2319,14 +2219,7 @@ void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm ) nGetBottomLine = nRet; } -/************************************************************************* -|* -|* SwBorderAttrAccess::CTor -|* -|* Ersterstellung MA 20. Mar. 95 -|* Letzte Aenderung MA 29. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) : SwCacheAccess( rCach, (pFrm->IsCntntFrm() ? @@ -2339,14 +2232,7 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) : { } -/************************************************************************* -|* -|* SwBorderAttrAccess::NewObj, Get -|* -|* Ersterstellung MA 20. Mar. 95 -|* Letzte Aenderung MA 20. Mar. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwCacheObj *SwBorderAttrAccess::NewObj() { @@ -2359,14 +2245,7 @@ SwBorderAttrs *SwBorderAttrAccess::Get() return (SwBorderAttrs*)SwCacheAccess::Get(); } -/************************************************************************* -|* -|* SwOrderIter::Ctor -|* -|* Ersterstellung MA 06. Jan. 95 -|* Letzte Aenderung MA 22. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwOrderIter::SwOrderIter( const SwPageFrm *pPg, BOOL bFlys ) : pPage( pPg ), @@ -2375,14 +2254,7 @@ SwOrderIter::SwOrderIter( const SwPageFrm *pPg, BOOL bFlys ) : { } -/************************************************************************* -|* -|* SwOrderIter::Top() -|* -|* Ersterstellung MA 06. Jan. 95 -|* Letzte Aenderung MA 22. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ const SdrObject *SwOrderIter::Top() { @@ -2411,14 +2283,7 @@ const SdrObject *SwOrderIter::Top() return pCurrent; } -/************************************************************************* -|* -|* SwOrderIter::Bottom() -|* -|* Ersterstellung MA 06. Jan. 95 -|* Letzte Aenderung MA 22. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ const SdrObject *SwOrderIter::Bottom() { @@ -2447,14 +2312,7 @@ const SdrObject *SwOrderIter::Bottom() return pCurrent; } -/************************************************************************* -|* -|* SwOrderIter::Next() -|* -|* Ersterstellung MA 06. Jan. 95 -|* Letzte Aenderung MA 22. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ const SdrObject *SwOrderIter::Next() { @@ -2484,14 +2342,7 @@ const SdrObject *SwOrderIter::Next() return pCurrent; } -/************************************************************************* -|* -|* SwOrderIter::Prev() -|* -|* Ersterstellung MA 06. Jan. 95 -|* Letzte Aenderung MA 22. Nov. 95 -|* -|*************************************************************************/ +/*************************************************************************/ const SdrObject *SwOrderIter::Prev() { @@ -2521,14 +2372,7 @@ const SdrObject *SwOrderIter::Prev() return pCurrent; } -/************************************************************************* -|* -|* SaveCntnt(), RestoreCntnt() -|* -|* Ersterstellung MA 10. Jun. 93 -|* Letzte Aenderung MA 07. Mar. 95 -|* -|*************************************************************************/ +/*************************************************************************/ //Unterstruktur eines LayoutFrms fuer eine Aktion aufheben und wieder //restaurieren. @@ -2864,9 +2708,6 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro |* SqRt() Berechnung der Quadratwurzel, damit die math.lib |* nicht auch noch dazugelinkt werden muss. |* -|* Ersterstellung OK ?? -|* Letzte Aenderung MA 09. Jan. 97 -|* |*************************************************************************/ ULONG MA_FASTCALL SqRt( BigInt nX ) @@ -2885,14 +2726,7 @@ ULONG MA_FASTCALL SqRt( BigInt nX ) return nErg >= BigInt(SAL_MAX_UINT32) ? ULONG_MAX : (ULONG)nErg; } -/************************************************************************* -|* -|* InsertNewPage() Einsetzen einer neuen Seite. -|* -|* Ersterstellung MA 01. Jul. 93 -|* Letzte Aenderung MA 31. Jul. 95 -|* -|*************************************************************************/ +/*************************************************************************/ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn, @@ -2932,9 +2766,6 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, |* eine Layoutstruktur und melden alle FlyFrms, die einen beliebigen Frm |* innerhalb der Struktur als Anker haben bei der Seite an. |* -|* Ersterstellung MA 08. Jul. 93 -|* Letzte Aenderung MA 07. Jul. 95 -|* |*************************************************************************/ void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch ) @@ -3005,8 +2836,6 @@ void RegistFlys( SwPageFrm *pPage, const SwLayoutFrm *pLay ) |* |* Beschreibung Benachrichtigt den Hintergrund je nach der |* Veraenderung zwischen altem und neuem Rechteckt. -|* Ersterstellung MA 18. Jun. 93 -|* Letzte Aenderung MA 06. Jun. 96 |* |*************************************************************************/ @@ -3087,11 +2916,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, } } -/************************************************************************* -|* -|* NotifyBackground() -|* -|*************************************************************************/ +/*************************************************************************/ void lcl_CheckFlowBack( SwFrm* pFrm, const SwRect &rRect ) { @@ -3374,11 +3199,7 @@ const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos ) return pFrm; } -/************************************************************************* -|* -|* IsLowerOf() -|* -|*************************************************************************/ +/*************************************************************************/ BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj ) { @@ -3526,21 +3347,61 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ) return pPage; } + +#include +class SwFrmHolder : private SfxListener +{ + SwFrm* pFrm; + bool bSet; + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); +public: + SwFrmHolder() : pFrm(0), bSet(false) {} + void SetFrm( SwFrm* pHold ); + SwFrm* GetFrm() { return pFrm; } + void Reset(); + bool IsSet() { return bSet; } +}; + +void SwFrmHolder::SetFrm( SwFrm* pHold ) +{ + bSet = true; + pFrm = pHold; + StartListening(*pHold); +} + +void SwFrmHolder::Reset() +{ + if (pFrm) + EndListening(*pFrm); + bSet = false; + pFrm = 0; +} + +void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if ( rHint.IsA(TYPE(SfxSimpleHint)) ) + { + if ( ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DYING && &rBC == pFrm ) + pFrm = 0; + } +} + SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType, const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) { SwFrm *pMinFrm = 0, *pTmpFrm; + SwFrmHolder aHolder; SwRect aCalcRect; bool bClientIterChanged = false; - SwClientIter aIter( rMod ); + SwIterator aIter( rMod ); do { pMinFrm = 0; + aHolder.Reset(); sal_uInt64 nMinDist = 0; bClientIterChanged = false; - for( pTmpFrm = (SwFrm*)aIter.First( TYPE( SwFrm )); pTmpFrm; - pTmpFrm = (SwFrm*)aIter.Next() ) + for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() ) { if( pTmpFrm->GetType() & nFrmType && ( !pLayout || pLayout == pTmpFrm->getRootFrm() ) && @@ -3549,13 +3410,11 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT co { if( pPoint ) { - // --> FME 2006-02-03 #127369# - // Set pointer to be watched. If a client is removed from - // rMod (e.g., by deleting a frame), the bWatchDeleted flag - // is set at the SwClientIter. - const bool bWatchClientSet = pMinFrm != 0; - aIter.SetWatchClient( pMinFrm ); - // <-- + // watch for Frm being deleted + if ( pMinFrm ) + aHolder.SetFrm( pMinFrm ); + else + aHolder.Reset(); if( bCalcFrm ) { @@ -3573,14 +3432,13 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT co pTmpFrm->Calc(); } - // --> FME 2006-02-03 #127369# - // The SwClientIter list has changed. Restart. - // aIter.IsChanged basically checks if pTmpFrm has been - // deleted. bWatchClientSet && aIter.GetWatchClient() - // checks if pMinFrm has been deleted. - // <-- - if( aIter.IsChanged() || ( bWatchClientSet && !aIter.GetWatchClient() ) ) + // #127369# + // aIter.IsChanged checks if the current pTmpFrm has been deleted while + // it is the current iterator + // FrmHolder watches for deletion of the current pMinFrm + if( aIter.IsChanged() || ( aHolder.IsSet() && !aHolder.GetFrm() ) ) { + // restart iteration bClientIterChanged = true; break; } @@ -3734,15 +3592,13 @@ bool SwDeletionChecker::HasBeenDeleted() if ( !mpFrm || !mpRegIn ) return false; - SwClientIter aIter( const_cast(*mpRegIn) ); - const SwClient* pLast = aIter.GoStart(); - + SwIterator aIter(*mpRegIn); + SwFrm* pLast = aIter.First(); while ( pLast ) { - if ( pLast->ISA( SwFrm ) && pLast == mpFrm ) + if ( pLast == mpFrm ) return false; - - pLast = aIter++; + pLast = aIter.Next(); } return true; diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index b808f22452af..4ae9c67bacde 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -48,11 +48,10 @@ #include #include #include -// --> OD 2005-05-17 #i49383# #include -// <-- #include "viewopt.hxx" #include "viewsh.hxx" +#include /************************************************************************* |* @@ -60,9 +59,6 @@ |* Dokument, dort stehen die Fussnoten gluecklicherweise nach ihrem |* Index sortiert. |* -|* Ersterstellung MA 29. Jun. 93 -|* Letzte Aenderung MA 13. Dec. 93 -|* |*************************************************************************/ #define ENDNOTE 0x80000000 @@ -121,9 +117,6 @@ BOOL SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const |* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird |* enthaelt pPage die neue Seite und die Funktion liefert TRUE. |* -|* Ersterstellung AMA 06. Nov. 98 -|* Letzte Aenderung AMA 06. Nov. 98 -|* |*************************************************************************/ BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage, @@ -173,9 +166,6 @@ BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage, |* liefert die Spaltennummer, wenn pBoss eine Spalte ist, |* sonst eine Null (bei Seiten). |* -|* Ersterstellung AMA 06. Nov. 98 -|* Letzte Aenderung AMA 06. Nov. 98 -|* |*************************************************************************/ USHORT lcl_ColumnNum( const SwFrm* pBoss ) @@ -210,9 +200,6 @@ USHORT lcl_ColumnNum( const SwFrm* pBoss ) |* |* SwFtnContFrm::SwFtnContFrm() |* -|* Ersterstellung MA 24. Feb. 93 -|* Letzte Aenderung MA 02. Mar. 93 -|* |*************************************************************************/ @@ -259,8 +246,6 @@ long lcl_Undersize( const SwFrm* pFrm ) |* |* Beschreibung: "Formatiert" den Frame; |* Die Fixsize wird hier nicht eingestellt. -|* Ersterstellung MA 01. Mar. 93 -|* Letzte Aenderung MA 17. Nov. 98 |* |*************************************************************************/ @@ -349,9 +334,6 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) |* |* SwFtnContFrm::GrowFrm(), ShrinkFrm() |* -|* Ersterstellung MA 24. Feb. 93 -|* Letzte Aenderung AMA 05. Nov. 98 -|* |*************************************************************************/ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL ) @@ -525,9 +507,6 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo ) |* |* SwFtnFrm::SwFtnFrm() |* -|* Ersterstellung MA 24. Feb. 93 -|* Letzte Aenderung MA 11. Oct. 93 -|* |*************************************************************************/ @@ -549,9 +528,6 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt |* |* SwFtnFrm::InvalidateNxtFtnCnts() |* -|* Ersterstellung MA 29. Jun. 93 -|* Letzte Aenderung MA 29. Jun. 93 -|* |*************************************************************************/ @@ -619,9 +595,6 @@ SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) |* |* SwFtnFrm::Cut() |* -|* Ersterstellung MA 23. Feb. 94 -|* Letzte Aenderung MA 24. Jul. 95 -|* |*************************************************************************/ @@ -680,9 +653,6 @@ void SwFtnFrm::Cut() |* |* SwFtnFrm::Paste() |* -|* Ersterstellung MA 23. Feb. 94 -|* Letzte Aenderung MA 23. Feb. 94 -|* |*************************************************************************/ @@ -752,8 +722,6 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) |* Beschreibung Liefert das naechste LayoutBlatt in den das |* Frame gemoved werden kann. |* Neue Seiten werden nur dann erzeugt, wenn der Parameter TRUE ist. -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung AMA 09. Nov. 98 |* |*************************************************************************/ @@ -847,8 +815,6 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage ) |* |* Beschreibung Liefert das vorhergehende LayoutBlatt in das der |* Frame gemoved werden kann. -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung AMA 06. Nov. 98 |* |*************************************************************************/ @@ -980,9 +946,6 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn ) |* |* SwFrm::IsFtnAllowed() |* -|* Ersterstellung MA 22. Mar. 94 -|* Letzte Aenderung MA 01. Dec. 94 -|* |*************************************************************************/ @@ -1005,9 +968,6 @@ BOOL SwFrm::IsFtnAllowed() const |* |* SwRootFrm::UpdateFtnNums() |* -|* Ersterstellung MA 02. Mar. 93 -|* Letzte Aenderung MA 09. Dec. 97 -|* |*************************************************************************/ @@ -1030,9 +990,6 @@ void SwRootFrm::UpdateFtnNums() |* RemoveFtns() Entfernen aller Fussnoten (nicht etwa die Referenzen) |* und Entfernen aller Fussnotenseiten. |* -|* Ersterstellung MA 05. Dec. 97 -|* Letzte Aenderung AMA 06. Nov. 98 -|* |*************************************************************************/ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes ) @@ -1126,9 +1083,6 @@ void SwRootFrm::RemoveFtns( SwPageFrm *pPage, BOOL bPageOnly, BOOL bEndNotes ) |* |* SetFtnPageDescs() Seitenvorlagen der Fussnotenseiten aendern |* -|* Ersterstellung MA 11. Dec. 97 -|* Letzte Aenderung MA 11. Dec. 97 -|* |*************************************************************************/ void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote ) @@ -1147,9 +1101,6 @@ void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote ) |* |* SwFtnBossFrm::MakeFtnCont() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1176,9 +1127,6 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont() |* |* SwFtnBossFrm::FindFtnCont() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1208,9 +1156,6 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont() |* |* SwFtnBossFrm::FindNearestFtnCont() Sucht den naechst greifbaren Fussnotencontainer. |* -|* Ersterstellung MA 02. Aug. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave ) @@ -1243,8 +1188,6 @@ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave ) |* SwFtnBossFrm::FindFirstFtn() |* |* Beschreibung Erste Fussnote des Fussnotenbosses suchen. -|* Ersterstellung MA 26. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 99 |* |*************************************************************************/ @@ -1332,8 +1275,6 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn() |* SwFtnBossFrm::FindFirstFtn() |* |* Beschreibunt Erste Fussnote zum Cnt suchen. -|* Ersterstellung MA 04. Mar. 93 -|* Letzte Aenderung AMA 28. Oct. 98 |* |*************************************************************************/ @@ -1375,9 +1316,6 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const |* |* SwFtnBossFrm::ResetFtn() |* -|* Ersterstellung MA 11. May. 95 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1392,13 +1330,10 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) if ( !pNd ) pNd = pCheck->GetFmt()->GetDoc()-> GetNodes().GoNextSection( &aIdx, TRUE, FALSE ); - SwClientIter aIter( *pNd ); - SwClient* pLast = aIter.GoStart(); - while( pLast ) + SwIterator aIter( *pNd ); + SwFrm* pFrm = aIter.First(); + while( pFrm ) { - if ( pLast->ISA(SwFrm) ) - { - SwFrm *pFrm = (SwFrm*)pLast; if( pFrm->getRootFrm() == pCheck->getRootFrm() ) { SwFrm *pTmp = pFrm->GetUpper(); @@ -1419,8 +1354,8 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) } } } - } - pLast = ++aIter; + + pFrm = aIter.Next(); } } @@ -1428,9 +1363,6 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) |* |* SwFtnBossFrm::InsertFtn() |* -|* Ersterstellung MA 26. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1706,9 +1638,6 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew ) |* |* SwFtnBossFrm::AppendFtn() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1941,9 +1870,6 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr ) |* |* SwFtnBossFrm::FindFtn() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -1958,14 +1884,12 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr ) GetNodes().GoNextSection( &aIdx, TRUE, FALSE ); if ( !pNd ) return 0; - SwClientIter aIter( *pNd ); - SwClient *pClient; - if ( 0 != (pClient = aIter.GoStart()) ) + SwIterator aIter( *pNd ); + SwFrm* pFrm = aIter.First(); + if( pFrm ) do { - if ( pClient->IsA( TYPE(SwFrm) ) ) - { - SwFrm *pFrm = ((SwFrm*)pClient)->GetUpper(); + pFrm = pFrm->GetUpper(); // #i28500#, #i27243# Due to the endnode collector, there are // SwFtnFrms, which are not in the layout. Therefore the // bInfFtn flags are not set correctly, and a cell of FindFtnFrm @@ -1983,8 +1907,8 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr ) pFtn = pFtn->GetMaster(); return pFtn; } - } - } while ( 0 != (pClient = aIter++) ); + + } while ( 0 != (pFrm = aIter.Next()) ); return 0; } @@ -1992,9 +1916,6 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr ) |* |* SwFtnBossFrm::RemoveFtn() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2026,9 +1947,6 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr, |* |* SwFtnBossFrm::ChangeFtnRef() |* -|* Ersterstellung MA 25. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2047,9 +1965,6 @@ void SwFtnBossFrm::ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *pAttr, |* |* SwFtnBossFrm::CollectFtns() |* -|* Ersterstellung MA 24. Jul. 95 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2115,9 +2030,6 @@ void SwFtnBossFrm::CollectFtns( const SwCntntFrm* _pRef, |* |* SwFtnBossFrm::_CollectFtns() |* -|* Ersterstellung MA 24. Jul. 95 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ inline void FtnInArr( SvPtrarr& rFtnArr, SwFtnFrm* pFtn ) { @@ -2277,9 +2189,6 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef, |* |* SwFtnBossFrm::_MoveFtns() |* -|* Ersterstellung MA 26. Feb. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2495,9 +2404,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc ) |* |* SwFtnBossFrm::MoveFtns() |* -|* Ersterstellung BP 05. Aug. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2543,9 +2449,6 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest, |* |* SwFtnBossFrm::RearrangeFtns() |* -|* Ersterstellung MA 20. Jan. 94 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ @@ -2787,9 +2690,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock, |* |* SwPageFrm::UpdateFtnNum() |* -|* Ersterstellung MA 02. Mar. 93 -|* Letzte Aenderung AMA 29. Oct. 98 -|* |*************************************************************************/ void SwPageFrm::UpdateFtnNum() @@ -2852,9 +2752,6 @@ void SwPageFrm::UpdateFtnNum() |* |* SwFtnBossFrm::SetFtnDeadLine() |* -|* Ersterstellung MA 02. Aug. 93 -|* Letzte Aenderung MA 16. Nov. 98 -|* |*************************************************************************/ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine ) @@ -2889,9 +2786,6 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine ) |* |* SwFtnBossFrm::GetVarSpace() |* -|* Ersterstellung MA 03. Apr. 95 -|* Letzte Aenderung MA 16. Nov. 98 -|* |*************************************************************************/ SwTwips SwFtnBossFrm::GetVarSpace() const { @@ -2977,9 +2871,6 @@ SwTwips SwFtnBossFrm::GetVarSpace() const |* gibt und die Fussnoten nicht vom Bereich eingesammelt werden, ist ein Adjust.., |* ansonsten ein Grow/Shrink notwendig. |* -|* Ersterstellung AMA 09. Dec 98 -|* Letzte Aenderung AMA 09. Dec 98 -|* |*************************************************************************/ BYTE SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const @@ -3015,9 +2906,6 @@ BYTE SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const |* |* SwPageFrm::SetColMaxFtnHeight() |* -|* Ersterstellung AMA 29. Oct 98 -|* Letzte Aenderung AMA 29. Oct 98 -|* |*************************************************************************/ void SwPageFrm::SetColMaxFtnHeight() { @@ -3037,9 +2925,6 @@ void SwPageFrm::SetColMaxFtnHeight() |* |* SwLayoutFrm::MoveLowerFtns |* -|* Ersterstellung MA 01. Sep. 94 -|* Letzte Aenderung MA 05. Sep. 95 -|* |*************************************************************************/ @@ -3135,9 +3020,6 @@ BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss, |* |* SwLayoutFrm::MoveFtnCntFwd() |* -|* Ersterstellung MA 24. Nov. 94 -|* Letzte Aenderung MA 15. Jun. 95 -|* |*************************************************************************/ @@ -3277,9 +3159,6 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss ) |* |* class SwSaveFtnHeight |* -|* Ersterstellung MA 19. Jan. 94 -|* Letzte Aenderung MA 19. Jan. 94 -|* |*************************************************************************/ diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 8155c7503cc8..88659af6f74c 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -710,7 +710,7 @@ void SwPageFrm::PrepareHeader() if ( !pLay ) return; - const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader(); + const SwFmtHeader &rH = ((SwFrmFmt*)GetRegisteredIn())->GetHeader(); const ViewShell *pSh = getRootFrm()->GetCurrShell(); const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); @@ -759,7 +759,7 @@ void SwPageFrm::PrepareFooter() if ( !pLay ) return; - const SwFmtFooter &rF = ((SwFrmFmt*)pRegisteredIn)->GetFooter(); + const SwFmtFooter &rF = ((SwFrmFmt*)GetRegisteredIn())->GetFooter(); while ( pLay->GetNext() ) pLay = (SwLayoutFrm*)pLay->GetNext(); diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx index 2b980612a98c..7ad0464a75c8 100644 --- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx +++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx @@ -29,11 +29,10 @@ #include "precompiled_sw.hxx" #include #include -// --> OD 2004-10-05 #i26945# #include #include #include -// <-- +#include SwMovedFwdFrmsByObjPos::SwMovedFwdFrmsByObjPos() { @@ -86,10 +85,8 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm const NodeMapEntry& rEntry = *(aIter); if ( rEntry.second >= nPageNumOfRow ) { - SwClientIter aFrmIter( *const_cast( rEntry.first ) ); - for( SwTxtFrm* pTxtFrm = (SwTxtFrm*)aFrmIter.First( TYPE(SwTxtFrm) ); - pTxtFrm; - pTxtFrm = (SwTxtFrm*)aFrmIter.Next() ) + SwIterator aFrmIter( *rEntry.first ); + for( SwTxtFrm* pTxtFrm = aFrmIter.First(); pTxtFrm; pTxtFrm = (SwTxtFrm*)aFrmIter.Next() ) { // --> OD 2004-12-03 #115759# - assure that found text frame // is the first one. diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 697f4abfaa96..1daf7f8554f8 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -555,7 +555,7 @@ SwRootFrm::~SwRootFrm() pTurbo = 0; if(pBlink) pBlink->FrmDelete( this ); - ((SwFrmFmt*)pRegisteredIn)->GetDoc()->DelFrmFmt( (SwFrmFmt*)pRegisteredIn ); + static_cast(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast(GetRegisteredInNonConst()) ); delete pDestroy; pDestroy = 0; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 828729d74a53..d49ea386303f 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -74,9 +74,8 @@ #include "poolfmt.hxx" #include #include // SwFontAccess -// OD 2004-05-24 #i28701# #include - +#include #include using namespace ::com::sun::star; @@ -456,12 +455,10 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage ) } else { - SwClientIter aIter( *pFmt ); - SwClient *pTmp = aIter.First( TYPE(SwFrm) ); - SwFlyFrm *pFly; - if ( pTmp ) + SwIterator aIter( *pFmt ); + SwFlyFrm *pFly = aIter.First(); + if ( pFly) { - pFly = (SwFlyFrm*)pTmp; if( pFly->GetAnchorFrm() ) pFly->AnchorFrm()->RemoveFly( pFly ); } @@ -531,7 +528,7 @@ void SwPageFrm::PreparePage( BOOL bFtn ) |* Letzte Aenderung MA 03. Mar. 96 |* |*************************************************************************/ -void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { ViewShell *pSh = getRootFrm()->GetCurrShell(); if ( pSh ) @@ -578,7 +575,7 @@ void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) } } -void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, +void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { @@ -1677,13 +1674,13 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage ) //Umhaengen kann er sich selbst, indem wir ihm //einfach ein Modify mit seinem AnkerAttr schicken. #ifndef DBG_UTIL - rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch ); + rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch ); #else const sal_uInt32 nCnt = pPage->GetSortedObjs()->Count(); - rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch ); + rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch ); ASSERT( !pPage->GetSortedObjs() || nCnt != pPage->GetSortedObjs()->Count(), - "Kann das Obj nicht umhaengen." ); + "Object couldn't be reattached!" ); #endif --i; } diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 0120fb8fb990..87f9259b8292 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -50,6 +50,7 @@ #include #include // fuer GetAttrPool #include +#include /************************************************************************* |* @@ -257,20 +258,18 @@ void SwPageDesc::RegisterChange() nRegHeight = 0; { - SwClientIter aIter( GetMaster() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) + SwIterator aIter( GetMaster() ); + for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( ((SwFrm*)pLast)->IsPageFrm() ) + if( pLast->IsPageFrm() ) ((SwPageFrm*)pLast)->PrepareRegisterChg(); } } { - SwClientIter aIter( GetLeft() ); - for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast; - pLast = aIter.Next() ) + SwIterator aIter( GetLeft() ); + for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( ((SwFrm*)pLast)->IsPageFrm() ) + if( pLast->IsPageFrm() ) ((SwPageFrm*)pLast)->PrepareRegisterChg(); } } @@ -288,10 +287,10 @@ void SwPageDesc::RegisterChange() *************************************************************************/ -void SwPageDesc::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - SwModify::Modify( pOld, pNew ); + NotifyClients( pOld, pNew ); if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich) || isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) ) @@ -343,14 +342,12 @@ const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd, const SwPageDesc* pPd = bCheckForThisPgDc ? this : ((SwPageFrm*)pChkFrm)->GetPageDesc(); pRet = &pPd->GetMaster(); - ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd, - "Falcher Node fuers erkennen des Seitenformats" ); + ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd, "Wrong node for detection of page format!" ); // an welchem Format haengt diese Seite? - if( pRet != pChkFrm->GetRegisteredIn() ) + if( !pChkFrm->KnowsFormat(*pRet) ) { pRet = &pPd->GetLeft(); - ASSERT( pRet == pChkFrm->GetRegisteredIn(), - "Falcher Node fuers erkennen des Seitenformats" ); + ASSERT( pChkFrm->KnowsFormat(*pRet), "Wrong node for detection of page format!" ); } } else diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 2b1a1a5373bb..9ccf2f44061f 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -29,10 +29,7 @@ #include "precompiled_sw.hxx" #include - - #include - #include #include #define _SVSTDARR_LONGS @@ -44,14 +41,11 @@ #include #include #include -// --> collapsing borders FME 2005-05-27 #i29550# #include -// <-- #include #include #include - - +#include #include #include #include @@ -83,35 +77,23 @@ #include #include #include -#ifndef _LINEINFO_HXX #include -#endif #include #include -// OD 20.12.2002 #94627# -#ifndef _DOCSH_HXX #include -#endif -// OD 28.02.2003 #b4779636#, #107692# #include -// OD 02.07.2003 #108784# #include -// OD 2004-05-24 #i28701# #include - -// --> FME 2004-06-08 #i12836# enhanced pdf export #include -// <-- - #include #include - #include #include +#include + #define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230) #define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200) #define COL_NOTES_SIDEPANE_SCROLLAREA RGB_COLORDATA(230,230,220) -#include using namespace ::com::sun::star; @@ -6614,10 +6596,10 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) { Graphic aRet; //irgendeinen Fly suchen! - SwClientIter aIter( *this ); - SwClient *pFirst = aIter.First( TYPE(SwFrm) ); + SwIterator aIter( *this ); + SwFrm *pFirst = aIter.First(); ViewShell *pSh; - if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->getRootFrm()->GetCurrShell()) ) + if ( pFirst && 0 != ( pSh = pFirst->getRootFrm()->GetCurrShell()) ) { ViewShell *pOldGlobal = pGlobalShell; pGlobalShell = pSh; diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index b64ab79a3e37..32aed8691795 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2442,7 +2442,7 @@ void SwSectionFrm::CalcEndAtEndFlag() |* |*************************************************************************/ -void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BYTE nInvFlags = 0; @@ -2477,7 +2477,14 @@ void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) } } -void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, +void SwSectionFrm::SwClientNotify( SwModify*, USHORT nWhich ) +{ + if ( nWhich == RES_OBJECTDYING ) + SwSectionFrm::MoveCntntAndDelete( this, TRUE ); +} + + +void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx index 4d487a2506ad..fe981d2e3b0a 100644 --- a/sw/source/core/layout/softpagebreak.cxx +++ b/sw/source/core/layout/softpagebreak.cxx @@ -35,12 +35,12 @@ #include "frmfmt.hxx" #include "rowfrm.hxx" #include "tabfrm.hxx" +#include "switerator.hxx" void SwTxtNode::fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const { - SwClientIter aIter( const_cast(*this) ); - for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) ); - pFrm; pFrm = (const SwTxtFrm*)aIter.Next() ) + SwIterator aIter( *this ); + for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { // No soft page break in header or footer if( pFrm->FindFooterOrHeader() || pFrm->IsInFly() ) @@ -110,13 +110,12 @@ bool SwTableLine::hasSoftPageBreak() const // No soft page break for sub tables if( GetUpper() || !GetFrmFmt() ) return false; - SwClientIter aIter( *GetFrmFmt() ); - for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; - pLast = aIter.Next() ) + SwIterator aIter( *GetFrmFmt() ); + for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( ((SwRowFrm*)pLast)->GetTabLine() == this ) + if( pLast->GetTabLine() == this ) { - const SwTabFrm* pTab = static_cast(pLast)->FindTabFrm(); + const SwTabFrm* pTab = pLast->FindTabFrm(); // No soft page break for // tables with prevs, i.e. if the frame is not the first in its layout frame // tables in footer or header diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 33e971b63e85..a2a3aab06f26 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include #include #include #include @@ -53,10 +53,9 @@ #include #include #include - -// OD 2004-05-24 #i28701# #include #include +#include // No inline cause we need the function pointers long SwFrm::GetTopMargin() const @@ -216,7 +215,7 @@ void SwFrm::SetRightLeftMargins( long nRight, long nLeft) const USHORT nMinVertCellHeight = 1135; -/*-----------------11.9.2001 11:11------------------ +/*----------------------------------- * SwFrm::CheckDirChange(..) * checks the layout direction and * invalidates the lower frames rekursivly, if necessary. @@ -315,7 +314,7 @@ void SwFrm::CheckDirChange() } } -/*-----------------13.9.2002 11:11------------------ +/*----------------------------------- * SwFrm::GetFrmAnchorPos(..) * returns the position for anchors based on frame direction * --------------------------------------------------*/ @@ -360,12 +359,8 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const |* |* SwFrm::~SwFrm() |* -|* Ersterstellung MA 02. Mar. 94 -|* Letzte Aenderung MA 25. Jun. 95 -|* |*************************************************************************/ - SwFrm::~SwFrm() { // accessible objects for fly and cell frames have been already disposed @@ -417,8 +412,6 @@ SwFrm::~SwFrm() /************************************************************************* |* |* SwLayoutFrm::SetFrmFmt() -|* Ersterstellung MA 22. Apr. 93 -|* Letzte Aenderung MA 02. Nov. 94 |* |*************************************************************************/ @@ -430,7 +423,7 @@ void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew ) SwFmtChg aOldFmt( GetFmt() ); pNew->Add( this ); SwFmtChg aNewFmt( pNew ); - Modify( &aOldFmt, &aNewFmt ); + ModifyNotification( &aOldFmt, &aNewFmt ); } } @@ -449,7 +442,7 @@ SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) : SwCntntFrm::~SwCntntFrm() { SwCntntNode* pCNd; - if( 0 != ( pCNd = PTR_CAST( SwCntntNode, pRegisteredIn )) && + if( 0 != ( pCNd = PTR_CAST( SwCntntNode, GetRegisteredIn() )) && !pCNd->GetDoc()->IsInDtor() ) { //Bei der Root abmelden wenn ich dort noch im Turbo stehe. @@ -486,13 +479,70 @@ SwCntntFrm::~SwCntntFrm() } } +void SwCntntFrm::RegisterToNode( SwCntntNode& rNode ) +{ + rNode.Add( this ); +} + +void SwCntntFrm::DelFrms( const SwCntntNode& rNode ) +{ + SwIterator aIter( rNode ); + for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) + { + // --> OD 2005-12-01 #i27138# + // notify accessibility paragraphs objects about changed + // CONTENT_FLOWS_FROM/_TO relation. + // Relation CONTENT_FLOWS_FROM for current next paragraph will change + // and relation CONTENT_FLOWS_TO for current previous paragraph will change. + if ( pFrm->IsTxtFrm() ) + { + ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); + if ( pViewShell && pViewShell->GetLayout() && + pViewShell->GetLayout()->IsAnyShellAccessible() ) + { + pViewShell->InvalidateAccessibleParaFlowRelation( + dynamic_cast(pFrm->FindNextCnt( true )), + dynamic_cast(pFrm->FindPrevCnt( true )) ); + } + } + // <-- + if( pFrm->HasFollow() ) + pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() ); + if( pFrm->IsFollow() ) + { + SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster(); + pMaster->SetFollow( pFrm->GetFollow() ); + pFrm->_SetIsFollow( FALSE ); + } + pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt. + //Andernfalls kann es sein, dass ein Follow + //vor seinem Master zerstoert wird, der Master + //greift dann ueber den ungueltigen + //Follow-Pointer auf fremdes Memory zu. + //Die Kette darf hier zerknauscht werden, weil + //sowieso alle zerstoert werden. + if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() && + !pFrm->GetIndPrev() ) + { + SwFtnFrm *pFtn = pFrm->FindFtnFrm(); + ASSERT( pFtn, "You promised a FtnFrm?" ); + SwCntntFrm* pCFrm; + if( !pFtn->GetFollow() && !pFtn->GetMaster() && + 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) + { + ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); + ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); + } + } + pFrm->Cut(); + delete pFrm; + } +} + /************************************************************************* |* |* SwLayoutFrm::~SwLayoutFrm |* -|* Ersterstellung AK 28-Feb-1991 -|* Letzte Aenderung MA 11. Jan. 95 -|* |*************************************************************************/ @@ -584,9 +634,6 @@ SwLayoutFrm::~SwLayoutFrm() |* |* SwFrm::PaintArea() |* -|* Created AMA 08/22/2000 -|* Last change AMA 08/23/2000 -|* |* The paintarea is the area, in which the content of a frame is allowed |* to be displayed. This region could be larger than the printarea (Prt()) |* of the upper, it includes e.g. often the margin of the page. @@ -687,9 +734,6 @@ const SwRect SwFrm::PaintArea() const |* |* SwFrm::UnionFrm() |* -|* Created AMA 08/22/2000 -|* Last change AMA 08/23/2000 -|* |* The unionframe is the framearea (Frm()) of a frame expanded by the |* printarea, if there's a negative margin at the left or right side. |* diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 8e8c573b6cf3..1297b12c0fd2 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -45,7 +45,6 @@ #include "viewopt.hxx" #include "hints.hxx" #include "dbg_lay.hxx" - #include #include #include @@ -53,9 +52,7 @@ #include #include #include -// --> collapsing borders FME 2005-05-27 #i29550# #include -// <-- #include #include #include @@ -65,7 +62,6 @@ #include #include #include - #include "tabfrm.hxx" #include "rowfrm.hxx" #include "cellfrm.hxx" @@ -73,15 +69,11 @@ #include "txtfrm.hxx" //HasFtn() #include "htmltbl.hxx" #include "sectfrm.hxx" //SwSectionFrm -// OD 30.09.2003 #i18732# #include -// --> OD 2004-06-28 #i28701# #include #include -// <-- -// --> OD 2004-10-05 #i26945# #include -// <-- +#include extern void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, SwFrm *pFrm, SwPageFrm *pPage ); @@ -219,8 +211,6 @@ void SwTabFrm::RegistFlys() |* Some prototypes |*************************************************************************/ void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom ); -bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm *pLay, const SwLayoutFrm* pDontLeave, - long nBottom, bool bSkipRowSpanCells ); void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom ); BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva ); // --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control @@ -1543,7 +1533,7 @@ void lcl_InvalidateAllLowersPrt( SwLayoutFrm* pLayFrm ) } // <-- collapsing -bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, +bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, long nBottom, bool bSkipRowSpanCells ) { if ( !pLay ) @@ -1596,7 +1586,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav ASSERT( !pCnt->IsTxtFrm() || pCnt->IsValid() || static_cast(pCnt)->IsJoinLocked(), - " - text frame invalid and not locked." ); + " - text frame invalid and not locked." ); if ( pCnt->IsTxtFrm() && pCnt->IsValid() ) { // --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame to @@ -1621,7 +1611,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav } #if OSL_DEBUG_LEVEL > 1 - ASSERT( false, "LoopControl in lcl_CalcLowers" ) + ASSERT( false, "LoopControl in SwCntntFrm::CalcLowers" ) #endif } } @@ -1728,7 +1718,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom ) { // --> OD 2004-11-23 #115759# - force another format of the // lowers, if at least one of it was invalid. - bCheck = lcl_CalcLowers( &rRow, rRow.GetUpper(), nBottom, true ); + bCheck = SwCntntFrm::CalcLowers( &rRow, rRow.GetUpper(), nBottom, true ); // <-- // NEW TABLES @@ -1748,7 +1738,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom ) SwCellFrm& rToRecalc = 0 == i ? const_cast(pCellFrm->FindStartEndOfRowSpanCell( true, true )) : *pCellFrm; - bCheck |= lcl_CalcLowers( &rToRecalc, &rToRecalc, nBottom, false ); + bCheck |= SwCntntFrm::CalcLowers( &rToRecalc, &rToRecalc, nBottom, false ); } pCellFrm = static_cast(pCellFrm->GetNext()); @@ -3271,7 +3261,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) |* Letzte Aenderung MA 06. Dec. 96 |* |*************************************************************************/ -void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BYTE nInvFlags = 0; BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which(); @@ -3336,7 +3326,7 @@ void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) } } -void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, +void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { @@ -3921,7 +3911,7 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage ) |* Letzte Aenderung MA 12. Nov. 97 |* |*************************************************************************/ -void SwRowFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which(); const SfxPoolItem *pItem = 0; @@ -4401,13 +4391,9 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs ) // If we found a 'previous' row, we look for the appropriate row frame: if ( pPrevTabLine ) { - SwClientIter aIter( *pPrevTabLine->GetFrmFmt() ); - SwClient* pLast; - for ( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + SwIterator aIter( *pPrevTabLine->GetFrmFmt() ); + for ( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() ) { - ASSERT( ((SwFrm*)pLast)->IsRowFrm(), - "Non-row frame registered in table line" ) - SwRowFrm* pRow = (SwRowFrm*)pLast; // --> OD 2004-11-23 #115759# - do *not* take repeated // headlines, because during split of table it can be // invalid and thus can't provide correct border values. @@ -5441,7 +5427,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs ) |* |*************************************************************************/ -void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which(); const SfxPoolItem *pItem = 0; diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 5a8c8b00d7c9..7b8783b30273 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -118,6 +118,16 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) : bCompletePaint = bInfInvalid = TRUE; } +bool SwFrm::KnowsFormat( const SwFmt& rFmt ) const +{ + return GetRegisteredIn() == &rFmt; +} + +void SwFrm::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse ) { if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) ) @@ -232,15 +242,8 @@ void SwTxtFrm::CheckDirection( BOOL bVert ) sal_True, bBrowseMode ); } -/************************************************************************* -|* -|* SwFrm::Modify() -|* -|* Ersterstellung AK 01-Mar-1991 -|* Letzte Aenderung MA 20. Jun. 96 -|* -|*************************************************************************/ -void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +/*************************************************************************/ +void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BYTE nInvFlags = 0; @@ -289,7 +292,7 @@ void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) } } -void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew, +void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -2122,7 +2125,7 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo ) |* Letzte Aenderung MA 13. Oct. 95 |* |*************************************************************************/ -void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) +void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { BYTE nInvFlags = 0; @@ -2195,7 +2198,7 @@ void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew ) } } -void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew, +void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index 0509c14f5733..a67cca8c1796 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -83,7 +83,7 @@ SwFmtDrop::SwFmtDrop() SwFmtDrop::SwFmtDrop( const SwFmtDrop &rCpy ) : SfxPoolItem( RES_PARATR_DROP ), - SwClient( rCpy.pRegisteredIn ), + SwClient( rCpy.GetRegisteredInNonConst() ), pDefinedIn( 0 ), nDistance( rCpy.GetDistance() ), nReadFmt( rCpy.nReadFmt ), @@ -104,8 +104,8 @@ SwFmtDrop::~SwFmtDrop() void SwFmtDrop::SetCharFmt( SwCharFmt *pNew ) { //Ummelden - if ( pRegisteredIn ) - pRegisteredIn->Remove( this ); + if ( GetRegisteredIn() ) + GetRegisteredInNonConst()->Remove( this ); if(pNew) pNew->Add( this ); nReadFmt = USHRT_MAX; @@ -113,26 +113,19 @@ void SwFmtDrop::SetCharFmt( SwCharFmt *pNew ) -void SwFmtDrop::Modify( SfxPoolItem *, SfxPoolItem * ) +void SwFmtDrop::Modify( const SfxPoolItem*, const SfxPoolItem * ) { if( pDefinedIn ) { if( !pDefinedIn->ISA( SwFmt )) - pDefinedIn->Modify( this, this ); + pDefinedIn->ModifyNotification( this, this ); else if( pDefinedIn->GetDepends() && !pDefinedIn->IsModifyLocked() ) { // selbst den Abhaengigen vom Format bescheid sagen. Das // Format selbst wuerde es nicht weitergeben, weil es ueber // die Abpruefung nicht hinauskommt. - SwClientIter aIter( *pDefinedIn ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do { - pLast->Modify( this, this ); - if( !pDefinedIn->GetDepends() ) // Baum schon Weg ?? - break; - } while( 0 != ( pLast = aIter++ )); + pDefinedIn->ModifyBroadcast( this, this ); } } } diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index 2f7d65cf1e1d..7c3bc0d44f28 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #ifndef DBG_UTIL #define CHECK_TABLE(t) @@ -591,11 +592,9 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const void lcl_InvalidateCellFrm( const SwTableBox& rBox ) { - SwClientIter aIter( *rBox.GetFrmFmt() ); - SwClient* pLast; - for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + SwIterator aIter( *rBox.GetFrmFmt() ); + for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() ) { - SwCellFrm *pCell = (SwCellFrm*)pLast; if( pCell->GetTabBox() == &rBox ) { pCell->InvalidateSize(); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 281aac016e43..769a40410cf0 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -28,10 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#ifdef WTC -#define private public -#endif - #include #include #include @@ -42,8 +38,6 @@ #include #include #include - - #include #include #include @@ -72,6 +66,7 @@ #include #include #include +#include #ifndef DBG_UTIL #define CHECK_TABLE(t) @@ -267,9 +262,6 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd, |* |* SwTable::SwTable() |* -|* Ersterstellung MA 09. Mar. 93 -|* Letzte Aenderung MA 05. May. 93 -|* |*************************************************************************/ SwTable::SwTable( SwTableFmt* pFmt ) : SwClient( pFmt ), @@ -331,14 +323,10 @@ SwTable::~SwTable() delete pHTMLLayout; } - /************************************************************************* |* |* SwTable::Modify() |* -|* Ersterstellung JP ?? -|* Letzte Aenderung MA 06. May. 93 -|* |*************************************************************************/ inline void FmtInArr( SvPtrarr& rFmtArr, SwFmt* pBoxFmt ) { @@ -415,7 +403,7 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, } } -void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { // fange SSize Aenderungen ab, um die Lines/Boxen anzupassen USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; @@ -432,6 +420,8 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) pOldSize = (const SwFmtFrmSize*)pOld; pNewSize = (const SwFmtFrmSize*)pNew; } + else + CheckRegistration( pOld, pNew ); if( pOldSize || pNewSize ) { @@ -443,8 +433,6 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) AdjustWidths( pOldSize->GetWidth(), pNewSize->GetWidth() ); } } - else - SwClient::Modify( pOld, pNew ); // fuers ObjectDying } void SwTable::AdjustWidths( const long nOld, const long nNew ) @@ -457,9 +445,6 @@ void SwTable::AdjustWidths( const long nOld, const long nNew ) |* |* SwTable::GetTabCols() |* -|* Ersterstellung MA 04. May. 93 -|* Letzte Aenderung MA 30. Nov. 95 -|* |*************************************************************************/ void lcl_RefreshHidden( SwTabCols &rToFill, USHORT nPos ) { @@ -711,9 +696,6 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart, |* |* SwTable::SetTabCols() |* -|* Ersterstellung MA 04. May. 93 -|* Letzte Aenderung MA 26. Aug. 98 -|* |*************************************************************************/ //Struktur zur Parameteruebergabe struct Parm @@ -1407,9 +1389,6 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew, |* const SwTableBox* SwTable::GetTblBox( const Strn?ng& rName ) const |* gebe den Pointer auf die benannte Box zurueck. |* -|* Ersterstellung JP 30. Jun. 93 -|* Letzte Aenderung JP 30. Jun. 93 -|* |*************************************************************************/ BOOL IsValidRowName( const String& rStr ) @@ -1560,8 +1539,7 @@ SwTableBox* SwTable::GetTblBox( ULONG nSttIdx ) pModify = pTblNd->GetTable().GetFrmFmt(); // <-- - SwClientIter aIter( *pModify ); - SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); + SwFrm* pFrm = SwIterator::FirstElement( *pModify ); while ( pFrm && !pFrm->IsCellFrm() ) pFrm = pFrm->GetUpper(); if ( pFrm ) @@ -1595,9 +1573,6 @@ BOOL SwTable::IsTblComplex() const |* |* SwTableLine::SwTableLine() |* -|* Ersterstellung MA 09. Mar. 93 -|* Letzte Aenderung MA 09. Mar. 93 -|* |*************************************************************************/ SwTableLine::SwTableLine( SwTableLineFmt *pFmt, USHORT nBoxes, SwTableBox *pUp ) @@ -1621,55 +1596,51 @@ SwTableLine::~SwTableLine() |* |* SwTableLine::ClaimFrmFmt(), ChgFrmFmt() |* -|* Ersterstellung MA 03. May. 93 -|* Letzte Aenderung MA 07. Feb. 96 -|* |*************************************************************************/ SwFrmFmt* SwTableLine::ClaimFrmFmt() { - //Wenn noch andere TableLines ausser mir selbst an dem FrmFmt haengen, - //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich - //bei diesem anzumelden. - SwTableLineFmt *pOld = (SwTableLineFmt*)GetFrmFmt(); - SwClientIter aIter( *pOld ); - - SwClient* pLast; - - for( pLast = aIter.First( TYPE( SwTableLine )); pLast && pLast == this; - pLast = aIter.Next() ) - ; - - if( pLast ) - { - SwTableLineFmt *pNewFmt = pOld->GetDoc()->MakeTableLineFmt(); - *pNewFmt = *pOld; - - //Erstmal die Frms ummelden. - for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) - if( ((SwRowFrm*)pLast)->GetTabLine() == this ) - pNewFmt->Add( pLast ); - - //Jetzt noch mich selbst ummelden. - pNewFmt->Add( this ); - pOld = pNewFmt; + // This method makes sure that this object is an exclusive SwTableLine client + // of an SwTableLineFmt object + // If other SwTableLine objects currently listen to the same SwTableLineFmt as + // this one, something needs to be done + SwTableLineFmt *pRet = (SwTableLineFmt*)GetFrmFmt(); + SwIterator aIter( *pRet ); + for( SwTableLine* pLast = aIter.First(); pLast; pLast = aIter.Next() ) + { + if ( pLast != this ) + { + // found another SwTableLine that is a client of the current Fmt + // create a new Fmt as a copy and use it for this object + SwTableLineFmt *pNewFmt = pRet->GetDoc()->MakeTableLineFmt(); + *pNewFmt = *pRet; + + // register SwRowFrms that know me as clients at the new Fmt + SwIterator aFrmIter( *pRet ); + for( SwRowFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() ) + if( pFrm->GetTabLine() == this ) + pFrm->RegisterToFormat( *pNewFmt ); + + // register myself + pNewFmt->Add( this ); + pRet = pNewFmt; + break; + } } - return pOld; + return pRet; } void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt ) { SwFrmFmt *pOld = GetFrmFmt(); - SwClientIter aIter( *pOld ); - SwClient* pLast; + SwIterator aIter( *pOld ); //Erstmal die Frms ummelden. - for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + for( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() ) { - SwRowFrm *pRow = (SwRowFrm*)pLast; if( pRow->GetTabLine() == this ) { - pNewFmt->Add( pLast ); + pRow->RegisterToFormat( *pNewFmt ); pRow->InvalidateSize(); pRow->_InvalidatePrt(); @@ -1700,7 +1671,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt ) //Jetzt noch mich selbst ummelden. pNewFmt->Add( this ); - if ( !aIter.GoStart() ) + if ( !pOld->GetDepends() ) delete pOld; } @@ -1708,16 +1679,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const { SwTwips nRet = 0; bLayoutAvailable = false; - SwClientIter aIter( *GetFrmFmt() ); + SwIterator aIter( *GetFrmFmt() ); // A row could appear several times in headers/footers so only one chain of master/follow tables // will be accepted... const SwTabFrm* pChain = NULL; // My chain - for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; - pLast = aIter.Next() ) + for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( ((SwRowFrm*)pLast)->GetTabLine() == this ) + if( pLast->GetTabLine() == this ) { - const SwTabFrm* pTab = static_cast(pLast)->FindTabFrm(); + const SwTabFrm* pTab = pLast->FindTabFrm(); bLayoutAvailable = ( pTab && pTab->IsVertical() ) ? ( 0 < pTab->Frm().Height() ) : ( 0 < pTab->Frm().Width() ); @@ -1728,15 +1698,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const { pChain = pTab; // defines my chain (even it is already) if( pTab->IsVertical() ) - nRet += static_cast(pLast)->Frm().Width(); + nRet += pLast->Frm().Width(); else - nRet += static_cast(pLast)->Frm().Height(); + nRet += pLast->Frm().Height(); // Optimization, if there are no master/follows in my chain, nothing more to add if( !pTab->HasFollow() && !pTab->IsFollow() ) break; // This is not an optimization, this is necessary to avoid double additions of // repeating rows - if( pTab->IsInHeadline( *static_cast(pLast) ) ) + if( pTab->IsInHeadline(*pLast) ) break; } } @@ -1748,9 +1718,6 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const |* |* SwTableBox::SwTableBox() |* -|* Ersterstellung MA 04. May. 93 -|* Letzte Aenderung MA 04. May. 93 -|* |*************************************************************************/ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, USHORT nLines, SwTableLine *pUp ) : SwClient( 0 ), @@ -1832,7 +1799,7 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt ) if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) || SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, FALSE ) ) { - SwClient* pOther = SwClientIter( *pFmt ).First( TYPE( SwTableBox )); + SwTableBox* pOther = SwIterator::FirstElement( *pFmt ); if( pOther ) { SwTableBoxFmt* pNewFmt = pFmt->GetDoc()->MakeTableBoxFmt(); @@ -1853,59 +1820,54 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt ) |* |* SwTableBox::ClaimFrmFmt(), ChgFrmFmt() |* -|* Ersterstellung MA 04. May. 93 -|* Letzte Aenderung MA 07. Feb. 96 -|* |*************************************************************************/ SwFrmFmt* SwTableBox::ClaimFrmFmt() { - //Wenn noch andere TableBoxen ausser mir selbst an dem FrmFmt haengen, - //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich - //bei diesem anzumelden. - SwTableBoxFmt *pOld = (SwTableBoxFmt*)GetFrmFmt(); - SwClientIter aIter( *pOld ); - SwClient* pLast; - - for( pLast = aIter.First( TYPE( SwTableBox )); pLast && pLast == this; - pLast = aIter.Next() ) - ; - - if( pLast ) + // This method makes sure that this object is an exclusive SwTableBox client + // of an SwTableBoxFmt object + // If other SwTableBox objects currently listen to the same SwTableBoxFmt as + // this one, something needs to be done + SwTableBoxFmt *pRet = (SwTableBoxFmt*)GetFrmFmt(); + SwIterator aIter( *pRet ); + for( SwTableBox* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - SwTableBoxFmt* pNewFmt = pOld->GetDoc()->MakeTableBoxFmt(); - - pNewFmt->LockModify(); - *pNewFmt = *pOld; - - // Values und Formeln nie kopieren - pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE ); - pNewFmt->UnlockModify(); + if ( pLast != this ) + { + // Found another SwTableBox object + // create a new Fmt as a copy and assign me to it + // don't copy values and formulas + SwTableBoxFmt* pNewFmt = pRet->GetDoc()->MakeTableBoxFmt(); + pNewFmt->LockModify(); + *pNewFmt = *pRet; + pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE ); + pNewFmt->UnlockModify(); - //Erstmal die Frms ummelden. - for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) - if( ((SwCellFrm*)pLast)->GetTabBox() == this ) - pNewFmt->Add( pLast ); + // re-register SwCellFrm objects that know me + SwIterator aFrmIter( *pRet ); + for( SwCellFrm* pCell = aFrmIter.First(); pCell; pCell = aFrmIter.Next() ) + if( pCell->GetTabBox() == this ) + pCell->RegisterToFormat( *pNewFmt ); - //Jetzt noch mich selbst ummelden. - pNewFmt->Add( this ); - pOld = pNewFmt; + // re-register myself + pNewFmt->Add( this ); + pRet = pNewFmt; + break; + } } - return pOld; + return pRet; } void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt ) { SwFrmFmt *pOld = GetFrmFmt(); - SwClientIter aIter( *pOld ); - SwClient* pLast; + SwIterator aIter( *pOld ); //Erstmal die Frms ummelden. - for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() ) { - SwCellFrm *pCell = (SwCellFrm*)pLast; if( pCell->GetTabBox() == this ) { - pNewFmt->Add( pLast ); + pCell->RegisterToFormat( *pNewFmt ); pCell->InvalidateSize(); pCell->_InvalidatePrt(); pCell->SetCompletePaint(); @@ -1930,7 +1892,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt ) //Jetzt noch mich selbst ummelden. pNewFmt->Add( this ); - if( !aIter.GoStart() ) + if( !pOld->GetDepends() ) delete pOld; } @@ -1940,9 +1902,6 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt ) |* gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt |* und ergibt sich aus der Position in den Lines/Boxen/Tabelle |* -|* Ersterstellung JP 30. Jun. 93 -|* Letzte Aenderung JP 30. Jun. 93 -|* |*************************************************************************/ void lcl_GetTblBoxColStr( USHORT nCol, String& rNm ) { @@ -2053,8 +2012,7 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const case RES_CONTENT_VISIBLE: { - ((SwPtrMsgPoolItem&)rInfo).pObject = - SwClientIter( *GetFrmFmt() ).First( TYPE(SwFrm) ); + ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator::FirstElement( *GetFrmFmt() ); } return FALSE; } @@ -2064,7 +2022,7 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt ) { return (pFmt) - ? static_cast(SwClientIter(*pFmt).First( TYPE(SwTable) )) + ? SwIterator::FirstElement(*pFmt) : 0; } @@ -2303,7 +2261,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt ) } // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute) -void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !IsModifyLocked() && !IsInDocDTOR() ) { @@ -2355,8 +2313,8 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, FALSE ) ) { // die Box holen - SwClientIter aIter( *this ); - SwTableBox* pBox = (SwTableBox*)aIter.First( TYPE( SwTableBox ) ); + SwIterator aIter( *this ); + SwTableBox* pBox = aIter.First(); if( pBox ) { ASSERT( !aIter.Next(), "keine Box oder mehrere am Format" ); @@ -2541,21 +2499,6 @@ BOOL SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex, rFmtIndex = 0; bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum ); - -/* -// wie bekommt man aus dem neuen String den neuen Wert? -// denn der Numberformater erkennt aus "123.--DM" kein Zahlenformat! - if( !bRet && rFmtIndex && !pNumFmtr->IsTextFormat( rFmtIndex ) && - SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, - FALSE, &pItem )) - { - Color* pCol; - String sNewTxt; - pNumFmtr->GetOutputString( ((SwTblBoxValue*)pItem)->GetValue(), - rFmtIndex, sNewTxt, &pCol ); - bRet = aTxt == sNewTxt; - } -*/ } else rIsEmptyTxtNd = FALSE; @@ -2745,11 +2688,7 @@ public: void setTable(const SwTable * pTable) { m_pTable = pTable; SwFrmFmt * pFrmFmt = m_pTable->GetFrmFmt(); - SwClientIter aIter(*pFrmFmt); - - m_pTabFrm = - static_cast(aIter.First(TYPE(SwTabFrm))); - + m_pTabFrm = SwIterator::FirstElement(*pFrmFmt); if (m_pTabFrm->IsFollow()) m_pTabFrm = m_pTabFrm->FindMaster(true); } @@ -2883,3 +2822,26 @@ const SwTableBox * SwTableCellInfo::getTableBox() const return pRet; } + +void SwTable::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + +void SwTableLine::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + +void SwTableBox::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + +void SwTableBox::ForgetFrmFmt() +{ + if ( GetRegisteredIn() ) + GetRegisteredInNonConst()->Remove(this); +} + + diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 09c13b8fb250..3ee651997691 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -81,7 +81,7 @@ #include "i18npool/mslangid.hxx" #include #include - +#include #include #include @@ -1589,22 +1589,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() if ( pPDFExtOutDevData->GetIsExportNotes() ) { SwFieldType* pType = mrSh.GetFldType( RES_POSTITFLD, aEmptyStr ); - SwClientIter aIter( *pType ); - const SwClient * pFirst = aIter.GoStart(); - while( pFirst ) + SwIterator aIter( *pType ); + for( SwFmtFld* pFirst = aIter.First(); pFirst; ) { - if( ((SwFmtFld*)pFirst)->GetTxtFld() && - ((SwFmtFld*)pFirst)->IsFldInDoc()) + if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() ) { - const SwTxtNode* pTNd = - (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode(); + const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode(); ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" ) // 1. Check if the whole paragraph is hidden // 2. Move to the field // 3. Check for hidden text attribute if ( !pTNd->IsHidden() && - mrSh.GotoFld( *(SwFmtFld*)pFirst ) && + mrSh.GotoFld( *pFirst ) && !mrSh.SelectHiddenRange() ) { // Link Rectangle @@ -1618,7 +1615,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() vcl::PDFNote aNote; // Use the NumberFormatter to get the date string: - const SwPostItField* pField = (SwPostItField*)((SwFmtFld*)pFirst)->GetFld(); + const SwPostItField* pField = (SwPostItField*)pFirst->GetFld(); SvNumberFormatter* pNumFormatter = pDoc->GetNumberFormatter(); const Date aDateDiff( pField->GetDate() - *pNumFormatter->GetNullDate() ); @@ -1641,7 +1638,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() } } } - pFirst = aIter++; + pFirst = aIter.Next(); mrSh.SwCrsrShell::ClearMark(); } } @@ -1831,22 +1828,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // REFERENCES // SwFieldType* pType = mrSh.GetFldType( RES_GETREFFLD, aEmptyStr ); - SwClientIter aIter( *pType ); - const SwClient * pFirst = aIter.GoStart(); - while( pFirst ) + SwIterator aIter( *pType ); + for( SwFmtFld* pFirst = aIter.First(); pFirst; ) { - if( ((SwFmtFld*)pFirst)->GetTxtFld() && - ((SwFmtFld*)pFirst)->IsFldInDoc()) + if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() ) { - const SwTxtNode* pTNd = - (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode(); + const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode(); ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" ) // 1. Check if the whole paragraph is hidden // 2. Move to the field // 3. Check for hidden text attribute if ( !pTNd->IsHidden() && - mrSh.GotoFld( *(SwFmtFld*)pFirst ) && + mrSh.GotoFld( *pFirst ) && !mrSh.SelectHiddenRange() ) { // Select the field: @@ -1862,7 +1856,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // Destination Rectangle const SwGetRefField* pField = - (SwGetRefField*)((SwFmtFld*)pFirst)->GetFld(); + (SwGetRefField*)pFirst->GetFld(); const String& rRefName = pField->GetSetRefName(); mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() ); const SwRect& rDestRect = mrSh.GetCharRect(); @@ -1915,7 +1909,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() } } } - pFirst = aIter++; + pFirst = aIter.Next(); mrSh.SwCrsrShell::ClearMark(); } @@ -2175,15 +2169,10 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP // the offset of the link rectangle calculates as follows: const Point aOffset = rLinkRect.Pos() + mrOut.GetMapMode().GetOrigin(); - SwClientIter aClientIter( const_cast(rTNd) ); - SwClient* pLast = aClientIter.GoStart(); - - while( pLast ) - { - if ( pLast->ISA( SwTxtFrm ) ) + SwIterator aIter( rTNd ); + for ( SwTxtFrm* pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() ) { // Add offset to current page: - SwTxtFrm* pTmpFrm = static_cast(pLast); const SwPageFrm* pPageFrm = pTmpFrm->FindPageFrm(); SwRect aHFLinkRect( rLinkRect ); aHFLinkRect.Pos() = pPageFrm->Frm().Pos() + aOffset; @@ -2210,8 +2199,5 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP } } } - - pLast = ++aClientIter; - } } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 208d8a7ec9eb..02b5217593da 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -63,6 +63,7 @@ #include #include #include +#include using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; @@ -997,15 +998,10 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) nWidth = Max( nWidth, nProWidth ); // search for a text frame this node belongs to - SwClientIter aClientIter( *(SwTxtNode*)this ); - SwClient* pLastFrm = aClientIter.GoStart(); + SwIterator aFrmIter( *this ); SwTxtFrm* pFrm = 0; - - while( pLastFrm ) + for( SwTxtFrm* pTmpFrm = aFrmIter.First(); pTmpFrm; pTmpFrm = aFrmIter.Next() ) { - if ( pLastFrm->ISA( SwTxtFrm ) ) - { - SwTxtFrm* pTmpFrm = ( SwTxtFrm* )pLastFrm; if ( pTmpFrm->GetOfst() <= nStt && ( !pTmpFrm->GetFollow() || pTmpFrm->GetFollow()->GetOfst() > nStt ) ) @@ -1014,8 +1010,6 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) break; } } - pLastFrm = ++aClientIter; - } // search for the line containing nStt if ( pFrm && pFrm->HasPara() ) @@ -1056,16 +1050,12 @@ USHORT SwTxtNode::GetWidthOfLeadingTabs() const aPos.nContent += nIdx; // Find the non-follow text frame: - SwClientIter aClientIter( (SwTxtNode&)*this ); - SwClient* pLastFrm = aClientIter.GoStart(); - - while( pLastFrm ) + SwIterator aIter( *this ); + for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { // Only consider master frames: - if ( pLastFrm->ISA(SwTxtFrm) && - !static_cast(pLastFrm)->IsFollow() ) + if ( !pFrm->IsFollow() ) { - const SwTxtFrm* pFrm = static_cast(pLastFrm); SWRECTFN( pFrm ) SwRect aRect; pFrm->GetCharRect( aRect, aPos ); @@ -1075,7 +1065,6 @@ USHORT SwTxtNode::GetWidthOfLeadingTabs() const (aRect.*fnRect->fnGetLeft)() - (pFrm->*fnRect->fnGetPrtLeft)() ); break; } - pLastFrm = ++aClientIter; } } diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index dd2c1c3a1d38..f235ee704526 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -59,11 +59,8 @@ #include #include // SwRedlineTbl #include // SwRedline - -// --> FME 2004-06-08 #i12836# enhanced pdf export #include -// <-- - +#include #include #include #include @@ -2238,15 +2235,12 @@ USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray, SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd, sal_Bool bAllowInvalid ) { - SwClientIter aClientIter( (SwTxtNode&)rTNd ); - SwClient* pLast = aClientIter.GoStart(); + SwIterator aIter( rTNd ); SwScriptInfo* pScriptInfo = 0; - while( pLast ) + for( SwTxtFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if ( pLast->ISA( SwTxtFrm ) ) - { - pScriptInfo = (SwScriptInfo*)((SwTxtFrm*)pLast)->GetScriptInfo(); + pScriptInfo = (SwScriptInfo*)pLast->GetScriptInfo(); if ( pScriptInfo ) { if ( !bAllowInvalid && STRING_LEN != pScriptInfo->GetInvalidity() ) @@ -2254,8 +2248,6 @@ SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd, else break; } } - pLast = ++aClientIter; - } return pScriptInfo; } diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 3e67e1037dfe..9f759ccaade8 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -43,13 +43,12 @@ #include // SwSaveClip #include // pBlink #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif #include #include #include #include +#include using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; @@ -228,21 +227,19 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen } // get text frame - SwClientIter aClientIter( (SwTxtNode&)*this ); - SwClient* pLastFrm = aClientIter.GoStart(); - - while( pLastFrm ) + SwIterator aIter( *this ); + for( SwTxtFrm* pLastFrm = aIter.First(); pLastFrm; pLastFrm = aIter.Next() ) { // Only (master-) text frames can have a drop cap. - if ( pLastFrm->ISA( SwTxtFrm ) && !((SwTxtFrm*)pLastFrm)->IsFollow() ) + if ( !pLastFrm->IsFollow() ) { - if( !((SwTxtFrm*)pLastFrm)->HasPara() ) - ((SwTxtFrm*)pLastFrm)->GetFormatted(); + if( !pLastFrm->HasPara() ) + pLastFrm->GetFormatted(); - if ( !((SwTxtFrm*)pLastFrm)->IsEmpty() ) + if ( !pLastFrm->IsEmpty() ) { - const SwParaPortion* pPara = ((SwTxtFrm*)pLastFrm)->GetPara(); + const SwParaPortion* pPara = pLastFrm->GetPara(); ASSERT( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" ) if ( pPara ) @@ -265,7 +262,6 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen } break; } - pLastFrm = ++aClientIter; } if (rFontHeight==0 && rDropHeight==0 && rDropDescent==0) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 562682c73af3..e0f49a61fe3a 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -74,21 +74,16 @@ #include #include #include -// OD 2004-01-15 #110582# #include -// OD 2004-05-24 #i28701# #include -// --> OD 2005-03-30 #???# #include // SwTxtFlyCnt #include // SwFmtFlyCnt #include // SwFmtCntnt -// <-- -// --> OD 2008-01-31 #newlistlevelattrs# #include -// <-- #include #include #include +#include #if OSL_DEBUG_LEVEL > 1 #include // DbgRect @@ -905,7 +900,7 @@ void lcl_ModifyOfst( SwTxtFrm* pFrm, xub_StrLen nPos, xub_StrLen nLen ) * SwTxtFrm::Modify() *************************************************************************/ -void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { const MSHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -2754,3 +2749,18 @@ void SwTxtFrm::CalcBaseOfstForFly() mnFlyAnchorOfst = nRet1 - nLeft; mnFlyAnchorOfstNoWrap = nRet2 - nLeft; } + +/* repaint all text frames of the given text node */ +void SwTxtFrm::repaintTextFrames( const SwTxtNode& rNode ) +{ + SwIterator aIter( rNode ); + for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) + { + SwRect aRec( pFrm->PaintArea() ); + const SwRootFrm *pRootFrm = pFrm->getRootFrm(); + ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL; + if( pCurShell ) + pCurShell->InvalidateWindows( aRec ); + } +} + diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index bc3565216ae0..28a41ea7d364 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -28,9 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - #include #include #include @@ -39,22 +36,18 @@ #include #include #include -#ifndef _POOLFMT_HRC #include -#endif #include #include #include #include #include #include // SwPtrMsgPoolItem - -// -> #i21237# #include #include +#include using namespace std; -// <- #i21237# const sal_Char* SwForm::aFormEntry = ""; const sal_Char* SwForm::aFormTab = ""; @@ -81,9 +74,6 @@ SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*) TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti -/* -----------------23.09.99 13:59------------------- - - --------------------------------------------------*/ struct PatternIni { USHORT n1; @@ -126,14 +116,9 @@ const PatternIni aPatternIni[] = {AUTH_FIELD_AUTHOR, AUTH_FIELD_TITLE, AUTH_FIELD_YEAR, USHRT_MAX, USHRT_MAX}, //AUTH_FIELD_CUSTOM5, {USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX} }; -/* -----------------23.09.99 13:58------------------- - - --------------------------------------------------*/ -// -> #i21237# SwFormTokens lcl_GetAuthPattern(USHORT nTypeId) { - SwFormTokens aRet; // #i21237# - + SwFormTokens aRet; PatternIni aIni = aPatternIni[nTypeId]; USHORT nVals[5]; @@ -199,7 +184,7 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp ) SwTOXMark::SwTOXMark( const SwTOXMark& rCopy ) : SfxPoolItem( RES_TXTATR_TOXMARK ) - , SwModify(rCopy.pRegisteredIn) + , SwModify(rCopy.GetRegisteredInNonConst()) , aPrimaryKey( rCopy.aPrimaryKey ), aSecondaryKey( rCopy.aSecondaryKey ), aTextReading( rCopy.aTextReading ), @@ -219,6 +204,11 @@ SwTOXMark::~SwTOXMark() } +void SwTOXMark::RegisterToTOXType( SwTOXType& rMark ) +{ + rMark.Add(this); +} + int SwTOXMark::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); @@ -231,9 +221,9 @@ SfxPoolItem* SwTOXMark::Clone( SfxItemPool* ) const return new SwTOXMark( *this ); } -void SwTOXMark::Modify(SfxPoolItem* pOld, SfxPoolItem* pNew) +void SwTOXMark::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew) { - SwModify::Modify(pOld, pNew); + NotifyClients(pOld, pNew); if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) { // invalidate cached uno object SetXTOXMark(::com::sun::star::uno::Reference< @@ -245,7 +235,7 @@ void SwTOXMark::InvalidateTOXMark() { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &static_cast(*this) ); // cast to base class! - Modify(&aMsgHint, &aMsgHint); + NotifyClients(&aMsgHint, &aMsgHint); } String SwTOXMark::GetText() const @@ -266,6 +256,18 @@ String SwTOXMark::GetText() const return aStr; } +void SwTOXMark::InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType ) +{ + SwIterator aIter(rType); + SwTOXMark* pMark = aIter.First(); + while( pMark ) + { + if(pMark->GetTxtTOXMark()) + aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count()); + pMark = aIter.Next(); + } +} + /*-------------------------------------------------------------------- Beschreibung: Typen von Verzeichnissen verwalten --------------------------------------------------------------------*/ @@ -528,11 +530,16 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm, SwTOXBase::SwTOXBase( const SwTOXBase& rSource, SwDoc* pDoc ) - : SwClient( rSource.pRegisteredIn ) + : SwClient( rSource.GetRegisteredInNonConst() ) { CopyTOXBase( pDoc, rSource ); } +void SwTOXBase::RegisterToTOXType( SwTOXType& rType ) +{ + rType.Add( this ); +} + SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource ) { SwTOXType* pType = (SwTOXType*)rSource.GetTOXType(); diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx index 966a3d6f0225..6997474e5128 100644 --- a/sw/source/core/txtnode/SwGrammarContact.cxx +++ b/sw/source/core/txtnode/SwGrammarContact.cxx @@ -38,9 +38,6 @@ #include #include -extern void repaintTextFrames( SwModify& rModify ); - - /* SwGrammarContact This class is responsible for the delayed display of grammar checks when a paragraph is edited It's a client of the paragraph the cursor points to. @@ -58,7 +55,7 @@ class SwGrammarContact : public IGrammarContact, public SwClient Timer aTimer; SwGrammarMarkUp *mpProxyList; bool mbFinished; - SwTxtNode* getMyTxtNode() { return (SwTxtNode*)pRegisteredIn; } + SwTxtNode* getMyTxtNode() { return (SwTxtNode*)GetRegisteredIn(); } DECL_LINK( TimerRepaint, Timer * ); public: @@ -69,9 +66,9 @@ public: virtual void updateCursorPosition( const SwPosition& rNewPos ); virtual SwGrammarMarkUp* getGrammarCheck( SwTxtNode& rTxtNode, bool bCreate ); virtual void finishGrammarCheck( SwTxtNode& rTxtNode ); - +protected: // virtual function of SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; SwGrammarContact::SwGrammarContact() : mpProxyList(0), mbFinished( false ) @@ -85,11 +82,11 @@ IMPL_LINK( SwGrammarContact, TimerRepaint, Timer *, pTimer ) if( pTimer ) { pTimer->Stop(); - if( pRegisteredIn ) + if( GetRegisteredIn() ) { //Replace the old wrong list by the proxy list and repaint all frames getMyTxtNode()->SetGrammarCheck( mpProxyList, true ); mpProxyList = 0; - repaintTextFrames( *pRegisteredIn ); + SwTxtFrm::repaintTextFrames( *getMyTxtNode() ); } } return 0; @@ -107,9 +104,9 @@ void SwGrammarContact::updateCursorPosition( const SwPosition& rNewPos ) if( mpProxyList ) { // replace old list by the proxy list and repaint getMyTxtNode()->SetGrammarCheck( mpProxyList, true ); - repaintTextFrames( *pRegisteredIn ); + SwTxtFrm::repaintTextFrames( *getMyTxtNode() ); } - pRegisteredIn->Remove( this ); // good bye old paragraph + GetRegisteredInNonConst()->Remove( this ); // good bye old paragraph mpProxyList = 0; } if( pTxtNode ) @@ -158,16 +155,16 @@ SwGrammarMarkUp* SwGrammarContact::getGrammarCheck( SwTxtNode& rTxtNode, bool bC return pRet; } -void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * ) +void SwGrammarContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem * ) { if( !pOld || pOld->Which() != RES_OBJECTDYING ) return; SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld; - if( pDead->pObject == pRegisteredIn ) + if( pDead->pObject == GetRegisteredIn() ) { // if my current paragraph dies, I throw the proxy list away aTimer.Stop(); - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); delete mpProxyList; mpProxyList = 0; } @@ -175,8 +172,8 @@ void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * ) void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode ) { - if( &rTxtNode != pRegisteredIn ) // not my paragraph - repaintTextFrames( rTxtNode ); // can be repainted directly + if( &rTxtNode != GetRegisteredIn() ) // not my paragraph + SwTxtFrm::repaintTextFrames( rTxtNode ); // can be repainted directly else { if( mpProxyList ) @@ -187,7 +184,7 @@ void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode ) else if( getMyTxtNode()->GetGrammarCheck() ) { // all grammar problems seems to be gone, no delay needed getMyTxtNode()->SetGrammarCheck( 0, true ); - repaintTextFrames( *pRegisteredIn ); + SwTxtFrm::repaintTextFrames( *getMyTxtNode() ); } } } @@ -197,21 +194,6 @@ IGrammarContact* createGrammarContact() return new SwGrammarContact(); } -/* repaint all text frames of the given text node */ -void repaintTextFrames( SwModify& rModify ) -{ - SwClientIter aIter( rModify ); - for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) ); - pFrm; pFrm = (const SwTxtFrm*)aIter.Next() ) - { - SwRect aRec( pFrm->PaintArea() ); - const SwRootFrm *pRootFrm = pFrm->getRootFrm(); - ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL; - if( pCurShell ) - pCurShell->InvalidateWindows( aRec ); - } -} - void finishGrammarCheck( SwTxtNode& rTxtNode ) { IGrammarContact* pGrammarContact = getGrammarContact( rTxtNode ); diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 6b1adc76fbec..8d4721ff23ff 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -126,6 +126,12 @@ SwFmtFld::~SwFmtFld() } } +void SwFmtFld::RegisterToFieldType( SwFieldType& rType ) +{ + rType.Add(this); +} + + // #111840# void SwFmtFld::SetFld(SwField * _pField) { @@ -153,7 +159,7 @@ SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const return new SwFmtFld( *this ); } -void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !pTxtAttr ) return; @@ -171,7 +177,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) case RES_TXTATR_FLDCHG: // "Farbe hat sich geaendert !" // this, this fuer "nur Painten" - pTxtNd->Modify( this, this ); + pTxtNd->ModifyNotification( this, this ); return; case RES_REFMARKFLD_UPDATE: // GetReferenz-Felder aktualisieren @@ -185,12 +191,12 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) break; case RES_DOCPOS_UPDATE: // Je nach DocPos aktualisieren (SwTxtFrm::Modify()) - pTxtNd->Modify( pNew, this ); + pTxtNd->ModifyNotification( pNew, this ); return; case RES_ATTRSET_CHG: case RES_FMT_CHG: - pTxtNd->Modify( pOld, pNew ); + pTxtNd->ModifyNotification( pOld, pNew ); return; default: break; @@ -206,7 +212,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) case RES_DBNUMSETFLD: case RES_DBNEXTSETFLD: case RES_DBNAMEFLD: - pTxtNd->Modify( 0, pNew); + pTxtNd->ModifyNotification( 0, pNew); return; } @@ -315,7 +321,7 @@ void SwTxtFld::Expand() const // aenderung an die Frames posten if( m_pTxtNode->CalcHiddenParaField() ) { - m_pTxtNode->Modify( 0, 0 ); + m_pTxtNode->ModifyNotification( 0, 0 ); } return; } @@ -324,7 +330,7 @@ void SwTxtFld::Expand() const m_aExpand = aNewExpand; // 0, this for formatting - m_pTxtNode->Modify( 0, const_cast( &GetFld() ) ); + m_pTxtNode->ModifyNotification( 0, const_cast( &GetFld() ) ); } /************************************************************************* @@ -394,7 +400,7 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld) //if not in undo section notify the change if (m_pTxtNode && m_pTxtNode->GetNodes().IsDocNodes()) { - m_pTxtNode->Modify(0, &rFmtFld); + m_pTxtNode->ModifyNotification(0, &rFmtFld); } } diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index c00a284f4109..f98ca5595bb5 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -28,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "hintids.hxx" #include "cntfrm.hxx" // _GetFly #include "doc.hxx" @@ -43,9 +41,8 @@ #include "swfont.hxx" #include "txtfrm.hxx" #include "flyfrms.hxx" -// --> OD 2004-11-09 #i26945# #include -// <-- +#include SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt ) : SfxPoolItem( RES_TXTATR_FLYCNT ), @@ -238,17 +235,15 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm ) return NULL; } - SwClientIter aIter( *GetFlyCnt().pFmt ); + SwIterator aIter( *GetFlyCnt().pFmt ); ASSERT( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." ); - - if( aIter.GoStart() ) + SwFrm* pFrm = aIter.First(); + if ( pFrm ) { SwTxtFrm *pFirst = (SwTxtFrm*)pCurrFrm; while ( pFirst->IsFollow() ) pFirst = pFirst->FindMaster(); do - { SwFrm * pFrm = PTR_CAST( SwFrm, aIter() ); - if ( pFrm ) { SwTxtFrm *pTmp = pFirst; do @@ -263,8 +258,10 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm ) } pTmp = pTmp->GetFollow(); } while ( pTmp ); - } - } while( aIter++ ); + + pFrm = aIter.Next(); + + } while( pFrm ); } // Wir haben keinen passenden FlyFrm gefunden, deswegen wird ein diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 1d8bd92e69a7..de7f96217751 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -47,15 +47,12 @@ #include #include #include +#include /************************************************************************* |* |* class SwFmtFtn |* -|* Beschreibung -|* Ersterstellung JP 09.08.94 -|* Letzte Aenderung JP 08.08.94 -|* *************************************************************************/ @@ -272,7 +269,7 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr ) ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" ); SwNodes &rNodes = m_pTxtNode->GetDoc()->GetNodes(); - m_pTxtNode->Modify( 0, &rFtn ); + m_pTxtNode->ModifyNotification( 0, &rFtn ); if ( m_pStartNode ) { // must iterate over all TxtNodes because of footnotes on other pages @@ -283,7 +280,7 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr ) { // Es koennen ja auch Grafiken in der Fussnote stehen ... if( ( pNd = rNodes[ nSttIdx ] )->IsTxtNode() ) - ((SwTxtNode*)pNd)->Modify( 0, &rFtn ); + ((SwTxtNode*)pNd)->ModifyNotification( 0, &rFtn ); } } } @@ -372,9 +369,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib ) const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; BOOL bFrmFnd = FALSE; { - SwClientIter aIter( *m_pTxtNode ); - for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm )); - pFnd; pFnd = (SwCntntFrm*)aIter.Next() ) + SwIterator aIter( *m_pTxtNode ); + for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) { if( pRoot != pFnd->getRootFrm() && pRoot ) continue; @@ -394,9 +390,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib ) SwCntntNode* pCNd = m_pTxtNode->GetNodes().GoNext( &aIdx ); if( pCNd ) { - SwClientIter aIter( *pCNd ); - for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm )); - pFnd; pFnd = (SwCntntFrm*)aIter.Next() ) + SwIterator aIter( *pCNd ); + for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) { if( pRoot != pFnd->getRootFrm() && pRoot ) continue; diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 245ec916fd4a..3bc60d5b4628 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -114,10 +114,10 @@ SfxPoolItem* SwFmtCharFmt::Clone( SfxItemPool* ) const // weiterleiten an das TextAttribut -void SwFmtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( pTxtAttr ) - pTxtAttr->Modify( pOld, pNew ); + pTxtAttr->ModifyNotification( pOld, pNew ); } @@ -657,7 +657,7 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &static_cast(*m_pMeta) ); // cast to base class! - m_pMeta->Modify(&aMsgHint, &aMsgHint); + m_pMeta->ModifyNotification(&aMsgHint, &aMsgHint); } else { // do not call Modify, that would call SwXMeta::Modify! @@ -737,15 +737,15 @@ void Meta::NotifyChangeTxtNode() } else if (!pTxtNode && GetRegisteredIn()) { - const_cast(GetRegisteredIn())->Remove(this); + GetRegisteredInNonConst()->Remove(this); } } // SwClient -void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void Meta::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew ) { NotifyChangeTxtNode(); - SwModify::Modify(pOld, pNew); + NotifyClients(pOld, pNew); if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) { // invalidate cached uno object SetXMeta(uno::Reference(0)); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 931407980027..0663d7bdf793 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -34,9 +34,7 @@ #include #include #include -// --> OD 2008-01-17 #newlistlevelattrs# #include -// <-- #include #ifndef _SVSTDARR_HXX #define _SVSTDARR_ULONGS @@ -87,17 +85,13 @@ #include #include #include - -//--> #outlinelevel added by zhaojianwei #include -//<--end #include #include #include -// --> OD 2008-02-25 #refactorlists# #include #include -// <-- +#include SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 ) @@ -335,8 +329,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) { if( !pFrm ) { - SwClientIter aNew( rNode ); - pFrm = (SwCntntFrm*)aNew.First( TYPE(SwCntntFrm) ); + pFrm = SwIterator::FirstElement( rNode ); if( !pFrm ) return; } @@ -349,8 +342,9 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) GetNodes().GoNextSection( &aIdx, TRUE, FALSE ); if ( !pNd ) continue; - SwClientIter aIter( *pNd ); - SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm)); + + SwIterator aIter( *pNd ); + SwCntntFrm* pCntnt = aIter.First(); if( pCntnt ) { ASSERT( pCntnt->getRootFrm() == pFrm->getRootFrm(), @@ -370,7 +364,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) } } #ifdef DBG_UTIL - while( 0 != (pCntnt = (SwCntntFrm*)aIter.Next()) ) + while( 0 != (pCntnt = aIter.Next()) ) { SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm(); ASSERT( !pDbgFtn || pDbgFtn->GetRef() == pFrm, @@ -513,21 +507,13 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) } - SwClientIter aIter( *this ); - SwClient* pLastFrm = aIter.GoStart(); - if( pLastFrm ) - { - do - { SwCntntFrm *pFrm = PTR_CAST( SwCntntFrm, pLastFrm ); - if ( pFrm ) + SwIterator aIter( *this ); + for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { - pNode->Add( pFrm ); - if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && - ((SwTxtFrm*)pFrm)->GetOfst() ) + pFrm->RegisterToNode( *pNode ); + if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && ((SwTxtFrm*)pFrm)->GetOfst() ) ((SwTxtFrm*)pFrm)->SetOfst( 0 ); - } - pLastFrm = aIter++; - } while ( pLastFrm ); + pFrm = aIter.Next(); } if ( IsInCache() ) @@ -550,12 +536,12 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) if( 1 == nTxtLen - nSplitPos ) { SwDelChr aHint( nSplitPos ); - pNode->SwModify::Modify( 0, &aHint ); + pNode->NotifyClients( 0, &aHint ); } else { SwDelTxt aHint( nSplitPos, nTxtLen - nSplitPos ); - pNode->SwModify::Modify( 0, &aHint ); + pNode->NotifyClients( 0, &aHint ); } } if ( HasHints() ) @@ -638,7 +624,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) if( GetDepends() && SFX_ITEM_SET == pNode->GetSwAttrSet(). GetItemState( RES_PAGEDESC, TRUE, &pItem ) ) { - pNode->Modify( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); + pNode->ModifyNotification( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); } } return pNode; @@ -1501,7 +1487,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx, { // Frames benachrichtigen, sonst verschwinden die Ftn-Nummern SwUpdateAttr aHint( nOldPos, nOldPos, 0 ); - pDest->Modify( 0, &aHint ); + pDest->ModifyNotification( 0, &aHint ); } } @@ -1860,7 +1846,7 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx, if ( GetDepends() ) { SwInsTxt aHint( aPos, nLen ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); } // By inserting a character, the hidden flags @@ -2254,9 +2240,9 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, // Frames benachrichtigen; SwInsTxt aInsHint( nDestStart, nLen ); - pDest->Modify( 0, &aInsHint ); + pDest->ModifyNotification( 0, &aInsHint ); SwDelTxt aDelHint( nTxtStartIdx, nLen ); - Modify( 0, &aDelHint ); + ModifyNotification( 0, &aDelHint ); } @@ -2351,12 +2337,12 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount, if( 1 == nCnt ) { SwDelChr aHint( nStartIdx ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); } else { SwDelTxt aHint( nStartIdx, nCnt ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); } ASSERT(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?"); @@ -2416,9 +2402,9 @@ void SwTxtNode::GCAttr() { //TxtFrm's reagieren auf aHint, andere auf aNew SwUpdateAttr aHint( nMin, nMax, 0 ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); SwFmtChg aNew( GetTxtColl() ); - SwModify::Modify( 0, &aNew ); + NotifyClients( 0, &aNew ); } } @@ -2566,9 +2552,9 @@ void SwTxtNode::NumRuleChgd() } SetInSwFntCache( FALSE ); - SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); - SwModify::Modify( &rLR, &rLR ); + SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); + NotifyClients( &rLR, &rLR ); } // -> #i27615# @@ -3460,10 +3446,10 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, SetIgnoreDontExpand( bOldExpFlg ); SwDelTxt aDelHint( nStartPos, nDelLen ); - SwModify::Modify( 0, &aDelHint ); + NotifyClients( 0, &aDelHint ); SwInsTxt aHint( nStartPos, rText.Len() ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); } // --> OD 2008-03-27 #refactorlists# @@ -3689,7 +3675,7 @@ namespace { } // <-- -void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) +void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { bool bWasNotifiable = m_bNotifiable; m_bNotifiable = false; @@ -3700,7 +3686,7 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) // Bug25481: // bei Nodes im Undo nie _ChgTxtCollUpdateNum rufen. if( pOldValue && pNewValue && RES_FMT_CHG == pOldValue->Which() && - pRegisteredIn == ((SwFmtChg*)pNewValue)->pChangedFmt && + GetRegisteredIn() == ((SwFmtChg*)pNewValue)->pChangedFmt && GetNodes().IsDocNodes() ) { _ChgTxtCollUpdateNum( @@ -5056,7 +5042,6 @@ USHORT SwTxtNode::ResetAllAttr() } // <-- - // sw::Metadatable ::sfx2::IXmlIdRegistry& SwTxtNode::GetRegistry() { @@ -5078,6 +5063,12 @@ bool SwTxtNode::IsInContent() const return !GetDoc()->IsInHeaderFooter( SwNodeIndex(*this) ); } +void SwTxtNode::SwClientNotify( SwModify* pModify, USHORT nWhich ) +{ + if ( nWhich == RES_CONDTXTFMTCOLL && pModify == GetRegisteredIn() ) + ChkCondColl(); +} + #include using namespace ::com::sun::star; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index ac2f281b0d90..82a3642e4b2d 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -213,22 +213,20 @@ splitPolicy(const USHORT nWhichNew, const USHORT nWhichOther) } } -static void -lcl_InitINetFmt(SwTxtNode & rNode, SwTxtINetFmt * pNew) +void SwTxtINetFmt::InitINetFmt(SwTxtNode & rNode) { - pNew->ChgTxtNode(&rNode); + ChgTxtNode(&rNode); SwCharFmt * const pFmt( rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_INET_NORMAL) ); - pFmt->Add( pNew ); + pFmt->Add( this ); } -static void -lcl_InitRuby(SwTxtNode & rNode, SwTxtRuby * pNew) +void SwTxtRuby::InitRuby(SwTxtNode & rNode) { - pNew->ChgTxtNode(&rNode); + ChgTxtNode(&rNode); SwCharFmt * const pFmt( rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_RUBYTEXT) ); - pFmt->Add( pNew ); + pFmt->Add( this ); } /** @@ -244,12 +242,12 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting, { case RES_TXTATR_INETFMT: { - lcl_InitINetFmt(rNode, static_cast(pNew)); + static_cast(pNew)->InitINetFmt(rNode); break; } case RES_TXTATR_CJK_RUBY: { - lcl_InitRuby(rNode, static_cast(pNew)); + static_cast(pNew)->InitRuby(rNode); break; } default: @@ -1192,7 +1190,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) if( nDelMsg && !pDoc->IsInDtor() && GetNodes().IsDocNodes() ) { SwPtrMsgPoolItem aMsgHint( nDelMsg, (void*)&pAttr->GetAttr() ); - pDoc->GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint ); + pDoc->GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint ); } SwTxtAttr::Destroy( pAttr, pDoc->GetAttrPool() ); @@ -1520,7 +1518,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr ) *pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() ); m_pSwpHints->Delete( pAttr ); SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() ); - SwModify::Modify( 0, &aHint ); // notify Frames + NotifyClients( 0, &aHint ); TryDeleteSwpHints(); } @@ -1588,7 +1586,7 @@ void SwTxtNode::DeleteAttributes( const USHORT nWhich, SwUpdateAttr aHint( nStart, *pEndIdx, nWhich ); m_pSwpHints->DeleteAtPos( nPos ); // gefunden, loeschen, SwTxtAttr::Destroy( pTxtHt, GetDoc()->GetAttrPool() ); - SwModify::Modify( 0, &aHint ); // die Frames benachrichtigen + NotifyClients( 0, &aHint ); } } } @@ -2340,7 +2338,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) if( aNdSet.Count() ) { SwFmtChg aTmp1( pNd->GetFmtColl() ); - pNd->SwModify::Modify( &aTmp1, &aTmp1 ); + pNd->NotifyClients( &aTmp1, &aTmp1 ); } } } @@ -2631,7 +2629,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, } // <-- case RES_TXTATR_INETFMT: - lcl_InitINetFmt(rNode, static_cast(pHint)); + static_cast(pHint)->InitINetFmt(rNode); break; case RES_TXTATR_FIELD: { @@ -2684,7 +2682,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, { SwFmtFld* pFmtFld = (SwFmtFld*)&((SwTxtFld*)pHint) ->GetFld(); - pFldType->Add( pFmtFld ); // ummelden + pFmtFld->RegisterToFieldType( *pFldType ); pFmtFld->GetFld()->ChgTyp( pFldType ); } pFldType->SetSeqRefNo( *(SwSetExpField*)pFld ); @@ -2765,7 +2763,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, break; case RES_TXTATR_CJK_RUBY: - lcl_InitRuby(rNode, static_cast(pHint)); + static_cast(pHint)->InitRuby(rNode); break; case RES_TXTATR_META: @@ -2798,7 +2796,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, if ( rNode.GetDepends() ) { SwUpdateAttr aHint( nHtStart, nHtStart, nWhich ); - rNode.Modify( 0, &aHint ); + rNode.ModifyNotification( 0, &aHint ); } return true; } @@ -2880,7 +2878,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, if ( rNode.GetDepends() ) { SwUpdateAttr aHint( nHtStart, nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd, nWhich ); - rNode.Modify( 0, &aHint ); + rNode.ModifyNotification( 0, &aHint ); } #ifdef DBG_UTIL diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 5499eeab4439..d63fe84420b3 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -67,7 +67,7 @@ SwTxtCharFmt::~SwTxtCharFmt( ) { } -void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich) @@ -77,12 +77,12 @@ void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if ( m_pTxtNode ) { SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich ); - m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr ); + m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr ); } } // erfrage vom Modify Informationen -BOOL SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const { if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode || &m_pTxtNode->GetNodes() != static_cast(rInfo).pNodes ) @@ -181,12 +181,12 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt() if( pRet ) pRet->Add( this ); else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); return pRet; } -void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich) @@ -196,7 +196,7 @@ void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) if ( m_pTxtNode ) { SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich ); - m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr ); + m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr ); } } @@ -235,7 +235,7 @@ SwTxtRuby::~SwTxtRuby() { } -void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich) @@ -245,7 +245,7 @@ void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) if ( m_pTxtNode ) { SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich ); - m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr ); + m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr ); } } @@ -298,7 +298,7 @@ SwCharFmt* SwTxtRuby::GetCharFmt() if( pRet ) pRet->Add( this ); else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); return pRet; } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 823bedb96772..b37b30461bbc 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -617,9 +617,9 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, } //TxtFrm's reagieren auf aHint, andere auf aNew SwUpdateAttr aHint( nMin, nMax, 0 ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); SwFmtChg aNew( GetFmtColl() ); - SwModify::Modify( 0, &aNew ); + NotifyClients( 0, &aNew ); } } @@ -1868,10 +1868,10 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, // notify the layout! SwDelTxt aDelHint( nPos, nTLen ); - SwModify::Modify( 0, &aDelHint ); + NotifyClients( 0, &aDelHint ); SwInsTxt aHint( nPos, nTLen ); - SwModify::Modify( 0, &aHint ); + NotifyClients( 0, &aHint ); } void SwTxtNode::CountWords( SwDocStat& rStat, diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index 9a395375eabe..b51bca0280c0 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -68,13 +68,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc ) SwFrmFmt* pHeaderFmt = rHead.GetHeaderFmt(); if( pHeaderFmt ) { - SwClientIter aIter( *pHeaderFmt ); - SwClient *pLast = aIter.GoStart(); - if( pLast ) - do - { - ++nHeaderCount; - } while( 0 != ( pLast = aIter++ )); + nHeaderCount = pHeaderFmt->GetClientCount(); const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt(); if( pCntnt->GetCntntIdx() ) nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex(); @@ -85,13 +79,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc ) SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt(); if( pLeftHeaderFmt ) { - SwClientIter aIter( *pLeftHeaderFmt ); - SwClient *pLast = aIter.GoStart(); - if( pLast ) - do - { - ++nLeftHeaderCount; - } while( 0 != ( pLast = aIter++ )); + nLeftHeaderCount = pLeftHeaderFmt->GetClientCount(); const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt(); if( pLeftCntnt->GetCntntIdx() ) nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex(); @@ -104,13 +92,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc ) SwFrmFmt* pFooterFmt = rFoot.GetFooterFmt(); if( pFooterFmt ) { - SwClientIter aIter( *pFooterFmt ); - SwClient *pLast = aIter.GoStart(); - if( pLast ) - do - { - ++nFooterCount; - } while( 0 != ( pLast = aIter++ )); + nFooterCount = pFooterFmt->GetClientCount(); const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt(); if( pCntnt->GetCntntIdx() ) nFooterMaster = pCntnt->GetCntntIdx()->GetIndex(); @@ -121,13 +103,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc ) SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt(); if( pLeftFooterFmt ) { - SwClientIter aIter( *pLeftFooterFmt ); - SwClient *pLast = aIter.GoStart(); - if( pLast ) - do - { - ++nLeftFooterCount; - } while( 0 != ( pLast = aIter++ )); + nLeftFooterCount = pLeftFooterFmt->GetClientCount(); const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt(); if( pLeftCntnt->GetCntntIdx() ) nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex(); diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 6848f1b13644..ea605cd23f02 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -366,7 +366,7 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, ULONG nNodePos ) , m_nStart( *pTxtHt->GetStart() ) , m_nEnd( *pTxtHt->GetAnyEnd() ) { - const_cast(m_TOXMark.GetRegisteredIn())->Remove( &m_TOXMark ); + m_TOXMark.DeRegister(); } @@ -395,7 +395,7 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool ) } SwTOXMark aNew( m_TOXMark ); - pToxType->Add( &aNew ); + aNew.RegisterToTOXType( *pToxType ); pTxtNd->InsertItem( aNew, m_nStart, m_nEnd, nsSetAttrMode::SETATTR_NOTXTATRCHR ); @@ -1387,7 +1387,7 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst ) _MakeSetWhichIds(); } -void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if ( m_pHistory && ( pOld || pNew ) ) { @@ -1399,7 +1399,7 @@ void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { SwHistoryHint* pNewHstr; const SfxItemSet& rSet = - *static_cast(pOld)->GetChgSet(); + *static_cast(pOld)->GetChgSet(); if ( 1 < rSet.Count() ) { pNewHstr = diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index a4e5ded47f07..27fb1040010d 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -61,7 +61,7 @@ #include #include #include - +#include inline SwDoc& SwUndoIter::GetDoc() const @@ -76,49 +76,52 @@ SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt ) { } -void SwUndoFmtAttrHelper::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { - if( pOld && pNew ) + if( pOld ) { - if( POOLATTR_END >= pOld->Which() ) + if ( pOld->Which() == RES_OBJECTDYING ) { - if ( GetUndo() ) - { - m_pUndo->PutAttr( *pOld ); - } - else - { - m_pUndo.reset( new SwUndoFmtAttr( *pOld, - *static_cast(pRegisteredIn), m_bSaveDrawPt ) ); - } + CheckRegistration( pOld, pNew ); } - else if ( RES_ATTRSET_CHG == pOld->Which() ) + else if ( pNew ) { - if ( GetUndo() ) + if( POOLATTR_END >= pOld->Which() ) { - SfxItemIter aIter( - *(static_cast(pOld))->GetChgSet() ); - const SfxPoolItem* pItem = aIter.GetCurItem(); - while ( pItem ) + if ( GetUndo() ) { - m_pUndo->PutAttr( *pItem ); - if( aIter.IsAtEnd() ) - break; - pItem = aIter.NextItem(); + m_pUndo->PutAttr( *pOld ); + } + else + { + m_pUndo.reset( new SwUndoFmtAttr( *pOld, + *static_cast(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); } } - else + else if ( RES_ATTRSET_CHG == pOld->Which() ) { - m_pUndo.reset( new SwUndoFmtAttr( - *static_cast(pOld)->GetChgSet(), - *static_cast(pRegisteredIn), m_bSaveDrawPt ) ); + if ( GetUndo() ) + { + SfxItemIter aIter( + *(static_cast(pOld))->GetChgSet() ); + const SfxPoolItem* pItem = aIter.GetCurItem(); + while ( pItem ) + { + m_pUndo->PutAttr( *pItem ); + if( aIter.IsAtEnd() ) + break; + pItem = aIter.NextItem(); + } + } + else + { + m_pUndo.reset( new SwUndoFmtAttr( + *static_cast(pOld)->GetChgSet(), + *static_cast(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); + } } } - else - SwClient::Modify( pOld, pNew ); } - else - SwClient::Modify( pOld, pNew ); } // ----------------------------------------------------- @@ -165,8 +168,7 @@ void SwUndoFmtAttr::Init() static_cast(m_pFmt))) { // Table Format: save table position, table formats are volatile! - SwTable * pTbl = static_cast( - SwClientIter( *m_pFmt ).First( TYPE( SwTable )) ); + SwTable * pTbl = SwIterator::FirstElement( *m_pFmt ); if ( pTbl ) { m_nNodeIndex = pTbl->GetTabSortBoxes()[ 0 ]->GetSttNd() @@ -180,8 +182,7 @@ void SwUndoFmtAttr::Init() } else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) ) { - SwTableBox* pTblBox = static_cast< SwTableBox* >( - SwClientIter( *m_pFmt ).First( TYPE( SwTableBox ))); + SwTableBox * pTblBox = SwIterator::FirstElement( *m_pFmt ); if ( pTblBox ) { m_nNodeIndex = pTblBox->GetSttIdx(); diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 3d38407a9e56..5bb97370b674 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -168,7 +168,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) // alle Uno-Objecte sollten sich jetzt abmelden { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrmFmt ); - pFrmFmt->Modify( &aMsgHint, &aMsgHint ); + pFrmFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } if ( RES_DRAWFRMFMT != pFrmFmt->Which() ) @@ -485,6 +485,11 @@ SwUndoSetFlyFmt::~SwUndoSetFlyFmt() delete pItemSet; } +void SwUndoSetFlyFmt::DeRegisterFromFormat( SwFmt& rFmt ) +{ + rFmt.Remove(this); +} + void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, ULONG nNode, xub_StrLen nCntnt ) { @@ -678,7 +683,7 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem ) pItemSet->InvalidateItem( nWhich ); } -void SwUndoSetFlyFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* ) +void SwUndoSetFlyFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* ) { if( pOld ) { diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 4b9505797c57..2b4565c8fc71 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -59,9 +59,6 @@ struct SwUndoGroupObjImpl SwDrawFrmFmt* pFmt; SdrObject* pObj; ULONG nNodeIdx; - - // OD 2004-04-15 #i26791# - keeping the anchor and the relative position - // of drawing objects no longer needed }; @@ -81,7 +78,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo ) { ClearRedo(); const SdrMarkList* pMarkList = 0; - ViewShell* pSh = GetCurrentViewShell() ? GetCurrentViewShell() : 0; //swmod 071108//swmod 071225 + ViewShell* pSh = GetCurrentViewShell(); if( pSh && pSh->HasDrawView() ) pMarkList = &pSh->GetDrawView()->GetMarkedObjectList(); @@ -129,7 +126,7 @@ String SwSdrUndo::GetComment() const void lcl_SendRemoveToUno( SwFmt& rFmt ) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFmt ); - rFmt.Modify( &aMsgHint, &aMsgHint ); + rFmt.ModifyNotification( &aMsgHint, &aMsgHint ); } void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) @@ -147,15 +144,15 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) { nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); - // TextAttribut zerstoeren + // destroy TextAttribute SwTxtNode *pTxtNd = pFmt->GetDoc()->GetNodes()[ rNodePos ]->GetTxtNode(); - ASSERT( pTxtNd, "Kein Textnode gefunden" ); + ASSERT( pTxtNd, "No text node found!" ); SwTxtFlyCnt* pAttr = static_cast( pTxtNd->GetTxtAttrForCharAt( nCntntPos, RES_TXTATR_FLYCNT )); - // Attribut steht noch im TextNode, loeschen + // attribute still in text node, delete if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFmt ) { - // Pointer auf 0, nicht loeschen + // just set pointer to 0, don't delete ((SwFmtFlyCnt&)pAttr->GetFlyCnt()).SetFlyFmt(); SwIndex aIdx( pTxtNd, nCntntPos ); pTxtNd->EraseText( aIdx, 1 ); @@ -218,7 +215,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup() delete pTmp->pFmt; } else - delete pObjArr->pFmt; // das GroupObject-Format + delete pObjArr->pFmt; delete [] pObjArr; } @@ -227,22 +224,22 @@ void SwUndoDrawGroup::Undo( SwUndoIter& ) { bDelFmt = FALSE; - // das Group-Object sichern + // save group object SwDrawFrmFmt* pFmt = pObjArr->pFmt; SwDrawContact* pDrawContact = (SwDrawContact*)pFmt->FindContactObj(); SdrObject* pObj = pDrawContact->GetMaster(); pObjArr->pObj = pObj; - //loescht sich selbst! + // object will destroy itself pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); - // aus dem Array austragen + // remove from array SwDoc* pDoc = pFmt->GetDoc(); SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); @@ -258,19 +255,15 @@ void SwUndoDrawGroup::Undo( SwUndoIter& ) SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj ); pContact->ConnectToLayout(); - // --> OD 2005-03-22 #i45718# - follow-up of #i35635# - // move object to visible layer + // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObj ); - // <-- - // --> OD 2005-05-10 #i45952# - notify that position attributes - // are already set + // #i45952# - notify that position attributes are already set ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt), " - wrong type of frame format for drawing object" ); if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) { static_cast(rSave.pFmt)->PosAttrSet(); } - // <-- } } @@ -278,7 +271,7 @@ void SwUndoDrawGroup::Redo( SwUndoIter& ) { bDelFmt = TRUE; - // aus dem Array austragen + // remove from array SwDoc* pDoc = pObjArr->pFmt->GetDoc(); SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); SdrObject* pObj; @@ -290,38 +283,35 @@ void SwUndoDrawGroup::Redo( SwUndoIter& ) pObj = rSave.pObj; SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); - //loescht sich selbst! + + // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); ::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *rSave.pFmt ); rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt )); } - // das Group-Object wieder einfuegen + // re-insert group object ::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx ); rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() ); SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj ); - // OD 2004-04-15 #i26791# - correction: connect object to layout + // #i26791# - correction: connect object to layout pContact->ConnectToLayout(); - // --> OD 2005-03-22 #i45718# - follow-up of #i35635# - // move object to visible layer + // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObjArr->pObj ); - // <-- - // --> OD 2005-05-10 #i45952# - notify that position attributes - // are already set + // #i45952# - notify that position attributes are already set ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt), " - wrong type of frame format for drawing object" ); if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) ) { static_cast(pObjArr->pFmt)->PosAttrSet(); } - // <-- } void SwUndoDrawGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj ) @@ -331,10 +321,10 @@ void SwUndoDrawGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj ) rSave.pFmt = pFmt; ::lcl_SaveAnchor( pFmt, rSave.nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); - // aus dem Array austragen + // remove from array SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts(); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); } @@ -360,16 +350,16 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj ) pObjArr->pObj = pObj; pObjArr->pFmt = pFmt; - //loescht sich selbst! + // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); - // aus dem Array austragen + // remove from array SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts(); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); } @@ -383,7 +373,7 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup() delete pTmp->pFmt; } else - delete pObjArr->pFmt; // das GroupObject-Format + delete pObjArr->pFmt; delete [] pObjArr; } @@ -392,7 +382,7 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter ) { bDelFmt = TRUE; - // aus dem Array austragen + // remove from array SwDoc* pDoc = &rIter.GetDoc(); SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); @@ -400,65 +390,50 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); - // --> OD 2006-11-01 #130889# - taken over by -// SwDrawContact* pContact = (SwDrawContact*)rSave.pFmt->FindContactObj(); - -// rSave.pObj = pContact->GetMaster(); - -// //loescht sich selbst! -// pContact->Changed( *rSave.pObj, SDRUSERCALL_DELETE, -// rSave.pObj->GetLastBoundRect() ); -// rSave.pObj->SetUserCall( 0 ); - // <-- - ::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *rSave.pFmt ); rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt )); } - // das Group-Object wieder einfuegen + // re-insert group object ::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx ); rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() ); SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj ); pContact->ConnectToLayout(); - // --> OD 2005-03-22 #i45718# - follow-up of #i35635# - // move object to visible layer + // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObjArr->pObj ); - // <-- - // --> OD 2005-05-10 #i45952# - notify that position attributes - // are already set + // #i45952# - notify that position attributes are already set ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt), " - wrong type of frame format for drawing object" ); if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) ) { static_cast(pObjArr->pFmt)->PosAttrSet(); } - // <-- } void SwUndoDrawUnGroup::Redo( SwUndoIter& ) { bDelFmt = FALSE; - // das Group-Object sichern + // save group object SwDrawFrmFmt* pFmt = pObjArr->pFmt; SwDrawContact* pContact = (SwDrawContact*)pFmt->FindContactObj(); - //loescht sich selbst! + // object will destroy itself pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE, pObjArr->pObj->GetLastBoundRect() ); pObjArr->pObj->SetUserCall( 0 ); ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); - // aus dem Array austragen + // remove from array SwDoc* pDoc = pFmt->GetDoc(); SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); @@ -470,25 +445,13 @@ void SwUndoDrawUnGroup::Redo( SwUndoIter& ) ::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx ); rFlyFmts.Insert( rSave.pFmt, rFlyFmts.Count() ); - // --> OD 2006-11-01 #130889# - taken over by -// SdrObject* pObj = rSave.pObj; - -// SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, rSave.pObj ); -// pContact->ConnectToLayout(); -// // --> OD 2005-03-22 #i45718# - follow-up of #i35635# -// // move object to visible layer -// pContact->MoveObjToVisibleLayer( rSave.pObj ); -// // <-- - // <-- - // --> OD 2005-05-10 #i45952# - notify that position attributes - // are already set + // #i45952# - notify that position attributes are already set ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt), " - wrong type of frame format for drawing object" ); if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) { static_cast(rSave.pFmt)->PosAttrSet(); } - // <-- } } @@ -499,8 +462,6 @@ void SwUndoDrawUnGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt ) rSave.pObj = 0; } -//------------------------------------- -// --> OD 2006-11-01 #130889# SwUndoDrawUnGroupConnectToLayout::SwUndoDrawUnGroupConnectToLayout() : SwUndo( UNDO_DRAWUNGROUP ) { @@ -548,7 +509,6 @@ void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt, aDrawFmtsAndObjs.push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pDrawFrmFmt, pDrawObject ) ); } -// <-- //------------------------------------- @@ -583,19 +543,15 @@ void SwUndoDrawDelete::Undo( SwUndoIter &rIter ) SdrObject *pObj = rSave.pObj; SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj ); pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL ); - // --> OD 2005-03-22 #i45718# - follow-up of #i35635# - // move object to visible layer + // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObj ); - // <-- - // --> OD 2005-05-10 #i45952# - notify that position attributes - // are already set + // #i45952# - notify that position attributes are already set ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt), " - wrong type of frame format for drawing object" ); if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) { static_cast(rSave.pFmt)->PosAttrSet(); } - // <-- } rIter.pMarkList = pMarkLst; } @@ -610,11 +566,12 @@ void SwUndoDrawDelete::Redo( SwUndoIter &rIter ) SdrObject *pObj = rSave.pObj; SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt(); - //loescht sich selbst! + + // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); @@ -630,10 +587,10 @@ void SwUndoDrawDelete::AddObj( USHORT , SwDrawFrmFmt* pFmt, rSave.pFmt = pFmt; ::lcl_SaveAnchor( pFmt, rSave.nNodeIdx ); - // alle Uno-Objecte sollten sich jetzt abmelden + // notify UNO objects to decouple ::lcl_SendRemoveToUno( *pFmt ); - // aus dem Array austragen + // remove from array SwDoc* pDoc = pFmt->GetDoc(); SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); rFlyFmts.Remove( rFlyFmts.GetPos( pFmt )); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index f66cae89ce21..c463c62edcf0 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #ifndef DBG_UTIL #define CHECK_TABLE(t) @@ -134,7 +135,7 @@ public: ~_SaveTable(); USHORT AddFmt( SwFrmFmt* pFmt, bool bIsLine ); - void NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, USHORT nFmtPos, + void NewFrmFmt( const SwTableLine* , const SwTableBox*, USHORT nFmtPos, SwFrmFmt* pOldFmt ); void RestoreAttr( SwTable& rTbl, BOOL bModifyBox = FALSE ); @@ -494,7 +495,7 @@ void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter ) SwTableNode* pTblNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves ); pTblNd->GetTable().SetTableModel( pTblSave->IsNewModel() ); SwTableFmt* pTableFmt = rDoc.MakeTblFrmFmt( sTblNm, rDoc.GetDfltFrmFmt() ); - pTableFmt->Add( &pTblNd->GetTable() ); // das Frame-Format setzen + pTblNd->GetTable().RegisterToFormat( *pTableFmt ); pTblNd->GetTable().SetRowsToRepeat( nHdlnRpt ); // erzeuge die alte Tabellen Struktur @@ -986,12 +987,12 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox ) } // zur Sicherheit alle Tableframes invalidieren - SwClientIter aIter( *pFmt ); - for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) - if( ((SwTabFrm*)pLast)->GetTable() == &rTbl ) + SwIterator aIter( *pFmt ); + for( SwTabFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) + if( pLast->GetTable() == &rTbl ) { - ((SwTabFrm*)pLast)->InvalidateAll(); - ((SwTabFrm*)pLast)->SetCompletePaint(); + pLast->InvalidateAll(); + pLast->SetCompletePaint(); } // FrmFmts mit Defaults (0) fuellen @@ -1123,7 +1124,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms, } -void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, +void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx, USHORT nFmtPos, SwFrmFmt* pOldFmt ) { SwDoc* pDoc = pOldFmt->GetDoc(); @@ -1131,7 +1132,7 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, SwFrmFmt* pFmt = aFrmFmts[ nFmtPos ]; if( !pFmt ) { - if( bIsLine ) + if( pTblLn ) pFmt = pDoc->MakeTableLineFmt(); else pFmt = pDoc->MakeTableBoxFmt(); @@ -1140,16 +1141,16 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, } //Erstmal die Frms ummelden. - SwClientIter aIter( *pOldFmt ); - for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() ) + SwIterator aIter( *pOldFmt ); + for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( bIsLine ? pLnBx == ((SwRowFrm*)pLast)->GetTabLine() - : pLnBx == ((SwCellFrm*)pLast)->GetTabBox() ) + if( pTblLn ? ((SwRowFrm*)pLast)->GetTabLine() == pTblLn + : ((SwCellFrm*)pLast)->GetTabBox() == pTblBx ) { - pFmt->Add( pLast ); - ((SwFrm*)pLast)->InvalidateAll(); - ((SwFrm*)pLast)->ReinitializeFrmSizeAttrFlags(); - if ( !bIsLine ) + pLast->RegisterToFormat(*pFmt); + pLast->InvalidateAll(); + pLast->ReinitializeFrmSizeAttrFlags(); + if ( !pTblLn ) { ((SwCellFrm*)pLast)->SetDerivedVert( FALSE ); ((SwCellFrm*)pLast)->CheckDirChange(); @@ -1158,14 +1159,17 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, } //Jetzt noch mich selbst ummelden. - pFmt->Add( (SwClient*)pLnBx ); + if ( pTblLn ) + const_cast(pTblLn)->RegisterToFormat( *pFmt ); + else if ( pTblBx ) + const_cast(pTblBx)->RegisterToFormat( *pFmt ); - if( bModifyBox && !bIsLine ) + if( bModifyBox && !pTblLn ) { const SfxPoolItem& rOld = pOldFmt->GetFmtAttr( RES_BOXATR_FORMAT ), & rNew = pFmt->GetFmtAttr( RES_BOXATR_FORMAT ); if( rOld != rNew ) - pFmt->Modify( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew ); + pFmt->ModifyNotification( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew ); } if( !pOldFmt->GetDepends() ) @@ -1198,7 +1202,7 @@ _SaveLine::~_SaveLine() void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl ) { - rSTbl.NewFrmFmt( &rLine, TRUE, nItemSet, rLine.GetFrmFmt() ); + rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() ); _SaveBox* pBx = pBox; for( USHORT n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext ) @@ -1288,7 +1292,7 @@ _SaveBox::~_SaveBox() void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) { - rSTbl.NewFrmFmt( &rBox, FALSE, nItemSet, rBox.GetFrmFmt() ); + rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() ); if( ULONG_MAX == nSttNode ) // keine EndBox { @@ -1405,7 +1409,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" ); SwFrmFmt* pOld = pBox->GetFrmFmt(); - pFmt->Add( pBox ); + pBox->RegisterToFormat( *pFmt ); if( !pOld->GetDepends() ) delete pOld; diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 590ddb6e803e..b02ebbb16324 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -91,7 +91,7 @@ public: } void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -594,7 +594,7 @@ uno::Type SwXFieldmarkParameters::getElementType() return !getCoreParameters()->empty(); } -void SwXFieldmarkParameters::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXFieldmarkParameters::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 703389a58f7e..c1d4cdb882d0 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -1595,7 +1595,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames } -void SwChartDataProvider::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwChartDataProvider::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { // actually this function should be superfluous (need to check later) ClientModify(this, pOld, pNew ); @@ -2496,7 +2496,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames } -void SwChartDataSequence::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwChartDataSequence::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew ); diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 0b8f938d307d..ea3104aa69e4 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -31,9 +31,7 @@ #include #include #include -#ifndef _SVX_SVXIDS_HRC //autogen #include -#endif #include #include #include @@ -72,14 +70,13 @@ #include #include #include - #include #include #include #include #include #include "docsh.hxx" - +#include using ::rtl::OUString; using namespace ::com::sun::star; @@ -272,9 +269,6 @@ const ProvNamesId_Type __FAR_DATA aProvNamesId[] = { CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY } }; -/* -----------------------------23.03.01 13:38-------------------------------- - - ---------------------------------------------------------------------------*/ const SvEventDescription* lcl_GetSupportedMacroItems() { static const SvEventDescription aMacroDescriptionsImpl[] = @@ -290,9 +284,6 @@ const SvEventDescription* lcl_GetSupportedMacroItems() /****************************************************************** * SwXServiceProvider ******************************************************************/ -/*-- 13.01.99 13:31:44--------------------------------------------------- - - -----------------------------------------------------------------------*/ OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -302,9 +293,7 @@ OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType) sRet = C2U(aProvNamesId[nObjectType].pName); return sRet; } -/* -----------------11.03.99 12:05------------------- - * - * --------------------------------------------------*/ + uno::Sequence SwXServiceProvider::GetAllServiceNames() { sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]); @@ -325,9 +314,6 @@ uno::Sequence SwXServiceProvider::GetAllServiceNames() } -/*-- 13.01.99 13:31:45--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName) { sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]); @@ -338,9 +324,7 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName) } return SW_SERVICE_INVALID; } -/* -----------------13.01.99 14:37------------------- - * - * --------------------------------------------------*/ + uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -570,8 +554,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 } else { - SwClientIter aIter( *pType ); - SwXFieldMaster* pMaster = (SwXFieldMaster*)aIter.First( TYPE( SwXFieldMaster )); + SwXFieldMaster* pMaster = SwIterator::FirstElement( *pType ); if(pMaster) xRet = (cppu::OWeakObject*)pMaster; } @@ -625,24 +608,17 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 ******************************************************************/ //SMART_UNO_IMPLEMENTATION( SwXTextTables, UsrObject ); -/*-- 13.01.99 12:56:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextTables::SwXTextTables(SwDoc* pDc) : SwUnoCollection(pDc) { } -/*-- 13.01.99 12:56:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTables::~SwXTextTables() { } -/*-- 13.01.99 12:56:25--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -651,9 +627,7 @@ sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException ) nRet = GetDoc()->GetTblFrmFmtCount(sal_True); return nRet; } -/*-- 13.01.99 12:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) { @@ -675,9 +649,7 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex) throw uno::RuntimeException(); return aRet; } -/*-- 13.01.99 12:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextTables::getByName(const OUString& rItemName) throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException ) { @@ -706,9 +678,7 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName) throw uno::RuntimeException(); return aRet; } -/*-- 13.01.99 12:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTables::getElementNames(void) throw( uno::RuntimeException ) { @@ -729,9 +699,7 @@ uno::Sequence< OUString > SwXTextTables::getElementNames(void) } return aSeq; } -/*-- 13.01.99 12:56:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTables::hasByName(const OUString& rName) throw( uno::RuntimeException ) { @@ -755,18 +723,14 @@ sal_Bool SwXTextTables::hasByName(const OUString& rName) throw uno::RuntimeException(); return bRet; } -/*-- 13.01.99 12:56:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXTextTables::getElementType( ) throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/*-- 13.01.99 12:56:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -774,23 +738,17 @@ sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return 0 != GetDoc()->GetTblFrmFmtCount(sal_True); } -/* -----------------25.10.99 16:01------------------- - --------------------------------------------------*/ OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextTables"); } -/* -----------------25.10.99 16:01------------------- - --------------------------------------------------*/ sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return rServiceName == C2U("com.sun.star.text.TextTables"); } -/* -----------------25.10.99 16:01------------------- - --------------------------------------------------*/ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -798,14 +756,11 @@ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( u pArr[0] = C2U("com.sun.star.text.TextTables"); return aRet; } -/*-- 13.01.99 12:56:28--------------------------------------------------- - -----------------------------------------------------------------------*/ XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt ) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwXTextTable* pTbl = (SwXTextTable*)SwClientIter( rFmt ). - First( TYPE( SwXTextTable )); + SwXTextTable* pTbl = SwIterator::FirstElement( rFmt ); if( !pTbl ) pTbl = new SwXTextTable(rFmt); return pTbl ; @@ -846,7 +801,7 @@ namespace template static uno::Any lcl_UnoWrapFrame(SwFrmFmt* pFmt) { - SwXFrame* pFrm = static_cast(SwClientIter(*pFmt).First(TYPE(SwXFrame))); + SwXFrame* pFrm = SwIterator::FirstElement( *pFmt ); if(!pFrm) pFrm = new typename UnoFrameWrap_traits::core_frame_t(*pFmt); Reference< typename UnoFrameWrap_traits::uno_frame_t > xFrm = @@ -1114,7 +1069,7 @@ sal_Bool SwXFrames::hasElements(void) throw(uno::RuntimeException) SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType) { - SwXFrame* pFrm = (SwXFrame*)SwClientIter(rFmt).First(TYPE(SwXFrame)); + SwXFrame* pFrm = SwIterator::FirstElement( rFmt ); if(pFrm) return pFrm; switch(eType) { @@ -1132,23 +1087,16 @@ SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType) /****************************************************************** * SwXTextFrames ******************************************************************/ -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextFrames"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.TextFrames") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1156,16 +1104,12 @@ Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( Runtim pArray[0] = C2U("com.sun.star.text.TextFrames"); return aRet; } -/*-- 14.01.99 08:06:16--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFrames::SwXTextFrames(SwDoc* _pDoc) : SwXFrames(_pDoc, FLYCNTTYPE_FRM) { } -/*-- 14.01.99 08:06:17--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFrames::~SwXTextFrames() { } @@ -1173,25 +1117,17 @@ SwXTextFrames::~SwXTextFrames() /****************************************************************** * SwXTextGraphicObjects ******************************************************************/ -//SMART_UNO_IMPLEMENTATION( SwXTextGraphicObjects, UsrObject ); - -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextGraphicObjects"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1199,16 +1135,12 @@ Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw pArray[0] = C2U("com.sun.star.text.TextGraphicObjects"); return aRet; } -/*-- 14.01.99 08:45:53--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextGraphicObjects::SwXTextGraphicObjects(SwDoc* _pDoc) : SwXFrames(_pDoc, FLYCNTTYPE_GRF) { } -/*-- 14.01.99 08:45:54--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextGraphicObjects::~SwXTextGraphicObjects() { } @@ -1216,23 +1148,16 @@ SwXTextGraphicObjects::~SwXTextGraphicObjects() /****************************************************************** * SwXTextEmbeddedObjects ******************************************************************/ -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextEmbeddedObjects"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1240,16 +1165,12 @@ Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) thro pArray[0] = C2U("com.sun.star.text.TextEmbeddedObjects"); return aRet; } -/*-- 14.01.99 08:45:13--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextEmbeddedObjects::SwXTextEmbeddedObjects(SwDoc* _pDoc) : SwXFrames(_pDoc, FLYCNTTYPE_OLE) { } -/*-- 14.01.99 08:45:31--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects() { } @@ -1258,23 +1179,16 @@ SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects() * ******************************************************************/ #define PASSWORD_STD_TIMEOUT 1000 -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXTextSections::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextSections"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.TextSections") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1282,22 +1196,16 @@ Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( Runt pArray[0] = C2U("com.sun.star.text.TextSections"); return aRet; } -/*-- 14.01.99 09:06:05--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextSections::SwXTextSections(SwDoc* _pDoc) : SwUnoCollection(_pDoc) { } -/*-- 14.01.99 09:06:05--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextSections::~SwXTextSections() { } -/*-- 14.01.99 09:06:05--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1312,9 +1220,7 @@ sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException ) } return nCount; } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) { @@ -1347,9 +1253,7 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex) throw uno::RuntimeException(); return makeAny(xRet); } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextSections::getByName(const OUString& Name) throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException ) { @@ -1378,9 +1282,7 @@ uno::Any SwXTextSections::getByName(const OUString& Name) throw uno::RuntimeException(); return aRet; } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextSections::getElementNames(void) throw( uno::RuntimeException ) { @@ -1413,9 +1315,7 @@ uno::Sequence< OUString > SwXTextSections::getElementNames(void) } return aSeq; } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextSections::hasByName(const OUString& Name) throw( uno::RuntimeException ) { @@ -1443,16 +1343,12 @@ sal_Bool SwXTextSections::hasByName(const OUString& Name) } return bRet; } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXTextSections::getElementType() throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/*-- 14.01.99 09:06:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1466,9 +1362,7 @@ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return nCount > 0; } -/*-- 14.01.99 09:06:07--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt ) { return SwXTextSection::CreateXTextSection(&rFmt); @@ -1642,23 +1536,16 @@ sal_Bool SwXNumberingRulesCollection::hasElements(void) throw( uno::RuntimeExcep return GetDoc()->GetNumRuleTbl().Count() > 0; } -/* -----------------------------06.04.00 12:44-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXFootnotes"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.Footnotes") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1666,23 +1553,17 @@ Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( Runtime pArray[0] = C2U("com.sun.star.text.Footnotes"); return aRet; } -/*-- 14.01.99 09:03:52--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFootnotes::SwXFootnotes(sal_Bool bEnd, SwDoc* _pDoc) : SwUnoCollection(_pDoc) , m_bEndnote(bEnd) { } -/*-- 14.01.99 09:03:52--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFootnotes::~SwXFootnotes() { } -/*-- 14.01.99 09:03:53--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1701,9 +1582,7 @@ sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException ) } return nCount; } -/*-- 14.01.99 09:03:53--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) { @@ -1737,16 +1616,12 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex) throw uno::RuntimeException(); return aRet; } -/*-- 14.01.99 09:03:53--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXFootnotes::getElementType() throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/*-- 14.01.99 09:03:54--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1754,9 +1629,7 @@ sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return GetDoc()->GetFtnIdxs().Count() > 0; } -/* -----------------------------05.09.00 12:48-------------------------------- - ---------------------------------------------------------------------------*/ Reference SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt ) { return SwXFootnote::CreateXFootnote(rDoc, rFmt); @@ -1765,23 +1638,17 @@ Reference SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rF /****************************************************************** * ******************************************************************/ -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXReferenceMarks"); } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.ReferenceMarks") == rServiceName; } -/* -----------------------------06.04.00 12:44-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -1789,22 +1656,16 @@ Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( Ru pArray[0] = C2U("com.sun.star.text.ReferenceMarks"); return aRet; } -/*-- 14.01.99 09:03:16--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXReferenceMarks::SwXReferenceMarks(SwDoc* _pDoc) : SwUnoCollection(_pDoc) { } -/*-- 14.01.99 09:03:16--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXReferenceMarks::~SwXReferenceMarks() { } -/*-- 14.01.99 09:03:17--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1812,9 +1673,7 @@ sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return GetDoc()->GetRefMarks(); } -/*-- 14.01.99 09:03:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException ) { @@ -1836,9 +1695,7 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex) throw IndexOutOfBoundsException(); return aRet; } -/*-- 14.01.99 09:03:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXReferenceMarks::getByName(const OUString& rName) throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException ) { @@ -1859,9 +1716,7 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName) throw uno::RuntimeException(); return aRet; } -/*-- 14.01.99 09:03:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1879,9 +1734,7 @@ uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::R throw uno::RuntimeException(); return aRet; } -/*-- 14.01.99 09:03:17--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1889,16 +1742,12 @@ sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::Runtime throw uno::RuntimeException(); return 0 != GetDoc()->GetRefMark( rName); } -/*-- 14.01.99 09:03:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXReferenceMarks::getElementType() throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/*-- 14.01.99 09:03:18--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1906,9 +1755,7 @@ sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return 0 != GetDoc()->GetRefMarks(); } -/*-- 14.01.99 09:03:19--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1919,9 +1766,7 @@ SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* /****************************************************************** * ******************************************************************/ -/*-----------------11.03.98 11:18------------------- - Gueltigkeitspruefung ---------------------------------------------------*/ + void SwUnoCollection::Invalidate() { bObjectValid = sal_False; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 0379f9bdc82d..fe5dbba991df 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -385,7 +385,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry { if( pAny ) { - SwXTextField* pField = CreateSwXTextField(*rPam.GetDoc(), + SwXTextField* pField = SwXTextField::CreateSwXTextField(*rPam.GetDoc(), pTxtAttr->GetFld()); *pAny <<= uno::Reference< XTextField >( pField ); } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 9cb7775e3bee..a39931a715f5 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -60,7 +60,6 @@ #include #include #include -// OD 2004-04-21 #i26791# #include #include #include @@ -86,6 +85,7 @@ #include #include #include +#include using ::rtl::OUString; using namespace ::com::sun::star; @@ -94,9 +94,6 @@ DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, SwShapeImplementati static SwShapeImplementationIdMap aImplementationIdMap; -/* -----------------22.01.99 13:19------------------- - * - * --------------------------------------------------*/ class SwShapeDescriptor_Impl { SwFmtHoriOrient* pHOrient; @@ -282,67 +279,50 @@ public: class SwFmDrawPage ****************************************************************************/ -/* -----------------28.01.99 12:03------------------- - * - * --------------------------------------------------*/ SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) : SvxFmDrawPage( pPage ), pPageView(0) { } -/*-- 22.01.99 11:13:07--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwFmDrawPage::~SwFmDrawPage() throw () { RemovePageView(); } -/*-- 22.01.99 11:13:07--------------------------------------------------- - -----------------------------------------------------------------------*/ const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes) { _SelectObjectsInView( xShapes, GetPageView() ); const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); return rMarkList; } -/*-- 22.01.99 11:13:08--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup) { uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY); _SelectObjectInView( xShape, GetPageView() ); } -/*-- 22.01.99 11:13:08--------------------------------------------------- - -----------------------------------------------------------------------*/ SdrPageView* SwFmDrawPage::GetPageView() { if(!pPageView) pPageView = mpView->ShowSdrPage( mpPage ); return pPageView; } -/*-- 22.01.99 11:13:08--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFmDrawPage::RemovePageView() { if(pPageView && mpView) mpView->HideSdrPage(); pPageView = 0; } -/*-- 22.01.99 11:13:09--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj ) { uno::Reference< XInterface > xShape; if( pObj ) { SwFrmFmt* pFmt = ::FindFrmFmt( pObj ); - SwXShape* pxShape = (SwXShape*)SwClientIter( *pFmt ). - First( TYPE( SwXShape )); + SwXShape* pxShape = SwIterator::FirstElement( *pFmt ); if(pxShape) { xShape = *(cppu::OWeakObject*)pxShape; @@ -352,17 +332,12 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj } return xShape; } -/*-- 22.01.99 11:13:09--------------------------------------------------- - -----------------------------------------------------------------------*/ SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) throw () { //TODO: stimmt das so - kann die Methode weg? return SvxFmDrawPage::_CreateSdrObject( xShape ); } -/*-- 22.01.99 11:13:09--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) const throw () { @@ -507,23 +482,17 @@ uno::Reference< container::XEnumeration > SwXDrawPage::createEnumeration(void) t return uno::Reference< container::XEnumeration >( new SwXShapesEnumeration(this)); } -/* -----------------------------06.04.00 13:14-------------------------------- - ---------------------------------------------------------------------------*/ rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXDrawPage"); } -/* -----------------------------06.04.00 13:14-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName; } -/* -----------------------------06.04.00 13:14-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< rtl::OUString > aRet(1); @@ -531,17 +500,13 @@ uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw pArray[0] = C2U("com.sun.star.drawing.GenericDrawPage"); return aRet; } -/*-- 22.01.99 11:22:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXDrawPage::SwXDrawPage(SwDoc* pDc) : pDoc(pDc), pDrawPage(0) { } -/*-- 22.01.99 11:22:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXDrawPage::~SwXDrawPage() { if(xPageAgg.is()) @@ -550,9 +515,7 @@ SwXDrawPage::~SwXDrawPage() xPageAgg->setDelegator(xInt); } } -/* -----------------------------15.06.00 15:00-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException ) { @@ -572,9 +535,7 @@ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType ) } return aRet; } -/* -----------------------------15.06.00 15:01-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException ) { uno::Sequence< uno::Type > aPageTypes = SwXDrawPageBaseClass::getTypes(); @@ -593,9 +554,7 @@ uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException pPageTypes[nIndex] = ::getCppuType((uno::Reference*)0); return aPageTypes; } -/*-- 22.01.99 11:33:44--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -609,9 +568,7 @@ sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException ) return pDrawPage->getCount(); } } -/*-- 22.01.99 11:33:46--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) @@ -625,16 +582,12 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex) ((SwXDrawPage*)this)->GetSvxPage(); return pDrawPage->getByIndex( nIndex ); } -/* -----------------22.01.99 13:13------------------- - * - * --------------------------------------------------*/ + uno::Type SwXDrawPage::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((const uno::Reference*)0); } -/* -----------------22.01.99 13:13------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -646,9 +599,6 @@ sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException ) return ((SwXDrawPage*)this)->GetSvxPage()->hasElements(); } -/* -----------------22.01.99 12:42------------------- - * - * --------------------------------------------------*/ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) throw( uno::RuntimeException ) { @@ -821,9 +771,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) delete pPam; delete pInternalPam; } -/* -----------------22.01.99 12:42------------------- - * - * --------------------------------------------------*/ + void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -832,9 +780,7 @@ void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw uno::Reference xComp(xShape, uno::UNO_QUERY); xComp->dispose(); } -/* -----------------17.02.99 10:38------------------- - * - * --------------------------------------------------*/ + uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< drawing::XShapes > & xShapes) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -888,9 +834,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< } return xRet; } -/* -----------------17.02.99 10:38------------------- - * - * --------------------------------------------------*/ + void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeGroup) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -914,9 +858,7 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG pPage->RemovePageView(); } } -/* -----------------05.05.98 17:05------------------- - * - * --------------------------------------------------*/ + SwFmDrawPage* SwXDrawPage::GetSvxPage() { if(!xPageAgg.is() && pDoc) @@ -952,17 +894,13 @@ void SwXDrawPage::InvalidateSwDoc() ****************************************************************************/ TYPEINIT1(SwXShape, SwClient); -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -996,9 +934,7 @@ namespace } } -/* -----------------01.02.99 11:38------------------- - * - * --------------------------------------------------*/ + SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)), m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)), @@ -1048,9 +984,6 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : } } -/*-- 09.04.09 15:06:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj ) { SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS ); @@ -1085,9 +1018,7 @@ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj ) } } -/*-- 22.01.99 11:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXShape::~SwXShape() { if (xShapeAgg.is()) @@ -1097,9 +1028,7 @@ SwXShape::~SwXShape() } delete pImpl; } -/* -----------------------------16.06.00 12:21-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException ) { uno::Any aRet = SwXShapeBaseClass::queryInterface(aType); @@ -1116,9 +1045,7 @@ uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeE // <-- return aRet; } -/* -----------------------------16.06.00 12:21-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException) { uno::Sequence< uno::Type > aRet = SwXShapeBaseClass::getTypes(); @@ -1142,9 +1069,7 @@ uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException) } return aRet; } -/* -----------------------------04.04.01 07:37-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); @@ -1186,9 +1111,7 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeEx return *pImplementationId; } } -/*-- 22.01.99 11:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1211,9 +1134,7 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th aRet = m_pPropSet->getPropertySetInfo(); return aRet; } -/*-- 22.01.99 11:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, @@ -1575,9 +1496,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A } } } -/*-- 22.01.99 11:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) @@ -1807,12 +1726,6 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) return aRet; } -/** method to get property from aggregation object - - OD 2004-10-28 #i36248# - - @author OD -*/ uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName ) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) @@ -1834,9 +1747,6 @@ uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName ) } -/* -----------------------------02.11.00 09:41-------------------------------- - - ---------------------------------------------------------------------------*/ beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyName ) throw(beans::UnknownPropertyException, uno::RuntimeException) { @@ -1847,9 +1757,7 @@ beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyN uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames); return aStates.getConstArray()[0]; } -/* -----------------------------02.11.00 09:41-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyNames ) throw(beans::UnknownPropertyException, uno::RuntimeException) @@ -1951,9 +1859,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates( throw uno::RuntimeException(); return aRet; } -/* -----------------------------02.11.00 09:41-------------------------------- - ---------------------------------------------------------------------------*/ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName ) throw(beans::UnknownPropertyException, uno::RuntimeException) { @@ -2015,9 +1921,7 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName ) else throw uno::RuntimeException(); } -/* -----------------------------02.11.00 09:41-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName ) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) @@ -2053,9 +1957,7 @@ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName ) throw uno::RuntimeException(); return aRet; } -/*-- 22.01.99 11:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXShape::addPropertyChangeListener( const rtl::OUString& _propertyName, const uno::Reference< beans::XPropertyChangeListener > & _listener ) @@ -2070,9 +1972,7 @@ void SwXShape::addPropertyChangeListener( if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps ) xShapeProps->addPropertyChangeListener( _propertyName, _listener ); } -/*-- 22.01.99 11:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXShape::removePropertyChangeListener( const rtl::OUString& _propertyName, const uno::Reference< beans::XPropertyChangeListener > & _listener) @@ -2087,9 +1987,7 @@ void SwXShape::removePropertyChangeListener( if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps ) xShapeProps->removePropertyChangeListener( _propertyName, _listener ); } -/*-- 22.01.99 11:42:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXShape::addVetoableChangeListener( const rtl::OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/ ) @@ -2098,9 +1996,7 @@ void SwXShape::addVetoableChangeListener( { DBG_WARNING("not implemented"); } -/*-- 22.01.99 11:42:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXShape::removeVetoableChangeListener( const rtl::OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) @@ -2109,16 +2005,12 @@ void SwXShape::removeVetoableChangeListener( { DBG_WARNING("not implemented"); } -/*-- 22.01.99 11:42:28--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXShape::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXShape::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -/* -----------------14.04.99 13:02------------------- - * - * --------------------------------------------------*/ + void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -2186,9 +2078,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) } } } -/* -----------------14.04.99 13:02------------------- - * - * --------------------------------------------------*/ + uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2210,9 +2100,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim aRef = pImpl->GetTextRange(); return aRef; } -/* -----------------14.04.99 13:02------------------- - * - * --------------------------------------------------*/ + void SwXShape::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2263,9 +2151,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException ) xComp->dispose(); } } -/* -----------------14.04.99 13:02------------------- - * - * --------------------------------------------------*/ + void SwXShape::addEventListener( const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) @@ -2275,9 +2161,7 @@ void SwXShape::addEventListener( if(pSvxShape) pSvxShape->addEventListener(aListener); } -/* -----------------14.04.99 13:02------------------- - * - * --------------------------------------------------*/ + void SwXShape::removeEventListener( const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) @@ -2286,16 +2170,12 @@ void SwXShape::removeEventListener( if(pSvxShape) pSvxShape->removeEventListener(aListener); } -/* -----------------03.06.99 08:53------------------- - * - * --------------------------------------------------*/ + rtl::OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXShape"); } -/* -----------------03.06.99 08:53------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException ) { sal_Bool bRet = sal_False; @@ -2309,9 +2189,7 @@ sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno } return bRet; } -/* -----------------03.06.99 08:53------------------- - * - * --------------------------------------------------*/ + uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< rtl::OUString > aSeq; @@ -2329,9 +2207,7 @@ uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( u } return aSeq; } -/* -----------------------------15.03.00 14:54-------------------------------- - ---------------------------------------------------------------------------*/ SvxShape* SwXShape::GetSvxShape() { SvxShape* pSvxShape = 0; @@ -2909,9 +2785,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) return aConvertedPath; } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) : SwXShape(xShape) { @@ -2921,15 +2795,11 @@ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) : #endif } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXGroupShape::~SwXGroupShape() { } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) { uno::Any aRet; @@ -2939,23 +2809,17 @@ uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::Runt aRet = SwXShape::queryInterface(rType); return aRet; } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXGroupShape::acquire( ) throw() { SwXShape::acquire(); } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXGroupShape::release( ) throw() { SwXShape::release(); } -/*-- 31.05.01 09:59:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3014,9 +2878,7 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru else throw uno::RuntimeException(); } -/*-- 31.05.01 09:59:20--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3031,9 +2893,7 @@ void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno: throw uno::RuntimeException(); xShapes->remove(xShape); } -/*-- 31.05.01 09:59:20--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3048,9 +2908,7 @@ sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return xAcc->getCount(); } -/*-- 31.05.01 09:59:20--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) @@ -3067,9 +2925,7 @@ uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex) throw uno::RuntimeException(); return xAcc->getByIndex(nIndex); } -/*-- 31.05.01 09:59:20--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3084,9 +2940,7 @@ uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException) throw uno::RuntimeException(); return xAcc->getElementType(); } -/*-- 31.05.01 09:59:22--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXGroupShape::hasElements( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index bd4a4ce5ef98..4608b0b6d05b 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -93,6 +93,7 @@ #include #include #include // MetaFieldManager +#include using ::rtl::OUString; using namespace ::com::sun::star; @@ -392,17 +393,13 @@ USHORT lcl_GetPropertyMapOfService( USHORT nServiceId ) * SwXFieldMaster ******************************************************************/ TYPEINIT1(SwXFieldMaster, SwClient); -/* -----------------------------13.03.00 12:15-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -414,16 +411,12 @@ sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 > } return 0; } -/* -----------------------------06.04.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXFieldMaster"); } -/* -----------------------------06.04.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { sal_Bool bRet = sal_False; @@ -452,9 +445,7 @@ BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::R } return bRet; } -/* -----------------------------06.04.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(2); @@ -479,9 +470,7 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( } return aRet; } -/*-- 14.12.98 11:08:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) : aLstnrCntnr( (XPropertySet*)this), nResTypeId(nResId), @@ -494,9 +483,7 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) : { pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); } -/*-- 14.12.98 11:08:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) : SwClient(&rType), aLstnrCntnr( (XPropertySet*)this), @@ -509,16 +496,12 @@ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) : { } -/*-- 14.12.98 11:08:34--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFieldMaster::~SwXFieldMaster() { } -/*-- 14.12.98 11:08:35--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(void) throw( uno::RuntimeException ) { @@ -528,9 +511,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(vo lcl_GetPropMapIdForFieldType( nResTypeId ) )->getPropertySetInfo(); return aRef; } -/*-- 14.12.98 11:08:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName, const uno::Any& rValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, @@ -712,9 +693,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName, } } } -/* -----------------------------30.03.01 14:40-------------------------------- - ---------------------------------------------------------------------------*/ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const { if(!bDontCreate && RES_DBFLD == nResTypeId && m_bIsDescriptor && m_pDoc) @@ -743,9 +722,7 @@ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const return (SwFieldType*)GetRegisteredIn(); } -/*-- 14.12.98 11:08:36--------------------------------------------------- - -----------------------------------------------------------------------*/ typedef SwFmtFld* SwFmtFldPtr; SV_DECL_PTRARR(SwDependentFields, SwFmtFldPtr, 5, 5) SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr) @@ -772,21 +749,22 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName) else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DEPENDENT_TEXT_FIELDS)) ) { //fill all text fields into a sequence - SwClientIter aIter( *pType ); SwDependentFields aFldArr; - SwFmtFldPtr pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *pType ); + SwFmtFldPtr pFld = aIter.First(); while(pFld) { if(pFld->IsFldInDoc()) aFldArr.Insert(pFld, aFldArr.Count()); - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } + uno::Sequence > aRetSeq(aFldArr.Count()); uno::Reference* pRetSeq = aRetSeq.getArray(); for(USHORT i = 0; i < aFldArr.Count(); i++) { pFld = aFldArr.GetObject(i); - SwXTextField * pInsert = CreateSwXTextField(*GetDoc(), *pFld); + SwXTextField * pInsert = SwXTextField::CreateSwXTextField(*GetDoc(), *pFld); pRetSeq[i] = uno::Reference(pInsert); } @@ -900,38 +878,28 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName) } return aRet; } -/*-- 14.12.98 11:08:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:08:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:08:37--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:08:37--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 25.02.99 11:01:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -947,8 +915,8 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException ) } // zuerst alle Felder loeschen - SwClientIter aIter( *pFldType ); - SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *pFldType ); + SwFmtFld* pFld = aIter.First(); while(pFld) { // Feld im Undo? @@ -961,7 +929,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException ) aPam.Move(); GetDoc()->DeleteAndJoin(aPam); } - pFld = (SwFmtFld*)aIter.Next(); + pFld = aIter.Next(); } // dann den FieldType loeschen GetDoc()->RemoveFldType(nTypeIdx); @@ -969,9 +937,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 25.02.99 11:02:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { @@ -979,9 +945,7 @@ void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener throw uno::RuntimeException(); aLstnrCntnr.AddListener(aListener); } -/*-- 25.02.99 11:02:02--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { @@ -989,10 +953,8 @@ void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListe throw uno::RuntimeException(); } -/*-- 14.12.98 11:08:38--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -1001,31 +963,7 @@ void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) m_pDoc = 0; } } -/* -----------------------------06.11.00 09:44-------------------------------- - -const Programmatic2UIName_Impl* lcl_GetFieldNameTable() -{ - static BOOL bInitialized = FALSE; - static Programmatic2UIName_Impl aFieldNames[5]; - if(!bInitialized) - { - bInitialized = TRUE; - int nName = 0; - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_ABB )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_ABB)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_TABLE )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_TABLE)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_FRAME)); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_FRAME)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_DRAWING )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_DRAWING)); - } - return &aFieldNames[0]; -} - ---------------------------------------------------------------------------*/ -/* -----------------------------06.11.00 10:26-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc) { OUString sRet(rType.GetName()); @@ -1043,9 +981,7 @@ OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rD } return sRet; } -/* -----------------------------06.11.00 14:12-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXFieldMaster::LocalizeFormula( const SwSetExpField& rFld, const OUString& rFormula, @@ -1068,12 +1004,11 @@ OUString SwXFieldMaster::LocalizeFormula( } -SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt) +SwXTextField* SwXTextField::CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt) { - SwClientIter aIter(*rFmt.GetFld()->GetTyp()); + SwIterator aIter(*rFmt.GetFld()->GetTyp()); SwXTextField * pField = 0; - SwXTextField * pTemp = - static_cast(aIter.First( TYPE(SwXTextField) )); + SwXTextField * pTemp = aIter.First(); while (pTemp) { if (pTemp->GetFldFmt() == &rFmt) @@ -1081,7 +1016,7 @@ SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt) pField = pTemp; break; } - pTemp = static_cast(aIter.Next()); + pTemp = aIter.Next(); } return pField ? pField : new SwXTextField( rFmt, &rDoc ); } @@ -1136,17 +1071,13 @@ struct SwFieldProperties_Impl }; TYPEINIT1(SwXTextField, SwClient); -/* -----------------------------13.03.00 12:15-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -1158,9 +1089,6 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& } return 0; } -/*-- 14.12.98 11:37:14--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) : aLstnrCntnr( (XTextContent*)this), @@ -1184,9 +1112,7 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) : m_pProps->nUSHORT2 = USHRT_MAX; } -/*-- 14.12.98 11:37:15--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) : aLstnrCntnr( (XTextContent*)this), pFmtFld(&rFmt), @@ -1199,9 +1125,7 @@ SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) : { pDc->GetUnoCallBack()->Add(this); } -/*-- 14.12.98 11:37:15--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextField::~SwXTextField() { if ( m_pTextObject ) @@ -1212,9 +1136,7 @@ SwXTextField::~SwXTextField() delete m_pProps; } -/*-- 14.12.98 11:37:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertySet > & xFieldMaster) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -1237,9 +1159,7 @@ void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertyS throw lang::IllegalArgumentException(); } -/*-- 14.12.98 11:37:16--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1254,16 +1174,14 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th throw uno::RuntimeException(); pType = pFmtFld->GetFld()->GetTyp(); } - SwXFieldMaster* pMaster = (SwXFieldMaster*) - SwClientIter(*pType).First(TYPE(SwXFieldMaster)); + + SwXFieldMaster* pMaster = SwIterator::FirstElement( *pType ); if(!pMaster) pMaster = new SwXFieldMaster(*pType, GetDoc()); return pMaster; } -/*-- 14.12.98 11:37:16--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1275,9 +1193,7 @@ OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::Runtim throw uno::RuntimeException(); return sRet; } -/* -----------------18.02.99 13:39------------------- - * - * --------------------------------------------------*/ + void SwXTextField::attachToRange( const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) @@ -1851,18 +1767,14 @@ void SwXTextField::attachToRange( else throw lang::IllegalArgumentException(); } -/*-- 14.12.98 11:37:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); attachToRange( xTextRange ); } -/*-- 14.12.98 11:37:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1883,9 +1795,7 @@ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::Ru return aRef; } -/*-- 14.12.98 11:37:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1908,26 +1818,20 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException ) m_pTextObject = 0; } } -/*-- 14.12.98 11:37:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn()) throw uno::RuntimeException(); aLstnrCntnr.AddListener(aListener); } -/*-- 14.12.98 11:37:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) throw uno::RuntimeException(); } -/*-- 14.12.98 11:37:19--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void) throw( uno::RuntimeException ) { @@ -1949,9 +1853,7 @@ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void throw uno::RuntimeException(); return aRef; } -/*-- 14.12.98 11:37:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) @@ -2112,9 +2014,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An else throw uno::RuntimeException(); } -/*-- 14.12.98 11:37:19--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -2300,37 +2200,27 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName) } return aRet; } -/*-- 14.12.98 11:37:20--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:37:20--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:37:20--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 14.12.98 11:37:20--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/* -----------------------------23.03.01 13:15-------------------------------- - ---------------------------------------------------------------------------*/ void SwXTextField::update( ) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2381,22 +2271,17 @@ void SwXTextField::update( ) throw (uno::RuntimeException) } // --> FME 2004-10-06 #116480# // Text formatting has to be triggered. - const_cast(pFmtFld)->Modify( 0, 0 ); + const_cast(pFmtFld)->ModifyNotification( 0, 0 ); // <-- } else m_bCallUpdate = sal_True; } -/* -----------------19.03.99 14:11------------------- - * - * --------------------------------------------------*/ + OUString SwXTextField::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextField"); } -/* -----------------19.03.99 14:11------------------- - * - * --------------------------------------------------*/ static OUString OldNameToNewName_Impl( const OUString &rOld ) { @@ -2426,9 +2311,7 @@ sal_Bool SwXTextField::supportsService(const OUString& rServiceName) throw( uno: rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent")); } -/* -----------------19.03.99 14:11------------------- - * - * --------------------------------------------------*/ + uno::Sequence< OUString > SwXTextField::getSupportedServiceNames(void) throw( uno::RuntimeException ) { OUString sServiceName = SwXServiceProvider::GetProviderName(m_nServiceId); @@ -2458,10 +2341,8 @@ void SwXTextField::Invalidate() } } -/* -----------------14.12.98 12:00------------------- - * - * --------------------------------------------------*/ -void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) + +void SwXTextField::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { switch( pOld ? pOld->Which() : 0 ) { @@ -2483,9 +2364,7 @@ void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) break; } } -/*-- 14.12.98 11:37:21--------------------------------------------------- - -----------------------------------------------------------------------*/ const SwField* SwXTextField::GetField() const { if(GetRegisteredIn() && pFmtFld) @@ -2493,30 +2372,19 @@ const SwField* SwXTextField::GetField() const return 0; } -/****************************************************************** - * - ******************************************************************/ /****************************************************************** * SwXTextFieldMasters ******************************************************************/ -/* -----------------------------06.04.00 13:22-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextFieldMasters"); } -/* -----------------------------06.04.00 13:22-------------------------------- - - ---------------------------------------------------------------------------*/ BOOL SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextFieldMasters" )); } -/* -----------------------------06.04.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -2524,21 +2392,17 @@ uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) th pArray[0] = C2U("com.sun.star.text.TextFieldMasters"); return aRet; } -/*-- 21.12.98 10:37:14--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFieldMasters::SwXTextFieldMasters(SwDoc* _pDoc) : SwUnoCollection(_pDoc) { } -/*-- 21.12.98 10:37:32--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFieldMasters::~SwXTextFieldMasters() { } -/*-- 21.12.98 10:37:33--------------------------------------------------- +/*----------------------------------------------------------------------- Iteration ueber nicht-Standard Feldtypen USER/SETEXP/DDE/DATABASE Der Name ist demnach: @@ -2610,17 +2474,14 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName) SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True); if(!pType) throw container::NoSuchElementException(); - SwXFieldMaster* pMaster = (SwXFieldMaster*) - SwClientIter(*pType).First(TYPE(SwXFieldMaster)); + SwXFieldMaster* pMaster = SwIterator::FirstElement( *pType ); if(!pMaster) pMaster = new SwXFieldMaster(*pType, GetDoc()); uno::Reference< beans::XPropertySet > aRef = pMaster; uno::Any aRet(&aRef, ::getCppuType( static_cast* >(0))); return aRet; } -/*-- 06.03.2001 11:29:34,5------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextFieldMasters::getInstanceName( const SwFieldType& rFldType, String& rName) { @@ -2667,9 +2528,6 @@ sal_Bool SwXTextFieldMasters::getInstanceName( } -/*-- 21.12.98 10:37:33--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void) throw( uno::RuntimeException ) { @@ -2707,9 +2565,7 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void) return aSeq; } -/*-- 21.12.98 10:37:33--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2726,17 +2582,13 @@ sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::Runti } return bRet; } -/*-- 21.12.98 10:37:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXTextFieldMasters::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType(static_cast*>(0)); } -/*-- 21.12.98 10:37:34--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2748,24 +2600,18 @@ sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException ) /****************************************************************** * ******************************************************************/ -/* -----------------------------06.04.00 13:24-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextFieldTypes"); } -/* -----------------------------06.04.00 13:24-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextFields" )); } -/* -----------------------------06.04.00 13:24-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -2773,31 +2619,23 @@ uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) thro pArray[0] = C2U("com.sun.star.text.TextFields"); return aRet; } -/*-- 21.12.98 10:35:15--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFieldTypes::SwXTextFieldTypes(SwDoc* _pDoc) : SwUnoCollection (_pDoc), aRefreshCont ( static_cast< XEnumerationAccess * >(this) ) { } -/*-- 21.12.98 10:35:16--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFieldTypes::~SwXTextFieldTypes() { } -/*-- 11.07.02 14:25:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextFieldTypes::Invalidate() { SwUnoCollection::Invalidate(); aRefreshCont.Disposing(); } -/*-- 21.12.98 10:35:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(void) throw( uno::RuntimeException ) { @@ -2807,16 +2645,12 @@ uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration( return new SwXFieldEnumeration(GetDoc()); } -/*-- 21.12.98 10:35:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXTextFieldTypes::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType(static_cast*>(0)); } -/*-- 21.12.98 10:35:17--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2825,9 +2659,7 @@ sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException ) //es gibt sie immer return sal_True; } -/* -----------------24.02.99 16:19------------------- - * - * --------------------------------------------------*/ + void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2841,9 +2673,7 @@ void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException ) // call refresh listeners aRefreshCont.Refreshed(); } -/* -----------------24.02.99 16:19------------------- - * - * --------------------------------------------------*/ + void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshListener > & l) throw( uno::RuntimeException ) { @@ -2852,9 +2682,7 @@ void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshL throw uno::RuntimeException(); aRefreshCont.AddListener ( reinterpret_cast < const uno::Reference < lang::XEventListener > &> ( l )); } -/* -----------------24.02.99 16:19------------------- - * - * --------------------------------------------------*/ + void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefreshListener > & l) throw( uno::RuntimeException ) { @@ -2865,24 +2693,18 @@ void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefre /****************************************************************** * SwXFieldEnumeration ******************************************************************/ -/* -----------------------------06.04.00 13:25-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXFieldEnumeration"); } -/* -----------------------------06.04.00 13:25-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.FieldEnumeration" )); } -/* -----------------------------06.04.00 13:25-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -2890,9 +2712,7 @@ uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) th pArray[0] = C2U("com.sun.star.text.FieldEnumeration"); return aRet; } -/* -----------------21.12.98 14:57------------------- - * - * --------------------------------------------------*/ + SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) : nNextIndex(0), pDoc(pDc) @@ -2910,9 +2730,8 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) : for(sal_uInt16 nType = 0; nType < nCount; ++nType) { const SwFieldType *pCurType = pFldTypes->GetObject(nType); - - SwClientIter aIter( *(SwFieldType*)pCurType ); - const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); + SwIterator aIter( *pCurType ); + const SwFmtFld* pCurFldFmt = aIter.First(); while (pCurFldFmt) { const SwTxtFld *pTxtFld = pCurFldFmt->GetTxtFld(); @@ -2922,7 +2741,7 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) : !pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes(); if (!bSkip) pItems[ nFillPos++ ] = new SwXTextField(*pCurFldFmt, pDoc); - pCurFldFmt = (SwFmtFld*)aIter.Next(); + pCurFldFmt = aIter.Next(); // enlarge sequence if necessary if (aItems.getLength() == nFillPos) @@ -2951,25 +2770,19 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) : // resize sequence to actual used size aItems.realloc( nFillPos ); } -/*-- 21.12.98 14:57:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFieldEnumeration::~SwXFieldEnumeration() { } -/*-- 21.12.98 14:57:42--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXFieldEnumeration::hasMoreElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); return nNextIndex < aItems.getLength(); } -/*-- 21.12.98 14:57:42--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXFieldEnumeration::nextElement(void) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -2987,10 +2800,8 @@ uno::Any SwXFieldEnumeration::nextElement(void) rxFld = 0; // free memory for item that is not longer used return aRet; } -/* -----------------21.12.98 15:08------------------- - * - * --------------------------------------------------*/ -void SwXFieldEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) + +void SwXFieldEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index f349cbb40027..fd1918d0d22d 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -308,7 +308,7 @@ SwXFlatParagraphIterator::~SwXFlatParagraphIterator() } -void SwXFlatParagraphIterator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwXFlatParagraphIterator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { ClientModify( this, pOld, pNew ); // check if document gets closed... diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 3a3df506b457..1e64c370839b 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -113,12 +113,10 @@ #include #include #include -// DVO, OD 01.10.2003 #i18732# #include -// OD 2004-05-05 #i28701# #include - #include +#include // from fefly1.cxx extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ); @@ -153,33 +151,21 @@ public: virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0; }; -/* -----------------------------12.06.01 15:46-------------------------------- - ---------------------------------------------------------------------------*/ BaseFrameProperties_Impl::~BaseFrameProperties_Impl() { } -/* -----------------------------12.06.01 15:43-------------------------------- - ---------------------------------------------------------------------------*/ void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal) { aAnyMap.SetValue( nWID, nMemberId, rVal ); } -/* -----------------------------12.06.01 15:43-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& rpAny) { return aAnyMap.FillValue( nWID, nMemberId, rpAny ); } -//void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny ) -//{ -// rAny = rxPropertySet->getPropertyValue( rPropertyName ); -//} -/* -----------------29.06.98 09:55------------------- - * - * --------------------------------------------------*/ + sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, sal_Bool& rSizeFound) { sal_Bool bRet = sal_True; @@ -527,31 +513,21 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const return bRet; } -/* -----------------22.06.98 09:17------------------- - * - * --------------------------------------------------*/ class SwFrameProperties_Impl : public BaseFrameProperties_Impl { -protected: -// SwFrameProperties_Impl(/*const :: SfxItemPropertyMap* pMap*/) : -// BaseFrameProperties_Impl(/*pMap*/){} public: SwFrameProperties_Impl(); virtual ~SwFrameProperties_Impl(){} virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound); }; -/* -----------------22.06.98 09:17------------------- - * - * --------------------------------------------------*/ + SwFrameProperties_Impl::SwFrameProperties_Impl(): BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ ) { } -/* -----------------22.06.98 11:27------------------- - * - * --------------------------------------------------*/ + inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const :: uno::Any *pAny) { if ( pAny ) @@ -611,17 +587,13 @@ public: virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound); }; -/* -----------------27.06.98 14:53------------------- - * - * --------------------------------------------------*/ + SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) : BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ ) { } -/* -----------------27.06.98 14:40------------------- - * - * --------------------------------------------------*/ + inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, sal_Bool &rRet ) { if(pHEvenMirror || pHOddMirror || pVMirror ) @@ -708,9 +680,6 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet( return bRet; } -/* -----------------4/1/2003 13:54------------------- - - --------------------------------------------------*/ class SwOLEProperties_Impl : public SwFrameProperties_Impl { @@ -721,9 +690,6 @@ public: virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound); }; -/* -----------------4/1/2003 15:32------------------- - - --------------------------------------------------*/ sal_Bool SwOLEProperties_Impl::AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) @@ -739,17 +705,13 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet( /****************************************************************** * SwXFrame ******************************************************************/ -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -761,30 +723,21 @@ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& r } return 0; } -/*-----------------24.03.98 14:49------------------- - ---------------------------------------------------*/ TYPEINIT1(SwXFrame, SwClient); -/* -----------------------------06.04.00 14:20-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXFrame"); } -/* -----------------------------06.04.00 14:20-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException ) { return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")|| !rServiceName.compareToAscii("com.sun.star.text.TextContent") || !rServiceName.compareToAscii("com.sun.star.document.LinkTarget"); } -/* -----------------------------06.04.00 14:20-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(3); @@ -796,9 +749,6 @@ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::R } -/*-- 14.01.99 11:31:52--------------------------------------------------- - Dieser CTor legt den Frame als Descriptor an - -----------------------------------------------------------------------*/ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pDoc) : aLstnrCntnr( (container::XNamed*)this), m_pPropSet(pSet), @@ -850,9 +800,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pD } } -/*-- 11.12.98 15:05:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertySet* pSet) : SwClient( &rFrmFmt ), aLstnrCntnr( (container::XNamed*)this), @@ -865,20 +813,13 @@ SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertyS { } -/*-- 11.12.98 15:05:02--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFrame::~SwXFrame() { delete m_pCopySource; delete pProps; } -/*-- 11.12.98 15:05:03--------------------------------------------------- - - -----------------------------------------------------------------------*/ -/*-- 11.12.98 15:05:03--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXFrame::getName(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -892,9 +833,7 @@ OUString SwXFrame::getName(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return sRet; } -/*-- 11.12.98 15:05:03--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -913,9 +852,7 @@ void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 11.12.98 15:05:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) throw( uno::RuntimeException ) { uno::Reference< beans::XPropertySetInfo > xRef; @@ -944,9 +881,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) th } return xRef; } -/*-- 15.05.06 12:21:43--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::SetSelection(SwPaM& rCopySource) { if(m_pCopySource) @@ -955,9 +890,6 @@ void SwXFrame::SetSelection(SwPaM& rCopySource) m_pCopySource->SetMark(); *m_pCopySource->GetMark() = *rCopySource.End(); } -/*-- 11.12.98 15:05:04--------------------------------------------------- - - -----------------------------------------------------------------------*/ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt ) { @@ -1470,9 +1402,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: else throw uno::RuntimeException(); } -/*-- 11.12.98 15:05:04--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -1697,11 +1627,9 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) // format document completely in order to get correct value pFmt->GetDoc()->GetEditShell()->CalcLayout(); - SwClientIter aIter( *pFmt ); - SwClient* pC = aIter.First( TYPE( SwFrm ) ); - if (pC) + SwFrm* pTmpFrm = SwIterator::FirstElement( *pFmt ); + if ( pTmpFrm ) { - SwFrm *pTmpFrm = static_cast< SwFrm * >(pC); DBG_ASSERT( pTmpFrm->IsValid(), "frame not valid" ); const SwRect &rRect = pTmpFrm->Frm(); Size aMM100Size = OutputDevice::LogicToLogic( @@ -1733,45 +1661,35 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) throw uno::RuntimeException(); return aAny; } -/*-- 11.12.98 15:05:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 15:05:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 15:05:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 15:05:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 12.09.00 14:04:53--------------------------------------------------- - -----------------------------------------------------------------------*/ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName ) throw(beans::UnknownPropertyException, uno::RuntimeException) { @@ -1782,9 +1700,7 @@ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName ) uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aPropertyNames); return aStates.getConstArray()[0]; } -/*-- 12.09.00 14:04:54--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( const uno::Sequence< OUString >& aPropertyNames ) throw(beans::UnknownPropertyException, uno::RuntimeException) @@ -1848,9 +1764,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( throw uno::RuntimeException(); return aStates; } -/*-- 12.09.00 14:04:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) throw(beans::UnknownPropertyException, uno::RuntimeException) { @@ -1947,9 +1861,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) throw uno::RuntimeException(); } -/*-- 12.09.00 14:04:55--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { @@ -1975,27 +1887,21 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName ) throw uno::RuntimeException(); return aRet; } -/* -----------------22.04.99 14:59------------------- - * - * --------------------------------------------------*/ + void SwXFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn()) throw uno::RuntimeException(); aLstnrCntnr.AddListener(aListener); } -/* -----------------22.04.99 14:59------------------- - * - * --------------------------------------------------*/ + void SwXFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) throw uno::RuntimeException(); } -/*-- 11.12.98 15:05:06--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -2007,9 +1913,7 @@ void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) } } -/*-- 11.12.98 15:23:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2038,9 +1942,7 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException ) } } -/*-- 11.12.98 16:02:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2062,9 +1964,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim throw uno::RuntimeException(); return aRef; } -/* -----------------14.01.99 12:02------------------- - * - * --------------------------------------------------*/ + void SwXFrame::ResetDescriptor() { bIsDescriptor = sal_False; @@ -2072,9 +1972,7 @@ void SwXFrame::ResetDescriptor() mxStyleFamily.clear(); DELETEZ(pProps); } -/* -----------------18.02.99 13:34------------------- - * - * --------------------------------------------------*/ + void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -2406,9 +2304,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan //setzt das Flag zurueck und loescht den Descriptor-Pointer ResetDescriptor(); } -/* -----------------------------04.04.01 14:27-------------------------------- - ---------------------------------------------------------------------------*/ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -2443,9 +2339,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) throw lang::IllegalArgumentException(); } } -/*-- 22.04.99 08:03:20--------------------------------------------------- - -----------------------------------------------------------------------*/ awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2453,9 +2347,7 @@ awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException ) aRuntime.Message = C2U("position cannot be determined with this method"); throw aRuntime; } -/*-- 22.04.99 08:03:21--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2463,27 +2355,21 @@ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeE aRuntime.Message = C2U("position cannot be changed with this method"); throw aRuntime; } -/*-- 22.04.99 08:03:21--------------------------------------------------- - -----------------------------------------------------------------------*/ awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException ) { const ::uno::Any aVal = getPropertyValue(C2U("Size")); awt::Size* pRet = (awt::Size*)aVal.getValue(); return *pRet; } -/*-- 22.04.99 08:03:21--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFrame::setSize(const awt::Size& aSize) throw( beans::PropertyVetoException, uno::RuntimeException ) { const ::uno::Any aVal(&aSize, ::getCppuType(static_cast(0))); setPropertyValue(C2U("Size"), aVal); } -/*-- 22.04.99 08:03:21--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException ) { return C2U("FrameShape"); @@ -2493,46 +2379,34 @@ OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException ) /****************************************************************** * SwXTextFrame ******************************************************************/ -/*-- 14.01.99 11:27:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) : SwXText(0, CURSOR_FRAME), SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME), _pDoc ) { } -/*-- 11.12.98 15:23:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFrame::SwXTextFrame(SwFrmFmt& rFmt) : SwXText(rFmt.GetDoc(), CURSOR_FRAME), SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME)) { } -/*-- 11.12.98 15:23:02--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextFrame::~SwXTextFrame() { } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextFrame::acquire( )throw() { SwXFrame::acquire(); } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextFrame::release( )throw() { SwXFrame::release(); } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ ::uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType ) throw (uno::RuntimeException) { @@ -2543,9 +2417,7 @@ void SAL_CALL SwXTextFrame::release( )throw() aRet = SwXTextFrameBaseClass::queryInterface(aType); return aRet; } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::RuntimeException) { uno::Sequence< uno::Type > aTextFrameTypes = SwXTextFrameBaseClass::getTypes(); @@ -2570,9 +2442,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim return aTextFrameTypes; } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2585,16 +2455,12 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(u } return aId; } -/*-- 11.12.98 15:23:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException ) { return this; } -/*-- 11.12.98 15:23:03--------------------------------------------------- - -----------------------------------------------------------------------*/ const SwStartNode *SwXTextFrame::GetStartNode() const { const SwStartNode *pSttNd = 0; @@ -2615,9 +2481,7 @@ SwXTextFrame::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } -/*-- 11.12.98 15:23:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2664,9 +2528,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( throw uno::RuntimeException(); return aRef; } -/*-- 11.12.98 15:23:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2693,9 +2555,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const throw uno::RuntimeException(); return aRef; } -/*-- 11.12.98 15:23:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2716,77 +2576,57 @@ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) } return aRef; } -/*-- 11.12.98 15:23:04--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXTextFrame::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType(static_cast*>(0)); } -/*-- 11.12.98 15:23:04--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextFrame::hasElements(void) throw( uno::RuntimeException ) { return sal_True; } -/*-- 11.12.98 15:23:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { SwXFrame::attach(xTextRange); } -/*-- 11.12.98 15:23:04--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextFrame::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); return SwXFrame::getAnchor(); } -/*-- 11.12.98 15:23:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextFrame::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwXFrame::dispose(); } -/*-- 11.12.98 15:23:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::addEventListener(aListener); } -/*-- 11.12.98 15:23:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::removeEventListener(aListener); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextFrame"); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")|| COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")|| SwXFrame::supportsService(rServiceName); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames(); @@ -2796,16 +2636,12 @@ uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( un pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.Text"); return aRet; } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void * SAL_CALL SwXTextFrame::operator new( size_t t) throw() { return SwXTextFrameBaseClass::operator new( t); } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextFrame::operator delete( void * p) throw() { SwXTextFrameBaseClass::operator delete(p); @@ -2816,9 +2652,7 @@ uno::Reference SAL_CALL SwXTextFrame::getEvents() { return new SwFrameEventDescriptor( *this ); } -/* -----------------------------10.01.01 13:27-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -2828,9 +2662,7 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& return nRet; } -/* -----------------------------19.03.2002 16:43------------------------------ - ---------------------------------------------------------------------------*/ ::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -2850,45 +2682,33 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& /****************************************************************** * SwXTextGraphicObject ******************************************************************/ -/*-- 14.01.99 11:27:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) : SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc) { } -/*-- 11.12.98 16:02:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextGraphicObject::SwXTextGraphicObject(SwFrmFmt& rFmt) : SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC)) { } -/*-- 11.12.98 16:02:26--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextGraphicObject::~SwXTextGraphicObject() { } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextGraphicObject::acquire( )throw() { SwXFrame::acquire(); } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextGraphicObject::release( )throw() { SwXFrame::release(); } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ ::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType ) throw(uno::RuntimeException) { @@ -2897,9 +2717,7 @@ void SAL_CALL SwXTextGraphicObject::release( )throw() aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType); return aRet; } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SAL_CALL SwXTextGraphicObject::getTypes( ) throw(uno::RuntimeException) { @@ -2919,9 +2737,7 @@ uno::Sequence< uno::Type > SAL_CALL return aGraphicTypes; } -/* -----------------------------15.03.00 16:30-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2934,63 +2750,47 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) } return aId; } -/*-- 11.12.98 16:02:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { SwXFrame::attach(xTextRange); } -/*-- 11.12.98 16:02:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextGraphicObject::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); return SwXFrame::getAnchor(); } -/*-- 11.12.98 16:02:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextGraphicObject::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwXFrame::dispose(); } -/*-- 11.12.98 16:02:29--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextGraphicObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::addEventListener(aListener); } -/*-- 11.12.98 16:02:29--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextGraphicObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::removeEventListener(aListener); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextGraphicObject"); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") || SwXFrame::supportsService(rServiceName); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void) throw( uno::RuntimeException ) { @@ -3000,23 +2800,17 @@ uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void) pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextGraphicObject"); return aRet; } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void * SAL_CALL SwXTextGraphicObject::operator new( size_t t) throw() { return SwXTextGraphicObjectBaseClass::operator new(t); } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextGraphicObject::operator delete( void * p) throw() { SwXTextGraphicObjectBaseClass::operator delete(p); } -/* -----------------------------15.12.00 12:45-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference SAL_CALL SwXTextGraphicObject::getEvents() throw(uno::RuntimeException) @@ -3027,48 +2821,33 @@ uno::Reference SAL_CALL /****************************************************************** * ******************************************************************/ -/*-- 11.12.98 16:16:53--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) : SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc) { } -/*-- 11.12.98 16:16:53--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrmFmt& rFmt) : SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT)) { } -/*-- 11.12.98 16:16:54--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextEmbeddedObject::~SwXTextEmbeddedObject() { } -/*-- 11.12.98 16:16:54--------------------------------------------------- - -----------------------------------------------------------------------*/ -/* -----------------------------15.03.00 16:32-------------------------------- - - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextEmbeddedObject::acquire()throw() { SwXFrame::acquire(); } -/* -----------------------------15.03.00 16:32-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextEmbeddedObject::release()throw() { SwXFrame::release(); } -/* -----------------------------15.03.00 16:32-------------------------------- - ---------------------------------------------------------------------------*/ ::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException) { @@ -3077,9 +2856,7 @@ void SAL_CALL SwXTextEmbeddedObject::release()throw() aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType); return aRet; } -/* -----------------------------15.03.00 16:32-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(uno::RuntimeException) { uno::Sequence< uno::Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass::getTypes(); @@ -3099,9 +2876,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un return aTextEmbeddedTypes; } -/* -----------------------------15.03.00 16:32-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3114,46 +2889,33 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( } return aId; } -/*-- 11.12.98 16:16:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { SwXFrame::attach(xTextRange); } -/*-- 11.12.98 16:16:54--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextEmbeddedObject::getAnchor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); return SwXFrame::getAnchor(); } -/*-- 11.12.98 16:16:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextEmbeddedObject::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); SwXFrame::dispose(); } -/*-- 11.12.98 16:16:55--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextEmbeddedObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::addEventListener(aListener); } -/*-- 11.12.98 16:16:55--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { SwXFrame::removeEventListener(aListener); } -/*-- 11.12.98 16:16:55--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( uno::RuntimeException ) { @@ -3181,9 +2943,7 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi uno::Reference< frame::XModel > xModel( xRet, uno::UNO_QUERY); if( xBrdcst.is() && xModel.is() ) { - SwClientIter aIter( *pFmt ); - SwXOLEListener* pListener = (SwXOLEListener*)aIter. - First( TYPE( SwXOLEListener )); + SwXOLEListener* pListener = SwIterator::FirstElement( *pFmt ); //create a new one if the OLE object doesn't have one already if( !pListener ) { @@ -3196,11 +2956,6 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi return xRet; } -/* --18.05.2006 16:39--------------------------------------------------- - - -----------------------------------------------------------------------*/ - - uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject() throw( uno::RuntimeException ) { @@ -3228,9 +2983,7 @@ uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExte uno::Reference< frame::XModel > xModel( xComp, uno::UNO_QUERY); if( xBrdcst.is() && xModel.is() ) { - SwClientIter aIter( *pFmt ); - SwXOLEListener* pListener = (SwXOLEListener*)aIter. - First( TYPE( SwXOLEListener )); + SwXOLEListener* pListener = SwIterator::FirstElement( *pFmt ); //create a new one if the OLE object doesn't have one already if( !pListener ) { @@ -3294,25 +3047,19 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme return uno::Reference< graphic::XGraphic >(); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextEmbeddedObject"); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")|| SwXFrame::supportsService(rServiceName); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void) throw( uno::RuntimeException ) { @@ -3322,23 +3069,17 @@ uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void) pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextEmbeddedObject"); return aRet; } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void * SAL_CALL SwXTextEmbeddedObject::operator new( size_t t) throw() { return SwXTextEmbeddedObjectBaseClass::operator new(t); } -/* -----------------------------20.06.00 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextEmbeddedObject::operator delete( void * p) throw() { SwXTextEmbeddedObjectBaseClass::operator delete(p); } -/* -----------------------------15.12.00 12:45-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference SAL_CALL SwXTextEmbeddedObject::getEvents() throw(uno::RuntimeException) @@ -3351,17 +3092,13 @@ uno::Reference SAL_CALL * ******************************************************************/ TYPEINIT1(SwXOLEListener, SwClient); -/* -----------------------------18.01.2002 09:59------------------------------ - ---------------------------------------------------------------------------*/ SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) : SwClient(&rOLEFmt), xOLEModel(xOLE) { } -/* -----------------------------18.01.2002 09:59------------------------------ - ---------------------------------------------------------------------------*/ SwXOLEListener::~SwXOLEListener() {} @@ -3424,7 +3161,7 @@ void SwXOLEListener::disposing( const lang::EventObject& rEvent ) /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) +void SwXOLEListener::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index d0d74fa023c7..c07ef6431a5a 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -99,7 +99,7 @@ public: } void Invalidate(); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -177,24 +177,6 @@ SwXFootnote::GetXFootnote( // to do this properly requires the SwXFootnote to register at the // SwFmtFtn directly, not at the unocallback // also this function must return a uno Reference! -#if 0 - SwClientIter aIter( rUnoCB ); - SwXFootnote::Impl * pXFootnote = static_cast( - aIter.First( TYPE( SwXFootnote::Impl ))); - while (pXFootnote) - { - SwDoc *const pDoc = pXFootnote->m_rThis.GetDoc(); - if (pDoc) - { - SwFmtFtn const*const pFtn = pXFootnote->GetFootnoteFormat(); - if (pFtn == &rFootnoteFmt) - { - return & pXFootnote->m_rThis; - } - } - pXFootnote = static_cast(aIter.Next()); - } -#endif return 0; } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 94ee14450f08..e5c18496c4c2 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -147,8 +147,8 @@ lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) SwTOXType aNewType(TOX_USER, rNewName); pNewType = pDoc->InsertTOXType( aNewType ); } - //has to be non-const-casted - ((SwTOXType*)pNewType)->Add(&rTOXBase); + + rTOXBase.RegisterToTOXType( *((SwTOXType*)pNewType) ); } //----------------------------------------------------------------------------- static const char cUserDefined[] = "User-Defined"; @@ -404,7 +404,7 @@ public: ? SwForm::GetFormMaxLevel(m_eTOXType) : rSection.GetTOXForm().GetFormMax(); } - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -1247,25 +1247,13 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, case WID_INDEX_MARKS: { SwTOXMarks aMarks; - SwTOXType const*const pType = pTOXBase->GetTOXType(); - SwClientIter aIter(*pType); - SwTOXMark * pMark = - static_cast(aIter.First(TYPE(SwTOXMark))); - while( pMark ) - { - if(pMark->GetTxtTOXMark()) - { - aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count()); - } - pMark = static_cast(aIter.Next()); - } - uno::Sequence< uno::Reference > - aXMarks(aMarks.Count()); - uno::Reference* pxMarks = - aXMarks.getArray(); + const SwTOXType* pType = pTOXBase->GetTOXType(); + SwTOXMark::InsertTOXMarks( aMarks, *pType ); + uno::Sequence< uno::Reference > aXMarks(aMarks.Count()); + uno::Reference* pxMarks = aXMarks.getArray(); for(USHORT i = 0; i < aMarks.Count(); i++) { - pMark = aMarks.GetObject(i); + SwTOXMark* pMark = aMarks.GetObject(i); pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark( *m_pImpl->m_pDoc, *const_cast(pType), *pMark); @@ -1666,7 +1654,7 @@ public: } void Invalidate(); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); }; diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index f572b5f3e91c..2c11908044a3 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -397,7 +397,7 @@ SwUnoCursorHelper::SetPageDesc( { throw lang::IllegalArgumentException(); } - pPageDesc->Add( pNewDesc.get() ); + pNewDesc.get()->RegisterToPageDesc( *pPageDesc ); bPut = sal_True; } if(!bPut) @@ -828,7 +828,7 @@ public: m_bIsDisposed = true; m_ListenerContainer.Disposing(); } - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 355857385903..fc9a3df689f6 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -116,16 +116,13 @@ #include #include #include -// OD 2004-05-07 #i28701# #include -// OD 2004-05-24 #i28701# #include #include - #include #include #include - +#include using namespace ::com::sun::star; using ::rtl::OUString; @@ -279,9 +276,6 @@ UnoActionContext::UnoActionContext(SwDoc *const pDoc) } } -/*-----------------04.03.98 11:56------------------- - ---------------------------------------------------*/ UnoActionContext::~UnoActionContext() { // Doc may already have been removed here @@ -321,10 +315,7 @@ UnoActionRemoveContext::~UnoActionRemoveContext() } -/*-- 10.12.98 11:52:15--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew) +void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew) { switch( pOld ? pOld->Which() : 0 ) { @@ -344,9 +335,6 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew) } -/*-- 09.12.98 14:19:03--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, const SfxItemSet& rSet, const SetAttrMode nAttrMode, const bool bTableMode) @@ -390,9 +378,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, } //<-end,zhaojianwei } -/*-- 09.12.98 14:19:04--------------------------------------------------- - -----------------------------------------------------------------------*/ // --> OD 2006-07-12 #i63870# // split third parameter into new parameters // and to get better control about resulting @@ -534,7 +520,7 @@ public: uno::Reference< text::XTextContent > NextElement_Impl() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -545,9 +531,6 @@ void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) ClientModify(this, pOld, pNew); } -/*-- 10.12.98 11:52:12--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXParagraphEnumeration::SwXParagraphEnumeration( uno::Reference< text::XText > const& xParent, ::std::auto_ptr pCursor, @@ -557,24 +540,17 @@ SwXParagraphEnumeration::SwXParagraphEnumeration( pStartNode, pTable) ) { } -/*-- 10.12.98 11:52:12--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXParagraphEnumeration::~SwXParagraphEnumeration() { } -/* -----------------------------06.04.00 16:33-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SAL_CALL SwXParagraphEnumeration::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXParagraphEnumeration"); } -/* -----------------------------06.04.00 16:33-------------------------------- - ---------------------------------------------------------------------------*/ static char const*const g_ServicesParagraphEnum[] = { "com.sun.star.text.ParagraphEnumeration", @@ -589,9 +565,7 @@ throw (uno::RuntimeException) return ::sw::SupportsServiceImpl( g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName); } -/* -----------------------------06.04.00 16:33-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SAL_CALL SwXParagraphEnumeration::getSupportedServiceNames() throw (uno::RuntimeException) @@ -600,9 +574,6 @@ throw (uno::RuntimeException) g_nServicesParagraphEnum, g_ServicesParagraphEnum); } -/*-- 10.12.98 11:52:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SAL_CALL SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException) { @@ -610,9 +581,6 @@ SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException) return (m_pImpl->m_bFirstParagraph) ? sal_True : m_pImpl->m_xNextPara.is(); } -/*-- 14.08.03 13:10:14--------------------------------------------------- - - -----------------------------------------------------------------------*/ //!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx static SwTableNode * @@ -753,9 +721,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException, return xRef; } -/*-- 10.12.98 11:52:14--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SAL_CALL SwXParagraphEnumeration::nextElement() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) @@ -825,7 +791,7 @@ public: } const ::sw::mark::IMark * GetBookmark() const { return m_pMark; } - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -1267,8 +1233,7 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) SwFrmFmt *const pFmt = pSttNode->GetFlyFmt(); if (0 != pFmt) { - SwXTextFrame* pFrame( static_cast( - SwClientIter( *pFmt ).First( TYPE( SwXTextFrame ) ) ) ); + SwXTextFrame* pFrame = SwIterator::FirstElement( *pFmt ); xParentText = pFrame ? pFrame : new SwXTextFrame( *pFmt ); } } @@ -1624,23 +1589,17 @@ public: } void MakeRanges(); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); }; -/*-- 10.12.98 13:57:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -/* -----------------10.12.98 14:25------------------- - * - * --------------------------------------------------*/ void SwXTextRanges::Impl::MakeRanges() { SwUnoCrsr *const pCursor = GetCursor(); @@ -1667,32 +1626,21 @@ const SwUnoCrsr* SwXTextRanges::GetCursor() const return m_pImpl->GetCursor(); } -/*-- 10.12.98 13:57:22--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextRanges::SwXTextRanges(SwPaM *const pPaM) : m_pImpl( new SwXTextRanges::Impl(pPaM) ) { } -/*-- 10.12.98 13:57:22--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextRanges::~SwXTextRanges() { } -/* -----------------------------13.03.00 12:15-------------------------------- - - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXTextRanges::getSomething(const uno::Sequence< sal_Int8 >& rId) throw (uno::RuntimeException) @@ -1706,17 +1654,12 @@ throw (uno::RuntimeException) * danach wird ein Array mit uno::Reference< XTextPosition > angelegt * ****************************************************************************/ -/* -----------------------------06.04.00 16:36-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SAL_CALL SwXTextRanges::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXTextRanges"); } -/* -----------------------------06.04.00 16:36-------------------------------- - ---------------------------------------------------------------------------*/ static char const*const g_ServicesTextRanges[] = { "com.sun.star.text.TextRanges", @@ -1731,9 +1674,6 @@ throw (uno::RuntimeException) g_nServicesTextRanges, g_ServicesTextRanges, rServiceName); } -/* -----------------------------06.04.00 16:36-------------------------------- - - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SAL_CALL SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException) { @@ -1741,18 +1681,13 @@ SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException) g_nServicesTextRanges, g_ServicesTextRanges); } -/*-- 10.12.98 13:57:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Int32 SAL_CALL SwXTextRanges::getCount() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); return static_cast(m_pImpl->m_Ranges.size()); } -/*-- 10.12.98 13:57:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SAL_CALL SwXTextRanges::getByIndex(sal_Int32 nIndex) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) @@ -1769,26 +1704,18 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, return ret; } -/*-- 10.12.98 13:57:25--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXTextRanges::getElementType() throw (uno::RuntimeException) { return text::XTextRange::static_type(); } -/*-- 10.12.98 13:57:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException) { // no mutex necessary: getCount() does locking return getCount() > 0; } -/* -----------------11.12.98 10:07------------------- - * - * --------------------------------------------------*/ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString) { // Start/EndAction @@ -1845,16 +1772,12 @@ public: return static_cast( const_cast(GetRegisteredIn())); } - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); }; -/*-- 23.03.99 13:22:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ - struct InvalidFrameDepend { bool operator() (::boost::shared_ptr const & rEntry) { return !rEntry->GetRegisteredIn(); } @@ -1878,9 +1801,6 @@ void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) } } -/* -----------------23.03.99 13:38------------------- - * - * --------------------------------------------------*/ static sal_Bool lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, uno::Reference & o_rNextObject, @@ -1895,9 +1815,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, // the format should be valid here, otherwise the client // would have been removed in ::Modify // check for a shape first - SwClientIter aIter(*pFormat); - SwDrawContact * const pContact = - static_cast( aIter.First(TYPE(SwDrawContact)) ); + SwDrawContact* const pContact = SwIterator::FirstElement( *pFormat ); if (pContact) { SdrObject * const pSdr = pContact->GetMaster(); @@ -1945,9 +1863,6 @@ lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr, } } -/*-- 23.03.99 13:22:29--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXParaFrameEnumeration::SwXParaFrameEnumeration( const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, SwFrmFmt *const pFmt) @@ -2005,16 +1920,11 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration( lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames); } } -/*-- 23.03.99 13:22:30--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXParaFrameEnumeration::~SwXParaFrameEnumeration() { } -/*-- 23.03.99 13:22:32--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SAL_CALL SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException) { @@ -2028,9 +1938,7 @@ SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException) : lcl_CreateNextObject(*m_pImpl->GetCursor(), m_pImpl->m_xNextObject, m_pImpl->m_Frames); } -/*-- 23.03.99 13:22:33--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) @@ -2057,18 +1965,12 @@ throw (container::NoSuchElementException, return aRet; } -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SAL_CALL SwXParaFrameEnumeration::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXParaFrameEnumeration"); } -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ static char const*const g_ServicesParaFrameEnum[] = { "com.sun.star.util.ContentEnumeration", @@ -2084,9 +1986,6 @@ throw (uno::RuntimeException) g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName); } -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SAL_CALL SwXParaFrameEnumeration::getSupportedServiceNames() throw (uno::RuntimeException) diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 3b865d49bf09..8482dab122d3 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -151,7 +151,7 @@ public: return static_cast(GetRegisteredIn()); } SwTxtNode * GetTxtNode() { - return static_cast(pRegisteredIn); + return static_cast(GetRegisteredInNonConst()); } SwTxtNode & GetTxtNodeOrThrow() { @@ -183,7 +183,7 @@ public: const uno::Sequence< ::rtl::OUString >& rPropertyNames, bool bDirectValuesOnly) throw (uno::RuntimeException); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 5b0eca4a40fa..13014c512940 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -63,7 +63,7 @@ using ::rtl::OUString; * SwXTextPortion ******************************************************************/ -static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor) +void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor) { SwUnoCrsr* pUnoCursor = pPortionCursor->GetDoc()->CreateUnoCrsr(*pPortionCursor->GetPoint()); @@ -72,7 +72,7 @@ static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor) pUnoCursor->SetMark(); *pUnoCursor->GetMark() = *pPortionCursor->GetMark(); } - pUnoCursor->Add(& rPortion); + pUnoCursor->Add(this); } /*-- 11.12.98 09:56:55--------------------------------------------------- @@ -97,7 +97,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, , m_ePortionType(eType) , m_bIsCollapsed(false) { - init(*this, pPortionCrsr); + init( pPortionCrsr); } /* -----------------24.03.99 16:30------------------- @@ -119,7 +119,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, , m_ePortionType(PORTION_FRAME) , m_bIsCollapsed(false) { - init(*this, pPortionCrsr); + init( pPortionCrsr); } /* -----------------------------19.02.01 10:52-------------------------------- @@ -142,7 +142,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr, , m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START ) , m_bIsCollapsed(false) { - init(*this, pPortionCrsr); + init( pPortionCrsr); if (!bIsEnd) { @@ -1061,7 +1061,7 @@ throw( uno::RuntimeException ) /*-- 11.12.98 09:57:01--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextPortion::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextPortion::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if (!m_FrameDepend.GetRegisteredIn()) diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index bb184fd9b879..0c633d3b8f0f 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -755,7 +755,7 @@ lcl_ExportHints( xRef = pPortion = new SwXTextPortion( pUnoCrsr, xParent, PORTION_FIELD); Reference xField = - CreateSwXTextField(*pDoc, pAttr->GetFld()); + SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld()); pPortion->SetTextField(xField); } break; @@ -1219,7 +1219,7 @@ lcl_CreatePortions( /*-- 27.01.99 10:44:45--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextPortionEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextPortionEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 7f5efadada39..060d280eddc9 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -57,24 +57,18 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwXRedlineText::SwXRedlineText(SwDoc* _pDoc, SwNodeIndex aIndex) : SwXText(_pDoc, CURSOR_REDLINE), aNodeIndex(aIndex) { } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ const SwStartNode* SwXRedlineText::GetStartNode() const { return aNodeIndex.GetNode().GetStartNode(); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXRedlineText::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) { @@ -97,9 +91,7 @@ uno::Any SwXRedlineText::queryInterface( const uno::Type& rType ) return aRet; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence SwXRedlineText::getTypes() throw(uno::RuntimeException) { @@ -113,9 +105,7 @@ uno::Sequence SwXRedlineText::getTypes() return aTypes; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence SwXRedlineText::getImplementationId() throw(uno::RuntimeException) { @@ -129,9 +119,7 @@ uno::Sequence SwXRedlineText::getImplementationId() } return aId; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference SwXRedlineText::createTextCursor(void) throw( uno::RuntimeException ) { @@ -174,9 +162,7 @@ uno::Reference SwXRedlineText::createTextCursor(void) return static_cast(pXCursor); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference SwXRedlineText::createTextCursorByRange( const uno::Reference & aTextRange) throw( uno::RuntimeException ) @@ -186,9 +172,7 @@ uno::Reference SwXRedlineText::createTextCursorByRange( xCursor->gotoRange(aTextRange->getEnd(), sal_True); return xCursor; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference SwXRedlineText::createEnumeration(void) throw( uno::RuntimeException ) { @@ -199,23 +183,17 @@ uno::Reference SwXRedlineText::createEnumeration(void) GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False)); return new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Type SwXRedlineText::getElementType( ) throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException) { return sal_True; // we always have a content index } -/* -----------------------------19.12.00 11:36-------------------------------- - ---------------------------------------------------------------------------*/ SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed, const SwUnoCrsr* pPortionCrsr, uno::Reference< text::XText > xParent, BOOL bStart) : @@ -226,15 +204,11 @@ SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed, { SetCollapsed(!pRedline->HasMark()); } -/*-- 19.12.00 11:37:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXRedlinePortion::~SwXRedlinePortion() { } -/* -----------------------------19.12.00 11:46-------------------------------- - ---------------------------------------------------------------------------*/ static util::DateTime lcl_DateTimeToUno(const DateTime& rDT) { util::DateTime aRetDT; @@ -317,9 +291,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName ) } return aRet; } -/* -----------------------------19.12.00 15:16-------------------------------- - ---------------------------------------------------------------------------*/ void SwXRedlinePortion::Validate() throw( uno::RuntimeException ) { SwUnoCrsr* pUnoCrsr = GetCursor(); @@ -334,9 +306,7 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException ) if(!bFound) throw uno::RuntimeException(); } -/* -----------------------------21.03.00 15:39-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -349,9 +319,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th } return aId; } -/* -----------------------------11.01.01 16:39-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw() { uno::Any aRet; @@ -391,9 +359,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co } return aRet; } -/* -----------------------------11.01.01 11:22-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties( const SwRedline& rRedline, sal_Bool bIsStart ) throw() { @@ -447,9 +413,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties aRet.realloc(nPropIdx); return aRet; } -/*-- 11.01.01 17:06:07--------------------------------------------------- - -----------------------------------------------------------------------*/ TYPEINIT1(SwXRedline, SwClient); SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) : SwXText(&rDoc, CURSOR_REDLINE), @@ -458,24 +422,18 @@ SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) : { pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); } -/*-- 11.01.01 17:06:08--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXRedline::~SwXRedline() { } -/*-- 11.01.01 17:06:08--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(uno::RuntimeException) { static uno::Reference< beans::XPropertySetInfo > xRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_REDLINE)->getPropertySetInfo(); return xRef; } -/*-- 11.01.01 17:06:08--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) @@ -545,9 +503,7 @@ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any throw lang::IllegalArgumentException(); } } -/*-- 11.01.01 17:06:08--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { @@ -617,43 +573,33 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName ) aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline); return aRet; } -/*-- 11.01.01 17:06:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXRedline::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 11.01.01 17:06:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXRedline::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 11.01.01 17:06:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXRedline::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 11.01.01 17:06:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXRedline::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 11.01.01 17:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXRedline::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -662,9 +608,7 @@ void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) pRedline = 0; } } -/*-- 19.12.00 11:37:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -683,25 +627,19 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) t } return xRet; } -/* -----------------------------19.12.00 12:34-------------------------------- - ---------------------------------------------------------------------------*/ uno::Type SwXRedline::getElementType( ) throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/* -----------------------------19.12.00 12:34-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXRedline::hasElements( ) throw(uno::RuntimeException) { if(!pDoc) throw uno::RuntimeException(); return 0 != pRedline->GetContentIdx(); } -/* -----------------------------19.12.00 15:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -737,18 +675,14 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u } return xRet; } -/* -----------------------------19.12.00 15:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXRedline::createTextCursorByRange( const uno::Reference< text::XTextRange > & /*aTextPosition*/) throw( uno::RuntimeException ) { throw uno::RuntimeException(); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SwXRedline::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) { @@ -759,9 +693,7 @@ uno::Any SwXRedline::queryInterface( const uno::Type& rType ) } return aRet; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence SwXRedline::getTypes() throw(uno::RuntimeException) { @@ -775,9 +707,7 @@ uno::Sequence SwXRedline::getTypes() pTypes[nCurType++] = pBaseTypes[nType]; return aTypes; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence SwXRedline::getImplementationId() throw(uno::RuntimeException) { diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index 91fbcfa0f5f7..2cb95a75835d 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -42,27 +42,20 @@ #include #include #include - +#include using namespace ::com::sun::star; using ::rtl::OUString; -/*-- 11.01.01 15:28:54--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXRedlines::SwXRedlines(SwDoc* _pDoc) : SwUnoCollection(_pDoc) { } -/*-- 11.01.01 15:28:55--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXRedlines::~SwXRedlines() { } -/*-- 11.01.01 15:28:55--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -71,9 +64,7 @@ sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException) const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl(); return rRedTbl.Count(); } -/*-- 11.01.01 15:28:55--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -91,9 +82,7 @@ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex) throw lang::IndexOutOfBoundsException(); return aRet; } -/*-- 11.01.01 15:28:55--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void) throw( uno::RuntimeException ) { @@ -102,16 +91,12 @@ uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void) throw uno::RuntimeException(); return uno::Reference< container::XEnumeration >(new SwXRedlineEnumeration(*GetDoc())); } -/*-- 11.01.01 15:28:55--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXRedlines::getElementType( ) throw(uno::RuntimeException) { return ::getCppuType((uno::Reference*)0); } -/*-- 11.01.01 15:28:56--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -120,76 +105,60 @@ sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException) const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl(); return rRedTbl.Count() > 0; } -/*-- 11.01.01 15:28:56--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXRedlines"); } -/*-- 11.01.01 15:28:56--------------------------------------------------- - -----------------------------------------------------------------------*/ BOOL SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException ) { DBG_ERROR("not implemented"); return FALSE; } -/*-- 11.01.01 15:28:57--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void) throw( uno::RuntimeException ) { DBG_ERROR("not implemented"); return uno::Sequence< OUString >(); } -/*-- 11.01.01 15:28:57--------------------------------------------------- - -----------------------------------------------------------------------*/ beans::XPropertySet* SwXRedlines::GetObject( SwRedline& rRedline, SwDoc& rDoc ) { SwPageDesc* pStdDesc = rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD); - SwClientIter aIter(*pStdDesc); - SwXRedline* pxRedline = (SwXRedline*)aIter.First( TYPE( SwXRedline )); + SwIterator aIter(*pStdDesc); + SwXRedline* pxRedline = aIter.First(); while(pxRedline) { if(pxRedline->GetRedline() == &rRedline) break; - pxRedline = (SwXRedline*)aIter.Next(); + pxRedline = aIter.Next(); } if( !pxRedline ) pxRedline = new SwXRedline(rRedline, rDoc); return pxRedline; } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXRedlineEnumeration::SwXRedlineEnumeration(SwDoc& rDoc) : pDoc(&rDoc), nCurrentIndex(0) { pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXRedlineEnumeration::~SwXRedlineEnumeration() { } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ BOOL SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException ) { if(!pDoc) throw uno::RuntimeException(); return pDoc->GetRedlineTbl().Count() > nCurrentIndex; } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXRedlineEnumeration::nextElement(void) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -203,31 +172,23 @@ uno::Any SwXRedlineEnumeration::nextElement(void) aRet <<= xRet; return aRet; } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXRedlineEnumeration"); } -/*-- 12.01.01 15:06:10--------------------------------------------------- - -----------------------------------------------------------------------*/ BOOL SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException ) { return FALSE; } -/*-- 12.01.01 15:06:11--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException ) { return uno::Sequence< OUString >(); } -/*-- 12.01.01 15:06:11--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXRedlineEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXRedlineEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 25ce3ec6c441..ecc0c590d82f 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -82,9 +82,9 @@ public: bool IsValid() const { return 0 != GetRegisteredIn(); } void InsertRefMark( SwPaM & rPam, SwXTextCursor const*const pCursor ); void Invalidate(); - +protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; @@ -105,7 +105,7 @@ void SwXReferenceMark::Impl::Invalidate() /*-- 11.12.98 10:28:37--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXReferenceMark::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); @@ -119,7 +119,7 @@ void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { case RES_REFMARK_DELETED: if (static_cast(m_pMarkFmt) == - static_cast(pOld)->pObject) + static_cast(pOld)->pObject) { Invalidate(); } @@ -152,20 +152,6 @@ SwXReferenceMark::GetReferenceMark( // #i105557#: do not iterate over the registered clients: race condition // to do this properly requires the SwXReferenceMark to register at the // SwFmtRefMark directly, not at the unocallback -#if 0 - SwClientIter aIter( rUnoCB ); - SwXReferenceMark::Impl * pXMark = - static_cast( - aIter.First( TYPE( SwXReferenceMark::Impl ) )); - while (pXMark) - { - if (pXMark->m_pMarkFmt == &rMarkFmt) - { - return &pXMark->m_rThis; - } - pXMark = static_cast(aIter.Next()); - } -#endif return 0; } @@ -773,9 +759,9 @@ public: inline const ::sw::Meta * GetMeta() const; // only for SwXMetaField! inline const ::sw::MetaField * GetMetaField() const; - +protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); }; @@ -785,7 +771,7 @@ inline const ::sw::Meta * SwXMeta::Impl::GetMeta() const } // SwModify -void SwXMeta::Impl::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwXMeta::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { m_pTextPortions.reset(); // throw away cache (SwTxtNode changed) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 2810b500ea4b..e4db4226619d 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -168,7 +168,7 @@ public: const uno::Sequence< ::rtl::OUString >& rPropertyNames) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index ab486b71ed04..25f40e4900e5 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1087,7 +1087,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName) String aString; // return empty string if no char format is set // otherwise it would be created here - if(rInfo.GetRegisteredIn()) + if(rInfo.HasCharFormat()) { SwStyleNameMapper::FillProgName( rInfo.GetCharFmt(*pDoc)->GetName(), @@ -2445,7 +2445,7 @@ void SwXNumberingRules::setName(const OUString& /*rName*/) throw( RuntimeExcepti /*-- 14.12.98 14:58:00--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXNumberingRules::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXNumberingRules::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 4309622c9545..209ad21f03de 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1477,7 +1477,7 @@ SwXStyle::~SwXStyle() /*-- 17.12.98 08:26:51--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -2005,7 +2005,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName); if(pPageDesc) { - pPageDesc->Add( pNewDesc ); + pNewDesc->RegisterToPageDesc( *pPageDesc ); bPut = sal_True; } else @@ -3891,7 +3891,7 @@ SwXAutoStyleFamily::~SwXAutoStyleFamily() { } -void SwXAutoStyleFamily::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXAutoStyleFamily::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -4036,7 +4036,7 @@ SwXAutoStylesEnumerator::~SwXAutoStylesEnumerator() delete pImpl; } -void SwXAutoStylesEnumerator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXAutoStylesEnumerator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) @@ -4092,7 +4092,7 @@ SwXAutoStyle::~SwXAutoStyle() { } -void SwXAutoStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXAutoStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index fdc382ad99d9..89ff738e4b81 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -100,7 +100,7 @@ #include #include #include - +#include using namespace ::com::sun::star; using ::rtl::OUString; @@ -112,9 +112,6 @@ extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ); #define UNO_TABLE_COLUMN_SUM 10000 -/* -----------------17.07.98 15:47------------------- - * - * --------------------------------------------------*/ table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine) { table::BorderLine aLine; @@ -129,9 +126,7 @@ table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine) aLine.Color = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance = 0; return aLine; } -/* -----------------17.07.98 15:52------------------- - * - * --------------------------------------------------*/ + sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine) { rSvxLine.SetColor( Color(rLine.Color)); @@ -141,9 +136,7 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0; return bRet; } -/* -----------------11.12.98 14:22------------------- - * - * --------------------------------------------------*/ + void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue) throw (lang::IllegalArgumentException) { @@ -225,9 +218,6 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE } } -/* -----------------27.04.98 08:50------------------- - * - * --------------------------------------------------*/ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry ) { uno::Any aRet; @@ -325,10 +315,6 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry } return aRet; } -/* -----------------19.10.05 08:32------------------- - * - * --------------------------------------------------*/ - // returns the position for the cell with the specified name // (note that the indices rColumn and rRow are 0 based here) @@ -464,10 +450,6 @@ int lcl_CompareCellRanges( } -/* -----------------25.06.98 08:32------------------- - * - * --------------------------------------------------*/ - // returns the cell name for the cell at the specified position // (note that the indices nColumn and nRow are 0 based here) String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow ) @@ -529,9 +511,6 @@ const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const return pBox; } -/* -----------------21.11.05 14:46------------------- - - --------------------------------------------------*/ // start cell should be in the upper-left corner of the range and // end cell in the lower-right. // I.e. from the four possible representation @@ -569,9 +548,6 @@ void SwRangeDescriptor::Normalize() } -/* -----------------25.06.98 08:32------------------- - * - * --------------------------------------------------*/ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow) { SwXCell* pXCell = 0; @@ -584,9 +560,7 @@ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow) } return pXCell; } -/* -----------------20.07.98 12:35------------------- - * - * --------------------------------------------------*/ + void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames) { for( sal_uInt16 i = 0; i < rLines.Count(); i++ ) @@ -606,27 +580,23 @@ void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames) } } } -/* -----------------02.10.98 15:55------------------- - * - * --------------------------------------------------*/ + void lcl_FormatTable(SwFrmFmt* pTblFmt) { - SwClientIter aIter( *pTblFmt ); - for( SwClient* pC = aIter.First( TYPE( SwFrm )); - pC; pC = aIter.Next() ) + SwIterator aIter( *pTblFmt ); + for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { - if( ((SwFrm*)pC)->IsTabFrm() ) + // mba: no TYPEINFO for SwTabFrm + if( pFrm->IsTabFrm() ) { - if(((SwFrm*)pC)->IsValid()) - ((SwFrm*)pC)->InvalidatePos(); - ((SwTabFrm*)pC)->SetONECalcLowers(); - ((SwTabFrm*)pC)->Calc(); + if(pFrm->IsValid()) + pFrm->InvalidatePos(); + ((SwTabFrm*)pFrm)->SetONECalcLowers(); + ((SwTabFrm*)pFrm)->Calc(); } } } -/* -----------------20.07.98 13:15------------------- - * - * --------------------------------------------------*/ + void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand) { if(bExpand) @@ -638,9 +608,7 @@ void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand) pCrsr->DeleteMark(); } -/* -----------------17.07.98 14:36------------------- - * - * --------------------------------------------------*/ + void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow) { SwTabCols aCols; @@ -669,9 +637,7 @@ void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal rRet.setValue(&aColSeq, ::getCppuType((uno::Sequence< text::TableColumnSeparator>*)0)); } -/* -----------------17.07.98 14:36------------------- - * - * --------------------------------------------------*/ + void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow, SwDoc* pDoc) { SwTabCols aOldCols; @@ -715,17 +681,13 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo } } } -/* -----------------30.04.02 08:00------------------- - * - * --------------------------------------------------*/ + inline rtl::OUString lcl_getString( SwXCell &rCell ) { // getString is a member function of the base class... return rCell.getString(); } -/* -----------------30.04.02 08:00------------------- - * non UNO function call to set string in SwXCell - * --------------------------------------------------*/ +/* non UNO function call to set string in SwXCell */ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt, BOOL bKeepNumberFmt ) { @@ -741,9 +703,7 @@ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt, } rCell.SwXText::setString(rTxt); } -/* -----------------30.04.02 08:00------------------- - * non UNO function call to get value from SwXCell - * --------------------------------------------------*/ +/* non UNO function call to get value from SwXCell */ double lcl_getValue( SwXCell &rCell ) { double fRet; @@ -753,9 +713,7 @@ double lcl_getValue( SwXCell &rCell ) ::rtl::math::setNan( &fRet ); return fRet; } -/* -----------------30.04.02 08:00------------------- - * non UNO function call to set value in SwXCell - * --------------------------------------------------*/ +/* non UNO function call to set value in SwXCell */ void lcl_setValue( SwXCell &rCell, double nVal ) { if(rCell.IsValid()) @@ -793,9 +751,7 @@ void lcl_setValue( SwXCell &rCell, double nVal ) * SwXCell ******************************************************************/ TYPEINIT1(SwXCell, SwClient); -/*-- 11.12.98 10:56:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) : SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT), SwClient(pTblFmt), @@ -805,9 +761,7 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) : nFndPos(nPos) { } -/* -----------------------------09.08.00 15:59-------------------------------- - ---------------------------------------------------------------------------*/ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) : SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT), SwClient(pTblFmt), @@ -818,24 +772,17 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) : { } -/*-- 11.12.98 10:56:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXCell::~SwXCell() { } -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -848,9 +795,7 @@ sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId ) else return SwXText::getSomething(rId); } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeException) { static uno::Sequence< uno::Type > aRetTypes; @@ -872,9 +817,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce } return aRetTypes; } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -887,23 +830,17 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::R } return aId; } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXCell::acquire( ) throw() { SwXCellBaseClass::acquire(); } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXCell::release( ) throw() { SwXCellBaseClass::release(); } -/* -----------------------------18.05.00 10:23-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType ) throw (uno::RuntimeException) { @@ -912,9 +849,7 @@ uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType ) aRet = SwXText::queryInterface(aType); return aRet; } -/*-- 11.12.98 10:56:24--------------------------------------------------- - -----------------------------------------------------------------------*/ const SwStartNode *SwXCell::GetStartNode() const { const SwStartNode *pSttNd = 0; @@ -930,9 +865,7 @@ SwXCell::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } -/*-- 11.12.98 10:56:24--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwXCell::IsValid() const { // FIXME: this is now a const method, to make SwXText::IsValid invisible @@ -954,9 +887,7 @@ bool SwXCell::IsValid() const } return 0 != pBox; } -/*-- 11.12.98 10:56:25--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXCell::getFormula(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -970,9 +901,7 @@ OUString SwXCell::getFormula(void) throw( uno::RuntimeException ) } return sRet; } -/*-- 11.12.98 10:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1003,9 +932,7 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException pMyDoc->UpdateTblFlds( &aTblUpdate ); } } -/*-- 11.12.98 10:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ double SwXCell::getValue(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1014,17 +941,13 @@ double SwXCell::getValue(void) throw( uno::RuntimeException ) // #i112652# a table cell may contain NaN as a value, do not filter that return fRet; } -/*-- 11.12.98 10:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::setValue(double rValue) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); lcl_setValue( *this, rValue ); } -/*-- 11.12.98 10:56:26--------------------------------------------------- - -----------------------------------------------------------------------*/ table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1042,27 +965,21 @@ table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException ) } return nRes; } -/* -----------------27.04.99 12:06------------------- - * - * --------------------------------------------------*/ + void SwXCell::setString(const OUString& aString) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); lcl_setString( *this, aString ); } -/*-- 11.12.98 10:56:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); OUString sContent = getString(); return sContent.equals(ViewShell::GetShellRes()->aCalc_Error); } -/*-- 11.12.98 10:56:28--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1086,9 +1003,7 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno: throw uno::RuntimeException(); return aRef; } -/*-- 11.12.98 10:56:28--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno::Reference< text::XTextRange > & xTextPosition) throw( uno::RuntimeException ) { @@ -1115,17 +1030,13 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno: throw uno::RuntimeException(); return aRef; } -/*-- 11.12.98 10:56:33--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXCell::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 11.12.98 10:56:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -1155,9 +1066,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV } } } -/*-- 11.12.98 10:56:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -1213,37 +1122,27 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName) } return aRet; } -/*-- 11.12.98 10:56:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 10:56:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 10:56:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 10:56:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 10:56:37--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1272,31 +1171,23 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro } return aRef; } -/*-- 11.12.98 10:56:38--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXCell::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((const uno::Reference*)0); } -/*-- 11.12.98 10:56:38--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXCell::hasElements(void) throw( uno::RuntimeException ) { return sal_True; } -/*-- 11.12.98 10:56:37--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXCell::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXCell::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -/* -----------------12.06.98 07:54------------------- - * - * --------------------------------------------------*/ + SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTable ) { SwXCell* pRet = 0; @@ -1311,15 +1202,14 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab //wenn es die Box gibt, dann wird auch eine Zelle zurueckgegeben if(pFoundBox) { - SwClientIter aIter( *pTblFmt ); - SwXCell* pXCell = (SwXCell*)aIter. - First( TYPE( SwXCell )); + SwIterator aIter( *pTblFmt ); + SwXCell* pXCell = aIter.First(); while( pXCell ) { // gibt es eine passende Zelle bereits? if(pXCell->GetTblBox() == pBox) break; - pXCell = (SwXCell*)aIter.Next(); + pXCell = aIter.Next(); } //sonst anlegen if(!pXCell) @@ -1329,9 +1219,7 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab } return pRet; } -/* -----------------12.06.98 07:37------------------- - * exitstiert die Box in der angegebenen Tabelle? - * --------------------------------------------------*/ +/* does box exist in given table? */ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2) { // check if nFndPos happens to point to the right table box @@ -1347,24 +1235,18 @@ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2) nFndPos = USHRT_MAX; return 0; } -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXCell"); } -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { String sServiceName(rServiceName); return sServiceName.EqualsAscii("com.sun.star.text.CellProperties"); } -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -1376,23 +1258,17 @@ uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::Ru /****************************************************************** * SwXTextTableRow ******************************************************************/ -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextTableRow"); } -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.TextTableRow") == rServiceName; } -/* -----------------------------19.04.00 15:20-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -1401,9 +1277,7 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw( return aRet; } TYPEINIT1(SwXTextTableRow, SwClient); -/*-- 11.12.98 12:04:44--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) : SwClient(pFmt), m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)), @@ -1411,24 +1285,18 @@ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) : { } -/*-- 11.12.98 12:04:45--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTableRow::~SwXTextTableRow() { } -/*-- 11.12.98 12:04:46--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTableRow::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 11.12.98 12:04:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) @@ -1489,9 +1357,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, } } } -/*-- 11.12.98 12:04:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1538,44 +1404,32 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( } return aRet; } -/*-- 11.12.98 12:04:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:04:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:04:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:04:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:04:49--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextTableRow::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -/*-- 11.12.98 12:04:50--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine) { SwTableLine* pRet = 0; @@ -1592,16 +1446,12 @@ SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine) /****************************************************************** * SwXTextTableCursor ******************************************************************/ -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextTableCursor"); } -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.TextTableCursor") == rServiceName; @@ -1614,9 +1464,7 @@ const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrmFmt()->Ge SwDoc* SwXTextTableCursor::GetDoc() { return GetFrmFmt()->GetDoc(); } const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -1625,9 +1473,6 @@ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) thr return aRet; } -/*-- 11.12.98 12:16:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) : SwClient(pFmt), aCrsrDepend(this, 0), @@ -1642,9 +1487,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) : SwUnoTableCrsr* pTblCrsr = dynamic_cast(pUnoCrsr); pTblCrsr->MakeBoxSels(); } -/*-- 11.12.98 12:16:14--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* pTableSelection) : SwClient(&rTableFmt), aCrsrDepend(this, 0), @@ -1665,9 +1508,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* SwUnoTableCrsr* pTblCrsr = dynamic_cast(pUnoCrsr); pTblCrsr->MakeBoxSels(); } -/*-- 11.12.98 12:16:14--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTableCursor::~SwXTextTableCursor() { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1675,9 +1516,7 @@ SwXTextTableCursor::~SwXTextTableCursor() if(pUnoCrsr) delete pUnoCrsr; } -/*-- 11.12.98 12:16:15--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1717,9 +1556,7 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException ) } return aRet; } -/*-- 11.12.98 12:16:15--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool Expand) throw( uno::RuntimeException ) { @@ -1735,9 +1572,7 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool E } return bRet; } -/*-- 11.12.98 12:16:15--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1751,9 +1586,7 @@ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno } return bRet; } -/*-- 11.12.98 12:16:15--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1767,9 +1600,7 @@ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( un } return bRet; } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1783,9 +1614,7 @@ sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno:: } return bRet; } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1799,9 +1628,7 @@ sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno } return bRet; } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1813,9 +1640,7 @@ void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException pTblCrsr->MoveTable(fnTableCurr, fnTableStart); } } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1827,9 +1652,7 @@ void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException ) pTblCrsr->MoveTable(fnTableCurr, fnTableEnd); } } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1858,9 +1681,7 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException ) } return bRet; } -/*-- 11.12.98 12:16:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -1884,17 +1705,13 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) th } return bRet; } -/*-- 11.12.98 12:16:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 11.12.98 12:16:17--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, @@ -1960,9 +1777,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); } } -/*-- 11.12.98 12:16:17--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -2022,38 +1837,28 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) } return aRet; } -/*-- 11.12.98 12:16:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:16:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:16:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:16:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:16:19--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextTableCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextTableCursor::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } @@ -2077,36 +1882,25 @@ public: void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc); }; -/* -----------------22.06.98 09:43------------------- - * - * --------------------------------------------------*/ + SwTableProperties_Impl::SwTableProperties_Impl() { } -/* -----------------22.06.98 09:51------------------- - * - * --------------------------------------------------*/ + SwTableProperties_Impl::~SwTableProperties_Impl() { } -/* -----------------22.06.98 09:51------------------- - * - * --------------------------------------------------*/ + void SwTableProperties_Impl::SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& rVal) { aAnyMap.SetValue( nWhichId, nMemberId, rVal ); } -/* -----------------22.06.98 09:51------------------- - * - * --------------------------------------------------*/ sal_Bool SwTableProperties_Impl::GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny ) { return aAnyMap.FillValue( nWhichId, nMemberId, rpAny ); } -/* -----------------13.01.99 15:42------------------- - * - * --------------------------------------------------*/ + void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) { SfxItemSet aSet(rDoc.GetAttrPool(), @@ -2285,9 +2079,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() ); } } -/* -----------------------------11.07.00 12:14-------------------------------- - ---------------------------------------------------------------------------*/ SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef ) { uno::Reference xTunnel( xRef, uno::UNO_QUERY); @@ -2296,17 +2088,13 @@ SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef ) sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextTable::getUnoTunnelId()) )); return 0; } -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -2318,14 +2106,10 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& } return 0; } -/*-- 11.12.98 12:42:43--------------------------------------------------- - -----------------------------------------------------------------------*/ TYPEINIT1(SwXTextTable, SwClient) -/*-- 11.12.98 12:42:43--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTable::SwXTextTable() : aLstnrCntnr( (text::XTextTable*)this), aChartLstnrCntnr( (text::XTextTable*)this), @@ -2337,11 +2121,8 @@ SwXTextTable::SwXTextTable() : bFirstRowAsLabel(sal_False), bFirstColumnAsLabel(sal_False) { - } -/*-- 11.12.98 12:42:44--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) : SwClient( &rFrmFmt ), aLstnrCntnr( (text::XTextTable*)this), @@ -2354,18 +2135,13 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) : bFirstRowAsLabel(sal_False), bFirstColumnAsLabel(sal_False) { - } -/*-- 11.12.98 12:42:44--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextTable::~SwXTextTable() { delete pTableProps; } -/*-- 11.12.98 12:42:44--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeException ) { if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX ) @@ -2376,17 +2152,14 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc nColumns = (sal_uInt16)nC; } } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< table::XTableRows > xRet; if (SwFrmFmt* pFmt = GetFrmFmt()) { - SwXTableRows* pRows = (SwXTableRows*)SwClientIter(*pFmt). - First(TYPE(SwXTableRows)); + SwXTableRows* pRows = SwIterator::FirstElement(*pFmt); if (!pRows) pRows = new SwXTableRows(*pFmt); xRet = pRows; @@ -2395,17 +2168,14 @@ uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::Run throw uno::RuntimeException(); return xRet; } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< table::XTableColumns > xRet; if (SwFrmFmt* pFmt = GetFrmFmt()) { - SwXTableColumns* pCols = (SwXTableColumns*)SwClientIter(*pFmt). - First(TYPE(SwXTableColumns)); + SwXTableColumns* pCols = SwIterator::FirstElement(*pFmt); if (!pCols) pCols = new SwXTableColumns(*pFmt); xRet = pCols; @@ -2414,9 +2184,7 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un throw uno::RuntimeException(); return xRet; } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& CellName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2436,9 +2204,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& Cell throw uno::RuntimeException(); return xRet; } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2463,9 +2229,7 @@ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeEx } return uno::Sequence< OUString >(); } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(const OUString& CellName) throw( uno::RuntimeException ) { @@ -2486,9 +2250,7 @@ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(c throw uno::RuntimeException(); return xRet; } -/* -----------------18.02.99 13:36------------------- - * - * --------------------------------------------------*/ + void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -2538,18 +2300,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex // hier muessen die Properties des Descriptors ausgewertet werden pTableProps->ApplyTblAttr(*pTable, *pDoc); SwFrmFmt* pTblFmt = pTable->GetFrmFmt(); - SwClientIter aIter( *pTblFmt ); - for( SwClient* pC = aIter.First( TYPE( SwFrm )); - pC; pC = aIter.Next() ) - { - if( ((SwFrm*)pC)->IsTabFrm() ) - { - if(((SwFrm*)pC)->IsValid()) - ((SwFrm*)pC)->InvalidatePos(); - ((SwTabFrm*)pC)->SetONECalcLowers(); - ((SwTabFrm*)pC)->Calc(); - } - } + lcl_FormatTable( pTblFmt ); pTblFmt->Add(this); if(m_sTableName.Len()) @@ -2582,18 +2333,14 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex else throw lang::IllegalArgumentException(); } -/*-- 11.12.98 12:42:45--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); attachToRange( xTextRange ); } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void) throw( uno::RuntimeException ) { @@ -2604,9 +2351,7 @@ uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void) uno::Reference< text::XTextRange > xRet = new SwXTextRange(*pFmt); return xRet; } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::dispose(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2622,26 +2367,20 @@ void SwXTextTable::dispose(void) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn()) throw uno::RuntimeException(); aLstnrCntnr.AddListener(aListener); } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) { @@ -2660,9 +2399,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColum return aRef; } -/* -----------------11.12.98 13:26------------------- - * - * --------------------------------------------------*/ + uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable, const String& rTLName, const String& rBRName, SwRangeDescriptor& rDesc) @@ -2699,9 +2436,7 @@ uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt } return aRef; } -/*-- 11.12.98 12:42:46--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) @@ -2734,9 +2469,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_In throw lang::IndexOutOfBoundsException(); return aRef; } -/*-- 11.12.98 12:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUString& aRange) throw( uno::RuntimeException ) { @@ -2771,9 +2504,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUSt throw uno::RuntimeException(); return aRef; } -/*-- 29.04.02 11:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray() throw (uno::RuntimeException) { @@ -2833,9 +2564,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray() throw uno::RuntimeException(); return aRowSeq; } -/*-- 29.04.02 11:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SAL_CALL SwXTextTable::setDataArray( const uno::Sequence< uno::Sequence< uno::Any > >& rArray ) throw (uno::RuntimeException) @@ -2903,9 +2632,7 @@ void SAL_CALL SwXTextTable::setDataArray( } } } -/*-- 11.12.98 12:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void) throw( uno::RuntimeException ) { @@ -2947,9 +2674,7 @@ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void) throw uno::RuntimeException(); return aRowSeq; } -/*-- 11.12.98 12:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData) throw( uno::RuntimeException ) { @@ -2997,9 +2722,7 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData aChartLstnrCntnr.ChartDataChanged(); } } -/*-- 11.12.98 12:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3039,9 +2762,7 @@ uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::Run throw uno::RuntimeException(); return aRet; } -/*-- 11.12.98 12:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3076,9 +2797,7 @@ void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) else throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:48--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void) throw( uno::RuntimeException ) { @@ -3119,9 +2838,7 @@ uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void) throw uno::RuntimeException(); return aRet; } -/*-- 11.12.98 12:42:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColumnDesc) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3158,9 +2875,7 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum else throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::addChartDataChangeEventListener( const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException ) @@ -3169,9 +2884,7 @@ void SwXTextTable::addChartDataChangeEventListener( throw uno::RuntimeException(); aChartLstnrCntnr.AddListener(aListener.get()); } -/*-- 11.12.98 12:42:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::removeChartDataChangeEventListener( const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException ) @@ -3179,27 +2892,21 @@ void SwXTextTable::removeChartDataChangeEventListener( if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get())) throw uno::RuntimeException(); } -/* -----------------08.03.99 15:33------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXTextTable::isNotANumber(double nNumber) throw( uno::RuntimeException ) { // We use DBL_MIN because starcalc does (which uses it because chart // wants it that way!) return ( nNumber == DBL_MIN ); } -/* -----------------08.03.99 15:34------------------- - * - * --------------------------------------------------*/ + double SwXTextTable::getNotANumber(void) throw( uno::RuntimeException ) { // We use DBL_MIN because starcalc does (which uses it because chart // wants it that way!) return DBL_MIN; } -/*-- 11.12.98 12:42:48--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void) throw( uno::RuntimeException ) { @@ -3207,9 +2914,7 @@ uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void) return SwUnoCursorHelper::CreateSortDescriptor(true); } -/*-- 11.12.98 12:42:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor) throw( uno::RuntimeException ) { @@ -3231,9 +2936,7 @@ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor pFmt->GetDoc()->SortTbl(aBoxes, aSortOpt); } } -/*-- 11.12.98 12:42:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumentException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3266,17 +2969,13 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen else throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:49--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 11.12.98 12:42:50--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, @@ -3338,9 +3037,9 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, && pBorder) { SwDoc* pDoc = pFmt->GetDoc(); - SwClientIter aIter( *pFmt ); + SwFrm* pFrm = SwIterator::FirstElement( *pFmt ); //Tabellen ohne Layout (unsichtbare Header/Footer ) - if(0 != aIter.First( TYPE( SwFrm ))) + if( pFrm ) { lcl_FormatTable(pFmt); SwTable* pTable = SwTable::FindTable( pFmt ); @@ -3486,9 +3185,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, else throw uno::RuntimeException(); } -/*-- 11.12.98 12:42:51--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3535,9 +3232,9 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be case FN_UNO_TABLE_BORDER: { SwDoc* pDoc = pFmt->GetDoc(); - SwClientIter aIter( *pFmt ); + SwFrm* pFrm = SwIterator::FirstElement( *pFmt ); //Tabellen ohne Layout (unsichtbare Header/Footer ) - if(0 != aIter.First( TYPE( SwFrm ))) + if( pFrm ) { lcl_FormatTable(pFmt); SwTable* pTable = SwTable::FindTable( pFmt ); @@ -3701,37 +3398,27 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be throw uno::RuntimeException(); return aRet; } -/*-- 11.12.98 12:42:51--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:42:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:42:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:42:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 12:42:58--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXTextTable::getName(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3747,9 +3434,7 @@ OUString SwXTextTable::getName(void) throw( uno::RuntimeException ) sRet = m_sTableName; return sRet; } -/*-- 11.12.98 12:42:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3807,9 +3492,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException ) else m_sTableName = sNewTblName; } -/*-----------------11.02.98 09:58------------------- ---------------------------------------------------*/ sal_uInt16 SwXTextTable::getRowCount(void) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3825,9 +3508,7 @@ sal_uInt16 SwXTextTable::getRowCount(void) } return nRet; } -/*-----------------11.02.98 09:58------------------- ---------------------------------------------------*/ sal_uInt16 SwXTextTable::getColumnCount(void) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -3845,10 +3526,8 @@ sal_uInt16 SwXTextTable::getColumnCount(void) } return nRet; } -/*-- 11.12.98 12:42:59--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT && (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) @@ -3863,16 +3542,12 @@ void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) else aChartLstnrCntnr.ChartDataChanged(); } -/* -----------------25.10.99 15:12------------------- - --------------------------------------------------*/ OUString SAL_CALL SwXTextTable::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTextTable"); } -/* -----------------25.10.99 15:12------------------- - --------------------------------------------------*/ sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { String sServiceName(rServiceName); @@ -3881,9 +3556,7 @@ sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno: sServiceName.EqualsAscii("com.sun.star.text.TextContent") || sServiceName.EqualsAscii("com.sun.star.text.TextSortable")); } -/* -----------------25.10.99 15:12------------------- - --------------------------------------------------*/ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(4); @@ -3898,17 +3571,13 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un /****************************************************************** * ******************************************************************/ -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -3920,20 +3589,14 @@ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& } return 0; } -/* -----------------28.04.98 10:29------------------- - * - * --------------------------------------------------*/ + TYPEINIT1(SwXCellRange, SwClient); -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXCellRange"); } -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return @@ -3945,9 +3608,7 @@ BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::Run rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesAsian" ) ) || rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesComplex" ) ); } -/* -----------------------------19.04.00 15:21-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(7); @@ -3962,9 +3623,7 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un return aRet; } -/*-- 11.12.98 14:27:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, SwRangeDescriptor& rDesc) : @@ -3979,17 +3638,13 @@ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, { aRgDesc.Normalize(); } -/*-- 11.12.98 14:27:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXCellRange::~SwXCellRange() { vos::OGuard aGuard(Application::GetSolarMutex()); delete pTblCrsr; } -/*-- 11.12.98 14:27:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) { @@ -4011,9 +3666,7 @@ uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColum throw lang::IndexOutOfBoundsException(); return aRet; } -/*-- 11.12.98 14:27:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) @@ -4069,9 +3722,7 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition( return aRet; } -/*-- 11.12.98 14:27:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUString& rRange) throw( uno::RuntimeException ) { @@ -4089,17 +3740,13 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUSt return getCellRangeByPosition(aDesc.nLeft - aRgDesc.nLeft, aDesc.nTop - aRgDesc.nTop, aDesc.nRight - aRgDesc.nLeft, aDesc.nBottom - aRgDesc.nTop); } -/*-- 11.12.98 14:27:35--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXCellRange::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 11.12.98 14:27:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, @@ -4218,9 +3865,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); } } -/*-- 11.12.98 14:27:35--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -4302,39 +3947,27 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be } return aRet; } -/*-- 11.12.98 14:27:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 14:27:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 14:27:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*-- 11.12.98 14:27:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { DBG_WARNING("not implemented"); } -/*----------------------------------------------------------------------- - - -----------------------------------------------------------------------*/ - void SwXCellRange::GetDataSequence( uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used uno::Sequence< OUString > *pTxtSeq, //-> as output sequence @@ -4479,9 +4112,6 @@ void SwXCellRange::GetDataSequence( pDblSeq->realloc( nDtaCnt ); } -/*-- 29.04.02 11:42:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray() throw (uno::RuntimeException) { @@ -4543,9 +4173,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray() } return aRowSeq; } -/*-- 29.04.02 11:42:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SAL_CALL SwXCellRange::setDataArray( const uno::Sequence< uno::Sequence< uno::Any > >& rArray ) throw (uno::RuntimeException) @@ -4611,9 +4239,7 @@ void SAL_CALL SwXCellRange::setDataArray( } } } -/*-- 11.12.98 14:27:36--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -4652,9 +4278,7 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno: } return aRowSeq; } -/*-- 11.12.98 14:27:37--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData) throw( uno::RuntimeException ) { @@ -4697,9 +4321,7 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData } } } -/*-- 11.12.98 14:27:37--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void) throw( uno::RuntimeException ) { @@ -4739,9 +4361,7 @@ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void) throw uno::RuntimeException(); return aRet; } -/*-- 11.12.98 14:27:37--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException ) { @@ -4775,9 +4395,7 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) } } } -/*-- 11.12.98 14:27:37--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void) throw( uno::RuntimeException ) { @@ -4817,9 +4435,7 @@ uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void) throw uno::RuntimeException(); return aRet; } -/*-- 11.12.98 14:27:37--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& ColumnDesc) throw( uno::RuntimeException ) { @@ -4850,52 +4466,40 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column } } } -/*-- 11.12.98 14:27:38--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::addChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn()) throw uno::RuntimeException(); aChartLstnrCntnr.AddListener(aListener.get()); } -/*-- 11.12.98 14:27:38--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException ) { if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get())) throw uno::RuntimeException(); } -/* -----------------08.03.99 15:36------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException ) { DBG_WARNING("not implemented"); return sal_False; } -/* -----------------08.03.99 15:36------------------- - * - * --------------------------------------------------*/ + double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException ) { DBG_WARNING("not implemented"); return 0.; } -/*-- 11.12.98 14:27:38--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > SwXCellRange::createSortDescriptor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); return SwUnoCursorHelper::CreateSortDescriptor(true); } -/*-- 11.12.98 14:27:39--------------------------------------------------- - -----------------------------------------------------------------------*/ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor) throw( uno::RuntimeException ) { @@ -4911,23 +4515,17 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD pFmt->GetDoc()->SortTbl(pTableCrsr->GetBoxes(), aSortOpt); } } -/* -----------------27.04.98 16:54------------------- - * - * --------------------------------------------------*/ + sal_uInt16 SwXCellRange::getColumnCount(void) { return static_cast< sal_uInt16 >(aRgDesc.nRight - aRgDesc.nLeft + 1); } -/* -----------------27.04.98 16:54------------------- - * - * --------------------------------------------------*/ + sal_uInt16 SwXCellRange::getRowCount(void) { return static_cast< sal_uInt16 >(aRgDesc.nBottom - aRgDesc.nTop + 1); } -/* -----------------------------05.06.01 09:19-------------------------------- - ---------------------------------------------------------------------------*/ const SwUnoCrsr* SwXCellRange::GetTblCrsr() const { const SwUnoCrsr* pRet = 0; @@ -4937,10 +4535,8 @@ const SwUnoCrsr* SwXCellRange::GetTblCrsr() const return pRet; } -/*-- 11.12.98 14:27:39--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew ); if(!GetRegisteredIn() || !aCursorDepend.GetRegisteredIn()) @@ -4957,26 +4553,21 @@ void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) else aChartLstnrCntnr.ChartDataChanged(); } + /****************************************************************** * SwXTableRows ******************************************************************/ -/* -----------------------------19.04.00 15:22-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTableRows"); } -/* -----------------------------19.04.00 15:22-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.TableRows") == rServiceName; } -/* -----------------------------19.04.00 15:22-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -4985,21 +4576,16 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( un return aRet; } TYPEINIT1(SwXTableRows, SwClient); -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ + SwXTableRows::SwXTableRows(SwFrmFmt& rFrmFmt) : SwClient(&rFrmFmt) { } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTableRows::~SwXTableRows() { } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5014,9 +4600,7 @@ sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException ) } return nRet; } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -5031,15 +4615,14 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex) if(pTable->GetTabLines().Count() > nIndex) { SwTableLine* pLine = pTable->GetTabLines().GetObject((sal_uInt16)nIndex); - SwClientIter aIter( *pFrmFmt ); - SwXTextTableRow* pXRow = (SwXTextTableRow*)aIter. - First( TYPE( SwXTextTableRow )); + SwIterator aIter( *pFrmFmt ); + SwXTextTableRow* pXRow = aIter.First(); while( pXRow ) { // gibt es eine passende Zelle bereits? if(pXRow->GetTblRow() == pLine) break; - pXRow = (SwXTextTableRow*)aIter.Next(); + pXRow = aIter.Next(); } //sonst anlegen if(!pXRow) @@ -5053,16 +4636,12 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex) } return aRet; } -/*-- 03.02.99 07:37:42--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXTableRows::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((const uno::Reference*)0); } -/*-- 03.02.99 07:37:42--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5072,9 +4651,7 @@ sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException ) //es gibt keine Tabelle ohne Zeilen return sal_True; } -/*-- 03.02.99 07:37:42--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5128,9 +4705,7 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno: } } } -/*-- 03.02.99 07:37:43--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5190,10 +4765,8 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno: } } } -/*-- 03.02.99 07:37:43--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTableRows::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } @@ -5201,23 +4774,17 @@ void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) /****************************************************************** * SwXTableColumns ******************************************************************/ -/* -----------------------------19.04.00 15:23-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXTableColumns"); } -/* -----------------------------19.04.00 15:23-------------------------------- - ---------------------------------------------------------------------------*/ BOOL SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.TableColumns") == rServiceName; } -/* -----------------------------19.04.00 15:23-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -5226,21 +4793,16 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw( return aRet; } TYPEINIT1(SwXTableColumns, SwClient); -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ + SwXTableColumns::SwXTableColumns(SwFrmFmt& rFrmFmt) : SwClient(&rFrmFmt) { } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTableColumns::~SwXTableColumns() { } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5260,9 +4822,7 @@ sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException ) } return nRet; } -/*-- 03.02.99 07:37:41--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -5287,17 +4847,12 @@ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex) } return uno::Any(&xRet, ::getCppuType((const uno::Reference*)0)); } -/*-- 03.02.99 07:37:42--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Type SAL_CALL SwXTableColumns::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((uno::Reference*)0); } -/*-- 03.02.99 07:37:42--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5306,9 +4861,7 @@ sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return sal_True; } -/*-- 03.02.99 07:37:42--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5361,9 +4914,7 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u } } } -/*-- 03.02.99 07:37:43--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -5423,16 +4974,12 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u } } } -/*-- 03.02.99 07:37:43--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTableColumns::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTableColumns::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -/* -----------------------------22.09.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ void SwChartEventListenerContainer::ChartDataChanged() { if(pListenerArr) diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 3ddcfc1d2ed7..6c35ac2a1392 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2687,7 +2687,7 @@ public: } return *pFmt; } - +protected: // SwClient virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index a02085f261b6..0baada0c8df0 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -48,7 +48,9 @@ using namespace ::com::sun::star; SwXTextMarkup::SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper::ConversionMap* pMap ) : mpTxtNode( &rTxtNode ), mpConversionMap( pMap ) { - mpTxtNode->Add(this); + // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ... + SetIsAllowedToBeRemovedInModifyCall(true); + mpTxtNode->Add(this); } SwXTextMarkup::~SwXTextMarkup() @@ -421,12 +423,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) } -void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ ) +void SwXTextMarkup::Modify( const SfxPoolItem* /*pOld*/, const SfxPoolItem* /*pNew*/ ) { // FME 2007-07-16 #i79641# In my opinion this is perfectly legal, // therefore I remove the assertion in SwModify::_Remove() - if ( pRegisteredIn ) - pRegisteredIn->Remove( this ); + if ( GetRegisteredIn() ) + GetRegisteredInNonConst()->Remove( this ); // <-- vos::OGuard aGuard(Application::GetSolarMutex()); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 43662250ebd0..5377867e2a80 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2276,7 +2276,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) if( pFldType && pFldType->GetDepends() ) { SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT ); - pFldType->Modify( &aHnt, 0); + pFldType->ModifyNotification( &aHnt, 0); } bReformat = TRUE; } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index a1b2805cbfa2..686b7a9a8f34 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -32,9 +32,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -48,14 +46,11 @@ #include #include #include - +#include /************************************************************************* |* |* ViewShell::Init() -|* -|* Letzte Aenderung MA 14. Jun. 96 -|* |*************************************************************************/ void ViewShell::Init( const SwViewOption *pNewOpt ) @@ -164,9 +159,6 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) /************************************************************************* |* |* ViewShell::ViewShell() CTor fuer die erste Shell. -|* -|* Letzte Aenderung MA 29. Aug. 95 -|* |*************************************************************************/ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow, @@ -246,9 +238,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow, /************************************************************************* |* |* ViewShell::ViewShell() CTor fuer weitere Shells auf ein Dokument. -|* -|* Letzte Aenderung MA 29. Aug. 95 -|* |*************************************************************************/ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, @@ -321,9 +310,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow, |* |* ViewShell::~ViewShell() |* -|* Ersterstellung MA ?? -|* Letzte Aenderung MA 10. May. 95 -|* ******************************************************************************/ ViewShell::~ViewShell() @@ -349,9 +335,8 @@ ViewShell::~ViewShell() { if( pGNd->IsAnimated() ) { - SwClientIter aIter( *pGNd ); - for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); - pFrm; pFrm = (SwFrm*)aIter.Next() ) + SwIterator aIter( *pGNd ); + for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { ASSERT( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" ); ((SwNoTxtFrm*)pFrm)->StopAnimation( pOut ); diff --git a/sw/source/filter/html/htmlvsh.hxx b/sw/source/filter/html/htmlvsh.hxx index 18e0129fd0a3..67afddf699ee 100644 --- a/sw/source/filter/html/htmlvsh.hxx +++ b/sw/source/filter/html/htmlvsh.hxx @@ -34,7 +34,8 @@ class ViewShell; class SwHTMLViewShellClient : public SwClient { - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); public: @@ -45,7 +46,7 @@ public: void Register( ViewShell *pVsh ); void DeRegister(); - /*inline*/ ViewShell *GetViewShell(); // im swhtml.cxx + ViewShell *GetViewShell(); }; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fba6a477757d..bb2cdd647bc3 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -925,15 +925,15 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() ) #endif } -void SwHTMLParser::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void SwHTMLParser::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ) { case RES_OBJECTDYING: - if( ((SwPtrMsgPoolItem *)pOld)->pObject == pRegisteredIn ) + if( ((SwPtrMsgPoolItem *)pOld)->pObject == GetRegisteredIn() ) { // dann uns selbst beenden - pRegisteredIn->Remove( this ); + GetRegisteredInNonConst()->Remove( this ); ReleaseRef(); // ansonsten sind wir fertig! } break; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index e7d684842beb..2a7bf5e0a917 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -924,7 +924,7 @@ protected: virtual ~SwHTMLParser(); // wird das Dok geloescht, ist auch der Parser zu loeschen - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); virtual void AddMetaUserDefined( ::rtl::OUString const & i_rMetaName ); diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index c511d4aab02a..f0b1259d2eda 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -166,7 +166,7 @@ class SwFltAnchorClient : public SwClient public: SwFltAnchorClient(SwFltAnchor * pFltAnchor); - virtual void Modify (SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify (const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index 507f35375ed6..d191a7424f61 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -724,7 +724,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule ) SwCharFmt* pCFmt = rNFmt.GetCharFmt(); if( pCFmt ) { - pCFmt->Remove( &rNFmt ); + rNFmt.ForgetCharFmt(); if( !pCFmt->GetDepends() ) pDoc->DelCharFmt( pCFmt ); } diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx index 2c182532079d..08b3af4fabbd 100644 --- a/sw/source/filter/rtf/rtftbl.cxx +++ b/sw/source/filter/rtf/rtftbl.cxx @@ -781,9 +781,9 @@ void SwRTFParser::ReadTable( int nToken ) { SwTableBox* pBox = pNewLine->GetTabBoxes()[0]; pBoxFmt = (SwTableBoxFmt*)pBox->GetFrmFmt(); - pBoxFmt->Remove( pBox ); + pBox->ForgetFrmFmt(); delete pBoxFmt; - aBoxFmts[0]->Add( pBox ); + pBox->RegisterToFormat( *aBoxFmts[0] ); SwTxtNode* pTNd = pDoc->GetNodes()[ pBox->GetSttIdx()+1 ] ->GetTxtNode(); ASSERT( pTNd, "wo ist der Textnode dieser Box?" ); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 43986e9cd599..7222b95fb229 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -1057,7 +1057,7 @@ InsertedTableClient::InsertedTableClient(SwTableNode & rNode) SwTableNode * InsertedTableClient::GetTableNode() { - return dynamic_cast (pRegisteredIn); + return dynamic_cast (GetRegisteredInNonConst()); } InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc) diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index 27295e9e7bce..57cb0ce8a650 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -777,11 +777,11 @@ SwFltAnchorClient::SwFltAnchorClient(SwFltAnchor * pFltAnchor) { } -void SwFltAnchorClient::Modify(SfxPoolItem *, SfxPoolItem * pNew) +void SwFltAnchorClient::Modify(const SfxPoolItem *, const SfxPoolItem * pNew) { if (pNew->Which() == RES_FMT_CHG) { - SwFmtChg * pFmtChg = dynamic_cast (pNew); + const SwFmtChg * pFmtChg = dynamic_cast (pNew); if (pFmtChg != NULL) { diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 7f1b6658800e..92745a7ec00d 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2120,7 +2120,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, const SwContact* pContact = _rFrmFmt.FindContactObj(); if ( pContact ) { - std::vector aAnchoredObjs; + std::list aAnchoredObjs; pContact->GetAnchoredObjs( aAnchoredObjs ); if ( !aAnchoredObjs.empty() ) { diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 6e6dcf813767..33350414f084 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1903,8 +1903,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) if (pTextNodeInfoInner->isFirstInTable()) { const SwTable * pTable = pTextNodeInfoInner->getTable(); - const SwTableFmt * pTabFmt = - dynamic_cast(pTable->GetRegisteredIn()); + + const SwTableFmt * pTabFmt = pTable->GetTableFmt(); if (pTabFmt != NULL) { if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE) @@ -2118,7 +2118,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) // this has to be overruled. const SwFmtPageDesc& rPageDescAtParaStyle = ItemGet( rNode, RES_PAGEDESC ); - if( rPageDescAtParaStyle.GetRegisteredIn() ) + if( rPageDescAtParaStyle.KnowsPageDesc() ) pTmpSet->ClearItem( RES_BREAK ); } } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index e22ca1c9b731..cfa1e6298421 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2115,7 +2115,7 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) { const SwTable * pTable = pTableTextNodeInfoInner->getTable(); - const SwTableFmt * pTableFmt = dynamic_cast(pTable->GetRegisteredIn()); + const SwTableFmt * pTableFmt = pTable->GetTableFmt(); if (pTableFmt != NULL) { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 89aef162ec01..4688fe8fc6a1 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -325,21 +325,19 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool pISet = 0; // fuer Doppel-Attribute } } - +#include "switerator.hxx" void MSWordExportBase::GatherChapterFields() { //If the header/footer contains a chapter field - SwClientIter aIter(*pDoc->GetSysFldType(RES_CHAPTERFLD)); - const SwClient *pField = aIter.First(TYPE(SwFmtFld)); - while (pField) + SwFieldType* pType = pDoc->GetSysFldType( RES_CHAPTERFLD ); + SwIterator aFmtFlds( *pType ); + for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() ) { - const SwFmtFld* pFld = (const SwFmtFld*)(pField); if (const SwTxtFld *pTxtFld = pFld->GetTxtFld()) { const SwTxtNode &rTxtNode = pTxtFld->GetTxtNode(); maChapterFieldLocs.push_back(rTxtNode.GetIndex()); } - pField = aIter.Next(); } } @@ -441,7 +439,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode if ( pSet && pSet->Count() ) { if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) - && ( (SwFmtPageDesc*)pItem )->GetRegisteredIn() ) + && ( (SwFmtPageDesc*)pItem )->KnowsPageDesc() ) { bBreakSet = true; bNewPageDesc = true; @@ -524,7 +522,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode // but a pagedesc item is an implicit page break before... const SwFmtPageDesc &rPageDesc = ItemGet( *pNd, RES_PAGEDESC ); - if ( rPageDesc.GetRegisteredIn() ) + if ( rPageDesc.KnowsPageDesc() ) bHackInBreak = true; } } @@ -862,10 +860,10 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF bool MSWordExportBase::HasRefToObject( USHORT nTyp, const String* pName, USHORT nSeqNo ) { const SwTxtNode* pNd; - SwClientIter aIter( *pDoc->GetSysFldType( RES_GETREFFLD ) ); - for ( SwFmtFld* pFld = static_cast< SwFmtFld* >( aIter.First( TYPE( SwFmtFld ) ) ); - pFld; - pFld = static_cast< SwFmtFld* >( aIter.Next() ) ) + + SwFieldType* pType = pDoc->GetSysFldType( RES_GETREFFLD ); + SwIterator aFmtFlds( *pType ); + for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() ) { if ( pFld->GetTxtFld() && nTyp == pFld->GetFld()->GetSubType() && 0 != ( pNd = pFld->GetTxtFld()->GetpTxtNode() ) && @@ -3623,7 +3621,7 @@ void AttributeOutputBase::FormatPageDescription( const SwFmtPageDesc& rPageDesc if ( GetExport().bStyDef && GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtFmtColl ) ) { const SwTxtFmtColl* pC = (SwTxtFmtColl*)GetExport().pOutFmtNode; - if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.GetRegisteredIn() ) + if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.KnowsPageDesc() ) FormatBreak( SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ) ); } } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 93a39b1c390c..ae058529a5f1 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2672,7 +2672,7 @@ void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/, if( STRING_NOTFOUND != n ) { SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0); - pType->Add( &rBase ); + rBase.RegisterToTOXType( *pType ); rBase.SetCaptionDisplay( eCaptionType ); // Read Sequence Name and store in TOXBase String sSeqName( rParam.GetResult() ); diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 050f498c10c5..33f339fe60a3 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -700,7 +700,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() if( pFmtPageDesc ) { - pPageDesc->Add( pFmtPageDesc ); + pFmtPageDesc->RegisterToPageDesc( *pPageDesc ); pItemSet->Put( *pFmtPageDesc ); delete pFmtPageDesc; } @@ -1087,7 +1087,7 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc ) if( bSendModify ) { SwCondCollCondChg aMsg( pColl ); - pColl->Modify( &aMsg, &aMsg ); + pColl->ModifyNotification( &aMsg, &aMsg ); } } } diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index d5f298b5292c..6bdd02ef8c06 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -63,6 +63,7 @@ #include #include #include +#include // for locking SolarMutex: svapp + mutex #include @@ -320,9 +321,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( { // check whether an object with this name already exists in the document String aName; - SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator aIter( *pDoc->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pExistingOLENd = pNd->GetOLENode(); if( pExistingOLENd ) diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index bc7e1ec82888..c078f55a0ed9 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -92,11 +92,8 @@ #include #include #include - -// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption #include #include -// <-- #include // Fehlermeldungen #include #include @@ -122,7 +119,7 @@ #include #include - +#include using rtl::OUString; using namespace ::com::sun::star; @@ -944,32 +941,6 @@ Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const const SwRect aPageRect = pNd->FindPageFrmRect( FALSE, 0, FALSE ); return aPageRect.SVRect(); - - // Why does this have to be that complicated? I replaced this by the - // call of FindPageFrmRect(): - /* - //PageDesc besorgen, vom ersten Absatz oder den default. - const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc(); - const SwPageDesc* pDesc = rDesc.GetPageDesc(); - if( !pDesc ) - pDesc = &const_cast(pDoc)->GetPageDesc( 0 ); - - //Das Format wird evtl. von der virtuellen Seitennummer bestimmt. - const USHORT nPgNum = rDesc.GetNumOffset(); - const BOOL bOdd = nPgNum % 2 ? TRUE : FALSE; - const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt(); - if ( !pFmt ) //#40568# - pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt(); - - if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX ) - //Jetzt wird es aber Zeit fuer die Initialisierung - pDoc->getPrinter( true ); - - const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize(); - const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() ); - const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER ); - const Rectangle aRect( aPt, aSz ); - return aRect;*/ } return SfxObjectShell::GetVisArea( nAspect ); } @@ -1014,17 +985,16 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) if ( GetWrtShell() ) { SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr ); - SwClientIter aIter( *pType ); - SwClient* pFirst = aIter.GoStart(); + SwIterator aIter( *pType ); + SwFmtFld* pFirst = aIter.First(); while( pFirst ) { - if( static_cast(pFirst)->GetTxtFld() && - static_cast(pFirst)->IsFldInDoc() ) + if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() ) { nState |= HIDDENINFORMATION_NOTES; break; } - pFirst = ++aIter; + pFirst = aIter.Next(); } } } @@ -1048,16 +1018,6 @@ void SwDocShell::GetState(SfxItemSet& rSet) { switch (nWhich) { - // MT: MakroChosser immer enablen, weil Neu moeglich - // case SID_BASICCHOOSER: - // { - // StarBASIC* pBasic = GetBasic(); - // StarBASIC* pAppBasic = SFX_APP()->GetBasic(); - // if ( !(pBasic->GetModules()->Count() || - // pAppBasic->GetModules()->Count()) ) - // rSet.DisableItem(nWhich); - // } - // break; case SID_PRINTPREVIEW: { BOOL bDisable = IsInPlaceActive(); @@ -1261,9 +1221,8 @@ SwFEShell* SwDocShell::GetFEShell() void SwDocShell::RemoveOLEObjects() { - SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator aIter( *pDoc->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && ( pOLENd->IsOLEObjectDeleted() || @@ -1290,9 +1249,8 @@ void SwDocShell::CalcLayoutForOLEObjects() if( !pWrtShell ) return; - SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator aIter( *pDoc->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && pOLENd->IsOLESizeInvalid() ) diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index b0b81c5df6e4..1b439fca9e6d 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -1187,14 +1187,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, if( rStyle.Len() && 0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, TRUE ))) { - pFindFmt->Add( &aCond ); + aCond.RegisterToFormat( *pFindFmt ); ((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond ); } } // Document auf die neue Bedingungen updaten SwCondCollCondChg aMsg( pColl ); - pColl->Modify( &aMsg, &aMsg ); + pColl->ModifyNotification( &aMsg, &aMsg ); } else if( pCondItem && !pColl->GetDepends() ) { diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index c9e99979e66b..2b2ebc3ee7cd 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -102,7 +102,7 @@ struct SpellState ESelection m_aESelection; //iterating over draw text objects - std::vector m_aTextObjects; + std::list m_aTextObjects; bool m_bTextObjectsCollected; SpellState() : @@ -790,58 +790,24 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) if( pObj && pObj->ISA(SdrTextObj) ) pCurrentTextObj = static_cast(pObj); } - //at first fill the vector of drawing objects + //at first fill the list of drawing objects if(!m_pSpellState->m_bTextObjectsCollected ) { m_pSpellState->m_bTextObjectsCollected = true; - sal_uInt16 n = 0; - //iterate in the 'normal' array of objects - while( n < pDoc->GetSpzFrmFmts()->Count() ) + std::list aTextObjs; + SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pDoc ); + if(pCurrentTextObj) { - SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[ n ]; - if( pFly->IsA( TYPE(SwDrawFrmFmt) ) ) - { - SwClientIter aIter( (SwFmt&) *pFly ); - if( aIter.First( TYPE(SwDrawContact) ) ) - { - SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster(); - if ( pSdrO ) - { - if ( pSdrO->IsA( TYPE(SdrObjGroup) ) ) - { - SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS ); - //iterate inside of a grouped object - while( aListIter.IsMore() ) - { - SdrObject* pSdrOElement = aListIter.Next(); - if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) && - static_cast( pSdrOElement)->HasText() && - pCurrentTextObj != pSdrOElement) - { - m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrOElement); + m_pSpellState->m_aTextObjects.remove(pCurrentTextObj); + m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj); } } - } - else if( pSdrO->IsA( TYPE(SdrTextObj) ) && - static_cast( pSdrO )->HasText() && - pCurrentTextObj != pSdrO) - { - m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrO); - } - } - } - } - ++n; - } - if(pCurrentTextObj) - m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj); - } if(m_pSpellState->m_aTextObjects.size()) { Reference< XSpellChecker1 > xSpell( GetSpellChecker() ); while(!bNextDoc && m_pSpellState->m_aTextObjects.size()) { - std::vector::iterator aStart = m_pSpellState->m_aTextObjects.begin(); + std::list::iterator aStart = m_pSpellState->m_aTextObjects.begin(); SdrTextObj* pTextObj = *aStart; if(m_pSpellState->m_pStartDrawing == pTextObj) m_pSpellState->m_bRestartDrawing = true; diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 8220c7ee2c8d..0af9063d4c72 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -115,21 +115,11 @@ #include #include // #111827# #include - -// #108584# #include - -// #108584# #include - -// #108584# #include - -// #108584# #include #include - -// #109590# #include #include #include @@ -137,6 +127,7 @@ #include #include #include +#include extern BOOL bFrmDrag; extern BOOL bDDINetAttr; @@ -373,10 +364,8 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64& uno::Reference < embed::XEmbeddedObject > xObj; if( pClpDocFac ) { - SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()-> - GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) if( ND_OLENODE == pNd->GetNodeType() ) { xObj = ((SwOLENode*)pNd)->GetOLEObj().GetOleRef(); @@ -393,10 +382,8 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const { if( pClpDocFac ) { - SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()-> - GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) if( ND_OLENODE == pNd->GetNodeType() ) { return ((SwOLENode*)pNd)->GetGraphic(); diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 645d4773626a..ee1eabf25611 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -87,6 +87,7 @@ #include #include "swevent.hxx" +#include "switerator.hxx" // distance between Anchor Y and initial note position #define POSTIT_INITIAL_ANCHOR_DISTANCE 20 @@ -1187,17 +1188,16 @@ void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus) { bool bEmpty = mvPostItFlds.empty(); SwFieldType* pType = mpView->GetDocShell()->GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false); - SwClientIter aIter( *pType ); - SwClient * pFirst = aIter.GoStart(); - while(pFirst) + SwIterator aIter( *pType ); + SwFmtFld* pSwFmtFld = aIter.First(); + while(pSwFmtFld) { - SwFmtFld* pSwFmtFld = static_cast(pFirst); if ( pSwFmtFld->GetTxtFld()) { if ( pSwFmtFld->IsFldInDoc() ) InsertItem(pSwFmtFld,bCheckExistance,bFocus); } - pFirst = aIter++; + pSwFmtFld = aIter.Next(); } // if we just added the first one we have to update the view for centering diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 2088ce591bbe..4bec5c07e8a7 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1405,7 +1405,7 @@ BOOL SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) else if( bPageVar ) ((SwRefPageGetFieldType*)pCurShell->GetFldType( 0, RES_REFPAGEGETFLD ))->UpdateFlds(); else if( TYP_GETREFFLD == rData.nTypeId ) - pFld->GetTyp()->Modify( 0, 0 ); + pFld->GetTyp()->ModifyNotification( 0, 0 ); // temporaeres Feld loeschen delete pFld; diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 265a53dc6646..fcfc0dbe22c4 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -53,6 +53,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -249,14 +250,13 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1, SwDBFieldType* pTyp = (SwDBFieldType*)pSh->InsertFldType( SwDBFieldType(pSh->GetDoc(), sColumn, aData)); - SwClientIter aIter( *pOldTyp ); + SwIterator aIter( *pOldTyp ); - for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) ); - pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() ) + for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) { if( pFmtFld->GetFld() == m_pCurFld) { - pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen + pFmtFld->RegisterToFieldType(*pTyp); pTmpFld->ChgTyp(pTyp); break; } @@ -411,9 +411,7 @@ IMPL_LINK( SwFldPage, NumFormatHdl, ListBox *, EMPTYARG ) return 0; } -/*-- 19.12.2005 14:05:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFldPage::SetWrtShell( SwWrtShell* pShell ) { m_pWrtShell = pShell; diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx index 32127f413e1a..3dd6f77e24ab 100644 --- a/sw/source/ui/lingu/sdrhhcwrap.cxx +++ b/sw/source/ui/lingu/sdrhhcwrap.cxx @@ -72,7 +72,6 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw, pView( pVw ), pTextObj( NULL ), pOutlView( NULL ), - pListIter( NULL ), nOptions( nConvOptions ), nDocIndex( 0 ), nSourceLang( nSourceLanguage ), @@ -146,51 +145,14 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument() sal_uInt16 n = nDocIndex; - while( !bNextDoc && ( pListIter || - n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() ) ) + std::list aTextObjs; + SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() ); + for ( std::list::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ ) { - while( !pTextObj && pListIter ) - { - if( pListIter->IsMore() ) - { - SdrObject* pSdrO = pListIter->Next(); - if( pSdrO && pSdrO->IsA( TYPE(SdrTextObj) ) && - ( (SdrTextObj*) pSdrO )->HasText() ) - pTextObj = (SdrTextObj*) pSdrO; - } - else - { - delete pListIter; - pListIter = NULL; - } - } - - if ( !pTextObj && - n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() ) - { - SwFrmFmt* pFly = (*pView->GetDocShell()->GetDoc()->GetSpzFrmFmts())[ n ]; - if( pFly->IsA( TYPE(SwDrawFrmFmt) ) ) - { - SwClientIter aIter( (SwFmt&) *pFly ); - if( aIter.First( TYPE(SwDrawContact) ) ) - { - SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster(); - if ( pSdrO ) - { - if ( pSdrO->IsA( TYPE(SdrObjGroup) ) ) - pListIter = new SdrObjListIter( *pSdrO, IM_DEEPNOGROUPS ); - else if( pSdrO->IsA( TYPE(SdrTextObj) ) && - ( (SdrTextObj*) pSdrO )->HasText() ) - pTextObj = (SdrTextObj*) pSdrO; - } - } - } - ++n; - } + pTextObj = (*aIt); if ( pTextObj ) { OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject(); - if ( pParaObj ) { SetPaperSize( pTextObj->GetLogicRect().GetSize() ); @@ -221,8 +183,11 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument() else SetUpdateMode(sal_False); } + if ( !bNextDoc ) pTextObj = NULL; + else + break; } } diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx index 795e357e28c3..3cb59605d40e 100644 --- a/sw/source/ui/lingu/sdrhhcwrap.hxx +++ b/sw/source/ui/lingu/sdrhhcwrap.hxx @@ -43,7 +43,6 @@ class SdrHHCWrapper : public SdrOutliner SwView* pView; SdrTextObj* pTextObj; OutlinerView* pOutlView; - SdrObjListIter* pListIter; sal_Int32 nOptions; sal_uInt16 nDocIndex; LanguageType nSourceLang; diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 3f26e47c8823..bc3842d3819a 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -81,6 +81,7 @@ #include #include +#include using namespace nsSwDocInfoSubType; @@ -377,17 +378,16 @@ void SwTextShell::ExecField(SfxRequest &rReq) if (pPostIt) { SwFieldType* pType = rSh.GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false); - SwClientIter aIter( *pType ); - SwClient* pFirst = aIter.GoStart(); - while( pFirst ) + SwIterator aIter( *pType ); + SwFmtFld* pSwFmtFld = aIter.First(); + while( pSwFmtFld ) { - SwFmtFld* pSwFmtFld = static_cast(pFirst); if ( pSwFmtFld->GetFld() == pPostIt ) { pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) ); break; } - pFirst = aIter++; + pSwFmtFld = aIter.Next(); } } } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 012fd3510bd1..a1bb9d7543cd 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -81,7 +81,7 @@ #include #include #include - +#include #include "swdtflvr.hxx" #include @@ -575,9 +575,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt(); if (pFmt) { - SwXFrame* pxFrame = (SwXFrame*)SwClientIter((SwFrmFmt&)*pFmt). - First(TYPE(SwXFrame)); - + SwXFrame* pxFrame = SwIterator::FirstElement(*pFmt); if(pxFrame) //das einzige gemeinsame interface fuer alle Frames { aRef = uno::Reference< uno::XInterface >((cppu::OWeakObject*)pxFrame, uno::UNO_QUERY); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 01f6c4e84d7a..b2fbce5ef2fd 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -544,7 +544,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) SwPageDesc* pDesc = ((SwWrtShell&)rShell).FindPageDescByName( rDescName, TRUE ); if( pDesc ) - pDesc->Add( &aPgDesc ); + aPgDesc.RegisterToPageDesc( *pDesc ); } rSet.ClearItem( SID_ATTR_PARA_MODEL ); bChanged = TRUE; @@ -557,7 +557,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) { if( ((SwFmtPageDesc*)pItem)->GetPageDesc() ) { - ((SwFmtPageDesc*)pItem)->GetPageDesc()->Add(&aPgDesc); + aPgDesc.RegisterToPageDesc( *((SwFmtPageDesc*)pItem)->GetPageDesc() ); } } } -- cgit From fd7f0b96955054e687e3e833a6560046b44967f2 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 20 Dec 2010 13:39:22 +0100 Subject: CWS swlayoutrefactoring: #i81480#: some bug fixes found in testing --- sw/inc/frmfmt.hxx | 2 +- sw/source/core/layout/atrfrm.cxx | 5 +++++ sw/source/core/unocore/unobkm.cxx | 4 ++-- sw/source/core/unocore/unoftn.cxx | 6 +++--- sw/source/core/unocore/unoidx.cxx | 8 ++++---- sw/source/core/unocore/unoobj.cxx | 4 ++-- sw/source/core/unocore/unoobj2.cxx | 16 ++++++++-------- sw/source/core/unocore/unoparagraph.cxx | 4 ++-- sw/source/core/unocore/unosect.cxx | 4 ++-- sw/source/core/unocore/unotext.cxx | 4 ++-- 10 files changed, 31 insertions(+), 26 deletions(-) diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index 26da8b872073..c25d7728e08a 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -140,7 +140,7 @@ public: { m_wXObject = xObject; } DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt) - void RegisterToFormat( SwFmt& rFmt ) { Add( &rFmt ); } + void RegisterToFormat( SwFmt& rFmt ); }; //Das FlyFrame-Format ------------------------------ diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 3f85c7fbad62..1a2e63545034 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2499,6 +2499,11 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } } +void SwFrmFmt::RegisterToFormat( SwFmt& rFmt ) +{ + rFmt.Add( this ); +} + //Vernichtet alle Frms, die in aDepend angemeldet sind. void SwFrmFmt::DelFrms() diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index b02ebbb16324..13339582181d 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -93,11 +93,11 @@ public: void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; -void SwXBookmark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXBookmark::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if (!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index c07ef6431a5a..e9c0d21b8fc9 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -101,7 +101,7 @@ public: void Invalidate(); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; @@ -122,7 +122,7 @@ void SwXFootnote::Impl::Invalidate() /* -----------------18.01.99 09:12------------------- * * --------------------------------------------------*/ -void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXFootnote::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); @@ -136,7 +136,7 @@ void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { case RES_FOOTNOTE_DELETED: if (static_cast(m_pFmtFtn) == - static_cast(pOld)->pObject) + static_cast(pOld)->pObject) { Invalidate(); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index e5c18496c4c2..46d373194eb6 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -406,14 +406,14 @@ public: } protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; /*-- 14.12.98 09:35:07--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXDocumentIndex::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); @@ -1656,7 +1656,7 @@ public: void Invalidate(); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; /* -----------------------------16.10.00 11:24-------------------------------- @@ -1684,7 +1684,7 @@ void SwXDocumentIndexMark::Impl::Invalidate() /*-- 14.12.98 10:25:47--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXDocumentIndexMark::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 2c11908044a3..e21857c755c0 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -830,11 +830,11 @@ public: } protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; -void SwXTextCursor::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextCursor::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index fc9a3df689f6..069321e2296c 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -522,11 +522,11 @@ public: uno::RuntimeException); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; -void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXParagraphEnumeration::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } @@ -793,11 +793,11 @@ public: const ::sw::mark::IMark * GetBookmark() const { return m_pMark; } protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; -void SwXTextRange::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextRange::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) { const bool bAlreadyRegistered = 0 != GetRegisteredIn(); ClientModify(this, pOld, pNew); @@ -1591,11 +1591,11 @@ public: void MakeRanges(); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; -void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextRanges::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } @@ -1774,7 +1774,7 @@ public: } protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; @@ -1783,7 +1783,7 @@ struct InvalidFrameDepend { { return !rEntry->GetRegisteredIn(); } }; -void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXParaFrameEnumeration::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if(!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 8482dab122d3..e9cb5439fe2e 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -185,14 +185,14 @@ public: throw (uno::RuntimeException); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; /*-- 11.12.98 08:12:58--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXParagraph::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew ) { ClientModify(this, pOld, pNew); if (!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index e4db4226619d..6cdd4aa0c981 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -170,14 +170,14 @@ public: uno::RuntimeException); protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; /*-- 10.12.98 14:42:52--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextSection::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); if (!GetRegisteredIn()) diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 6c35ac2a1392..bf88ce7e6fb1 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2689,14 +2689,14 @@ public: } protected: // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew); }; /*-- 11.12.98 10:14:51--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXHeadFootText::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXHeadFootText::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew) { ClientModify(this, pOld, pNew); } -- cgit From a22bffa5e7803d25ce7fa6bf55e38e4e0d932d7b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 21 Dec 2010 17:13:12 +0100 Subject: CWS swlayoutrefactoring: #i115510#: some minor fixes --- sw/inc/calbck.hxx | 2 -- sw/source/core/attr/calbck.cxx | 2 -- sw/source/core/txtnode/ndtxt.cxx | 9 ++++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index e8a33399ac8e..e144468c655d 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -183,9 +183,7 @@ public: bool IsLastDepend() { return pRoot && pRoot->IsLast(); } -#ifdef DBG_UTIL int GetClientCount() const; -#endif private: // forbidden and not implemented diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 18449844cde4..e12dbb94b221 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -318,7 +318,6 @@ SwClient* SwModify::Remove(SwClient * pDepend) return pDepend; } -#ifdef DBG_UTIL int SwModify::GetClientCount() const { int nRet=0; @@ -331,7 +330,6 @@ int SwModify::GetClientCount() const } while( 0 != ( pLast = aIter++ )); return nRet; } -#endif /*************************************************************************/ diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 0663d7bdf793..6109aaa7364e 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -509,11 +509,10 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) SwIterator aIter( *this ); for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) - { - pFrm->RegisterToNode( *pNode ); - if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && ((SwTxtFrm*)pFrm)->GetOfst() ) - ((SwTxtFrm*)pFrm)->SetOfst( 0 ); - pFrm = aIter.Next(); + { + pFrm->RegisterToNode( *pNode ); + if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && ((SwTxtFrm*)pFrm)->GetOfst() ) + ((SwTxtFrm*)pFrm)->SetOfst( 0 ); } if ( IsInCache() ) -- cgit From 3144cdca91c66439f241ba972904632900f86022 Mon Sep 17 00:00:00 2001 From: mb93783 Date: Tue, 21 Dec 2010 17:31:33 +0100 Subject: CWS swlayoutrefactoring: #i115510#: fix for gcc3.4 re-added --- sw/inc/calbck.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index e144468c655d..1f0b33f63acc 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -188,6 +188,13 @@ public: private: // forbidden and not implemented SwModify & operator= (const SwModify &); + +#ifdef GCC +protected: + // GCC >= 3.4 needs an accessible "T (const T&)" + // to pass a "T" as a "const T&" argument + // it does not require an implementation though +#endif SwModify (const SwModify &); }; -- cgit From 09d6c9a395b8849e3e09c694282a1446b786bf80 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 21 Dec 2010 19:33:34 +0100 Subject: CWS swlayoutrefactoring: #i115510#: use boost::noncopyable for SwClient; move some code from client iterations into SwClientNotify calls --- sw/inc/IDocumentLayoutAccess.hxx | 1 + sw/inc/calbck.hxx | 36 ++++++--------------- sw/inc/doc.hxx | 2 ++ sw/inc/fmtfld.hxx | 3 +- sw/inc/fmtpdsc.hxx | 4 +-- sw/inc/ftninfo.hxx | 5 +-- sw/inc/ndtxt.hxx | 8 ++--- sw/inc/numrule.hxx | 3 -- sw/inc/section.hxx | 1 - sw/inc/swcrsr.hxx | 6 +--- sw/inc/swddetbl.hxx | 3 +- sw/inc/txtinet.hxx | 3 -- sw/inc/unocrsr.hxx | 7 ----- sw/source/core/attr/calbck.cxx | 15 ++++----- sw/source/core/crsr/unocrsr.cxx | 8 ----- sw/source/core/doc/doc.cxx | 4 +-- sw/source/core/doc/docdesc.cxx | 62 ++++++++++++------------------------- sw/source/core/doc/docftn.cxx | 17 ++++++++-- sw/source/core/doc/doclay.cxx | 6 ++++ sw/source/core/docnode/ndsect.cxx | 4 +-- sw/source/core/docnode/section.cxx | 5 +-- sw/source/core/docnode/swbaslnk.cxx | 33 -------------------- sw/source/core/edit/edfld.cxx | 48 +++++----------------------- sw/source/core/fields/ddetbl.cxx | 10 +++++- sw/source/core/inc/attrhint.hxx | 44 ++++++++++++++++++++++++++ sw/source/core/inc/bookmrk.hxx | 1 - sw/source/core/inc/fieldhint.hxx | 44 ++++++++++++++++++++++++++ sw/source/core/inc/pagedeschint.hxx | 46 +++++++++++++++++++++++++++ sw/source/core/inc/prevwpage.hxx | 27 ++++++++++++++++ sw/source/core/inc/sectfrm.hxx | 2 +- sw/source/core/layout/atrfrm.cxx | 44 +++++++++++++++++++------- sw/source/core/layout/sectfrm.cxx | 10 +++--- sw/source/core/txtnode/atrfld.cxx | 25 ++++++++++++++- sw/source/core/txtnode/ndtxt.cxx | 22 +++---------- sw/source/core/unocore/unosett.cxx | 4 +-- sw/source/ui/fldui/fldmgr.cxx | 4 +-- 36 files changed, 330 insertions(+), 237 deletions(-) create mode 100644 sw/source/core/inc/attrhint.hxx create mode 100644 sw/source/core/inc/fieldhint.hxx create mode 100644 sw/source/core/inc/pagedeschint.hxx diff --git a/sw/inc/IDocumentLayoutAccess.hxx b/sw/inc/IDocumentLayoutAccess.hxx index 3dd0d67aaaba..ee04ec055f1a 100644 --- a/sw/inc/IDocumentLayoutAccess.hxx +++ b/sw/inc/IDocumentLayoutAccess.hxx @@ -49,6 +49,7 @@ public: virtual ViewShell* GetCurrentViewShell() = 0; //swmod 071107//swmod 071225 virtual const SwRootFrm* GetCurrentLayout() const = 0; virtual SwRootFrm* GetCurrentLayout() = 0; //swmod 080218 + virtual bool HasLayout() const = 0; /** !!!The old layout must be deleted!!! */ diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 1f0b33f63acc..6b4eecc3c059 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -30,10 +30,12 @@ #include #include "swdllapi.h" +#include class SwModify; class SwClientIter; class SfxPoolItem; +class SfxHint; /* SwModify and SwClient cooperate in propagating attribute changes. @@ -66,7 +68,7 @@ class SfxPoolItem; // SwClient // ---------- -class SW_DLLPUBLIC SwClient +class SW_DLLPUBLIC SwClient : ::boost::noncopyable { // avoids making the details of the linked list and the callback method public friend class SwModify; @@ -84,7 +86,7 @@ class SW_DLLPUBLIC SwClient // should be called only from SwModify the client is registered in // mba: IMHO these methods should be pure virtual virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); - virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); + virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ); protected: // single argument ctors shall be explicit. @@ -105,7 +107,8 @@ public: // controlled access to Modify method // mba: this is still considered a hack and it should be fixed; the name makes grep-ing easier - void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ); + void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { Modify ( pOldValue, pNewValue ); } + void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); } const SwModify* GetRegisteredIn() const { return pRegisteredIn; } bool IsLast() const { return !pLeft && !pRight; } @@ -115,11 +118,6 @@ public: // get information about attribute virtual BOOL GetInfo( SfxPoolItem& ) const; - -private: - // forbidden and not implemented - SwClient( const SwClient& ); - SwClient &operator=( const SwClient& ); }; inline SwClient::SwClient() : @@ -155,8 +153,8 @@ public: // also allows to limit callback to certain type (HACK) void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) ); - // placeholder for a more elaborated broadcasting mechanism; currently the nWhich is enough - void CallSwClientNotify( USHORT nWhich ); + // a more universal broadcasting mechanism + void CallSwClientNotify( const SfxHint& rHint ) const; // single argument ctors shall be explicit. explicit SwModify( SwModify *pToRegisterIn ); @@ -184,18 +182,6 @@ public: bool IsLastDepend() { return pRoot && pRoot->IsLast(); } int GetClientCount() const; - -private: - // forbidden and not implemented - SwModify & operator= (const SwModify &); - -#ifdef GCC -protected: - // GCC >= 3.4 needs an accessible "T (const T&)" - // to pass a "T" as a "const T&" argument - // it does not require an implementation though -#endif - SwModify (const SwModify &); }; // ---------- @@ -219,11 +205,7 @@ public: protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ); - -private: - // forbidden and not implemented - SwDepend (const SwDepend &); - SwDepend & operator= (const SwDepend &); + virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ); }; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index aa39873e867a..fecafe104dbf 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1007,6 +1007,8 @@ public: virtual ViewShell *GetCurrentViewShell();//swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later. virtual const SwRootFrm *GetCurrentLayout() const; virtual SwRootFrm *GetCurrentLayout();//swmod 080219 + virtual bool HasLayout() const; + /** IDocumentTimerAccess */ virtual void StartIdling(); diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 1f8be0e88f12..52777e0b8022 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -56,7 +56,8 @@ class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBro SwFmtFld& operator=(const SwFmtFld& rFld); protected: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); + virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ); public: TYPEINFO(); diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 7f23e7cd7e2f..67aa49e4acca 100644 --- a/sw/inc/fmtpdsc.hxx +++ b/sw/inc/fmtpdsc.hxx @@ -57,7 +57,8 @@ class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient SwModify* pDefinedIn; // Verweis auf das Objekt, in dem das // Attribut gesetzt wurde (CntntNode/Format) protected: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); + virtual void SwClientNotify( const SwModify&, const SfxHint& rHint ); public: SwFmtPageDesc( const SwPageDesc *pDesc = 0 ); @@ -90,7 +91,6 @@ public: void RegisterToEndNotInfo( SwEndNoteInfo& ); void RegisterToPageDesc( SwPageDesc& ); bool KnowsPageDesc() const; - bool IsRegisteredAt( SwEndNoteInfo* pInfo ) const; }; diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index 6bf1f073aa3d..064dce11bb7e 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -52,8 +52,9 @@ public: USHORT nFtnOffset; void ChgPageDesc( SwPageDesc *pDesc ); - SwPageDesc *GetPageDesc( SwDoc &rDoc ) const; - SwClient *GetPageDescDep() const { return (SwClient*)&aPageDescDep; } + SwPageDesc* GetPageDesc( SwDoc &rDoc ) const; + bool KnowsPageDesc() const; + bool DependsOn( const SwPageDesc* ) const; void SetFtnTxtColl(SwTxtFmtColl& rColl); SwTxtFmtColl* GetFtnTxtColl() const { return (SwTxtFmtColl*) GetRegisteredIn(); } // kann 0 sein diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 3fa98364e177..bcc7c48e19ab 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -44,15 +44,11 @@ #include #include - +class SfxHint; class SwNumRule; class SwNodeNum; -// --> OD 2008-05-06 #refactorlists# class SwList; -// <-- -// --> OD 2008-12-02 #i96772# class SvxLRSpaceItem; -// <-- namespace utl { class TransliterationWrapper; @@ -231,7 +227,7 @@ public: protected: // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!) virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); - virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); + virtual void SwClientNotify( const SwModify&, const SfxHint& ); public: using SwCntntNode::GetAttr; diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 99460b60b6be..c98f02823480 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -165,9 +165,6 @@ private: String msDefaultListId; // <-- - // forbidden and not implemented. - SwNumRule(); - public: // --> OD 2008-02-08 #newlistlevelattrs# // add parameter diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index f6b083dec54a..47a42dfc851d 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -161,7 +161,6 @@ public: class SW_DLLPUBLIC SwSection : public SwClient - , private ::boost::noncopyable { // damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird! friend class SwSectionNode; diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index f81f2e263b82..362763fff220 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -95,11 +95,7 @@ public: // @@@ semantic: no copy ctor. SwCursor( SwCursor& rCpy); -private: - // forbidden and not implemented. - //SwCursor( const SwCursor& ); - // @@@ used e.g. in core/frmedt/fetab.cxx @@@ - // SwCursor & operator= ( const SwCursor& ); + public: virtual SwCursor* Create( SwPaM* pRing = 0 ) const; diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx index 93d7fe578a1e..aea1c3671d03 100644 --- a/sw/inc/swddetbl.hxx +++ b/sw/inc/swddetbl.hxx @@ -48,7 +48,8 @@ public: SwDDEFieldType* GetDDEFldType(); inline const SwDDEFieldType* GetDDEFldType() const; protected: - virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); + virtual void SwClientNotify( const SwModify&, const SfxHint& ); }; diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index bec9f403c41c..a62a9d6273d9 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -42,9 +42,6 @@ class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient bool m_bVisited : 1; // visited link? bool m_bVisitedValid : 1; // is m_bVisited valid? - // forbidden and not implemented. - SwTxtINetFmt(); - protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx index 001f0eef3ab2..39e8ebbdce61 100644 --- a/sw/inc/unocrsr.hxx +++ b/sw/inc/unocrsr.hxx @@ -40,13 +40,6 @@ public: SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 ); virtual ~SwUnoCrsr(); - // @@@ semantic: no copy ctor. - SwUnoCrsr( SwUnoCrsr& ); -private: - // forbidden and not implemented. - //SwUnoCrsr( const SwUnoCrsr& ); - SwUnoCrsr & operator= ( const SwUnoCrsr& ); - protected: virtual const SwCntntFrm* DoSetBidiLevelLeftRight( diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index e12dbb94b221..b12805c9deeb 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -77,13 +77,9 @@ void SwClient::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValu CheckRegistration( pOldValue, pNewValue ); } -void SwClient::ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) +void SwClient::SwClientNotify( const SwModify&, const SfxHint& ) { - Modify( pOldValue, pNewValue ); -} -void SwClient::SwClientNotify( SwModify*, USHORT ) -{ } //************************************************************************* @@ -363,13 +359,13 @@ void SwModify::CheckCaching( const USHORT nWhich ) } } -void SwModify::CallSwClientNotify( USHORT nWhich ) +void SwModify::CallSwClientNotify( const SfxHint& rHint ) const { SwClientIter aIter(*this); SwClient * pClient = aIter.GoStart(); while (pClient) { - pClient->SwClientNotify( this, nWhich ); + pClient->SwClientNotify( *this, rHint ); pClient = aIter++; } } @@ -407,6 +403,11 @@ void SwDepend::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem *pNewValu pToTell->ModifyNotification(pOldValue, pNewValue); } +void SwDepend::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) +{ + if ( pToTell ) + pToTell->SwClientNotifyCall( rMod, rHint ); +} BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const { diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx index 065855acb49d..be83af562584 100644 --- a/sw/source/core/crsr/unocrsr.cxx +++ b/sw/source/core/crsr/unocrsr.cxx @@ -47,14 +47,6 @@ SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing ) {} -// @@@ semantic: no copy ctor. -SwUnoCrsr::SwUnoCrsr( SwUnoCrsr& rICrsr ) - : SwCursor( rICrsr ), SwModify( 0 ), - bRemainInSection( rICrsr.bRemainInSection ), - bSkipOverHiddenSections( rICrsr.bSkipOverHiddenSections ), - bSkipOverProtectSections( rICrsr.bSkipOverProtectSections ) -{} - SwUnoCrsr::~SwUnoCrsr() { SwDoc* pDoc = GetDoc(); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index c7aabee9c99f..17a53483d9b6 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -114,7 +114,7 @@ #include #include #include - +#include #include #include @@ -2664,7 +2664,7 @@ void SwDoc::ChkCondColls() { SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n]; if (RES_CONDTXTFMTCOLL == pColl->Which()) - pColl->CallSwClientNotify( RES_CONDTXTFMTCOLL ); + pColl->CallSwClientNotify( SwAttrHint(RES_CONDTXTFMTCOLL) ); } } diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index ab7cebda7304..3f3d4630d5f8 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -70,7 +70,7 @@ #include #include #include - +#include #include using namespace com::sun::star; @@ -444,48 +444,30 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) // #i7983# void SwDoc::PreDelPageDesc(SwPageDesc * pDel) { - SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 if (0 == pDel) return; - SwFmtPageDesc aDfltDesc( aPageDescs[0] ); - SwClientIter aIter( *pDel ); // TODO - SwClient* pLast; - while( 0 != ( pLast = aIter.GoStart() )) + // mba: test iteration as clients are removed while iteration + SwPageDescHint aHint( aPageDescs[0] ); + pDel->CallSwClientNotify( aHint ); + + bool bHasLayout = HasLayout(); + if ( pFtnInfo->DependsOn( pDel ) ) { - if( pLast->ISA( SwFmtPageDesc ) ) + pFtnInfo->ChgPageDesc( aPageDescs[0] ); + if ( bHasLayout ) { - const SwModify* pMod = ((SwFmtPageDesc*)pLast)->GetDefinedIn(); - if ( pMod ) - { - if( pMod->ISA( SwCntntNode ) ) - ((SwCntntNode*)pMod)->SetAttr( aDfltDesc ); - else if( pMod->ISA( SwFmt )) - ((SwFmt*)pMod)->SetFmtAttr( aDfltDesc ); - else - { - ASSERT( !this, "was ist das fuer ein Mofify-Obj?" ); - ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] ); - } - } - else //Es kann noch eine Undo-Kopie existieren - ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] ); + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), false)); } - - // mba: this code prevents us from using an SwIterator as GetPageDescDep() returns an SwClient that is an SwDepend - BOOL bFtnInf = FALSE; - if ( TRUE == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) || - pLast == pEndNoteInfo->GetPageDescDep() ) + } + else if ( pEndNoteInfo->DependsOn( pDel ) ) + { + pEndNoteInfo->ChgPageDesc( aPageDescs[0] ); + if ( bHasLayout ) { - if ( bFtnInf ) - pFtnInfo->ChgPageDesc( aPageDescs[0] ); - else - pEndNoteInfo->ChgPageDesc( aPageDescs[0] ); - if ( pTmpRoot ) - { - std::set aAllLayouts = GetAllLayouts(); - std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), !bFtnInf));//swmod 080228 - } + std::set aAllLayouts = GetAllLayouts(); + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), true)); } } @@ -494,17 +476,13 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) if ( aPageDescs[j]->GetFollow() == pDel ) { aPageDescs[j]->SetFollow( 0 ); - //Clients des PageDesc sind die Attribute, denen sagen wir bescheid. - //die Attribute wiederum reichen die Meldung an die Absaetze weiter. - - //Layot benachrichtigen! - if( pTmpRoot ) // ist nicht immer vorhanden!! (Orginizer) + if( bHasLayout ) { std::set aAllLayouts = GetAllLayouts(); std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080228 + } } } - } } // #116530# diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index ee4f10f37b9c..4c905a6c4f02 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -106,8 +106,8 @@ SwEndNoteInfo::SwEndNoteInfo(const SwEndNoteInfo& rInfo) : aFmt( rInfo.aFmt ), nFtnOffset( rInfo.nFtnOffset ) { - if( rInfo.GetPageDescDep()->GetRegisteredIn() ) - ((SwModify*)rInfo.GetPageDescDep()->GetRegisteredIn())->Add( &aPageDescDep ); + if( rInfo.aPageDescDep.GetRegisteredIn() ) + ((SwModify*)rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep ); if( rInfo.aCharFmtDep.GetRegisteredIn() ) ((SwModify*)rInfo.aCharFmtDep.GetRegisteredIn())->Add( &aCharFmtDep ); @@ -136,7 +136,18 @@ SwPageDesc *SwEndNoteInfo::GetPageDesc( SwDoc &rDoc ) const m_bEndNote ? RES_POOLPAGE_ENDNOTE : RES_POOLPAGE_FOOTNOTE ) ); pDesc->Add( &((SwClient&)aPageDescDep) ); } - return (SwPageDesc*)aPageDescDep.GetRegisteredIn(); + + return (SwPageDesc*)( aPageDescDep.GetRegisteredIn() ); +} + +bool SwEndNoteInfo::KnowsPageDesc() const +{ + return (aPageDescDep.GetRegisteredIn() != 0); +} + +bool SwEndNoteInfo::DependsOn( const SwPageDesc* pDesc ) const +{ + return ( aPageDescDep.GetRegisteredIn() == pDesc ); } void SwEndNoteInfo::ChgPageDesc( SwPageDesc *pDesc ) diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 0413ad1c82a0..c52a185e1dbe 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -2338,6 +2338,12 @@ SwRootFrm *SwDoc::GetCurrentLayout() return 0; } +bool SwDoc::HasLayout() const +{ + // if there is a view, there is always a layout + return (pCurrentView != 0); +} + std::set SwDoc::GetAllLayouts() { std::set aAllLayouts; diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index a14a4f61e4bc..229b8b7dc36f 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include #include #include #include @@ -1083,7 +1083,7 @@ SwFrm* SwClearDummies( SwFrm* pFrm ) SwSectionNode::~SwSectionNode() { // mba: test if iteration works as clients will be removed in callback - m_pSection->GetFmt()->CallSwClientNotify( RES_OBJECTDYING ); + m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) ); SwDoc* pDoc = GetDoc(); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 678a4c454f09..7479335fc535 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -66,6 +66,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -702,7 +703,7 @@ SwSectionFmt::~SwSectionFmt() } // mba: test iteration; objects are removed while iterating - CallSwClientNotify( RES_OBJECTDYING ); + CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) ); // hebe die Section doch mal auf SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() ); @@ -732,7 +733,7 @@ void SwSectionFmt::DelFrms() { // #147431# : First delete the of the instance // mba: test iteration as objects are removed in iteration - CallSwClientNotify( RES_OBJECTDYING ); + CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) ); // Then delete frames of the nested instances SwIterator aIter( *this ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 507b5b831b79..5dc653e18e63 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -409,30 +409,9 @@ BOOL SwBaseLink::SwapIn( BOOL bWaitForData, BOOL bNativFormat ) } #endif - // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293 -// TestBalloonInputStream* pTBIS = 0; -// if(!m_xInputStreamToLoadFrom.is()) { -// if ( !pCntntNode->IsGrfNode() || -// static_cast(pCntntNode)->GetGrfObj().GetType() -// != GRAPHIC_DEFAULT ) -// { -// pTBIS = new TestBalloonInputStream(); -// m_xInputStreamToLoadFrom = pTBIS; -// } -// } - // <-- - if( GetObj() ) { - // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293 -// GetObj()->setStreamToLoadFrom(m_xInputStreamToLoadFrom,m_bIsReadOnly); - // <-- String aMimeType( SotExchange::GetFormatMimeType( GetContentType() )); - -//!! ??? what have we here to do ???? -//!! if( bNativFormat ) -//!! aData.SetAspect( aData.GetAspect() | ASPECT_ICON ); - uno::Any aValue; GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData ); @@ -460,18 +439,6 @@ BOOL SwBaseLink::SwapIn( BOOL bWaitForData, BOOL bNativFormat ) bRes = Update(); bSwapIn = FALSE; - - // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293 -// if ( pTBIS && pTBIS->isTouched() ) -// { -// // --> OD 2005-04-11 #i46300# - determine correct URL for the graphic -// String sGrfNm; -// GetLinkManager()->GetDisplayNames( this, 0, &sGrfNm, 0, 0 ); -// (m_pReReadThread = new ReReadThread( -// this, sGrfNm, bWaitForData, bNativFormat))->create(); -// // <-- -// } - // <-- return bRes; } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index ffe6ada138a8..ad6e30241aaf 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -46,6 +46,7 @@ #include #include #include +#include /*-------------------------------------------------------------------- Beschreibung: Feldtypen zu einer ResId zaehlen @@ -200,46 +201,13 @@ void SwEditShell::FieldToText( SwFieldType* pType ) Push(); SwPaM* pPaM = GetCrsr(); - BOOL bDDEFld = RES_DDEFLD == pType->Which(); - // Modify-Object gefunden, trage alle Felder ins Array ein - SwClientIter aIter( *pType ); // TODO - SwClient * pLast = aIter.GoStart(); - - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do { - pPaM->DeleteMark(); - const SwFmtFld* pFmtFld = bDDEFld - ? PTR_CAST( SwFmtFld, pLast ) - : (SwFmtFld*)pLast; - - if( pFmtFld ) - { - if( !pFmtFld->GetTxtFld() ) - continue; - - // kann keine DDETabelle sein - const SwTxtNode& rTxtNode = pFmtFld->GetTxtFld()->GetTxtNode(); - pPaM->GetPoint()->nNode = rTxtNode; - pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, - *pFmtFld->GetTxtFld()->GetStart() ); - - // Feldinhalt durch Text ersetzen - String const aEntry( - pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) ); - pPaM->SetMark(); - pPaM->Move( fnMoveForward ); - GetDoc()->DeleteRange( *pPaM ); - GetDoc()->InsertString( *pPaM, aEntry ); - } - else if( bDDEFld ) - { - // DDETabelle - SwDepend* pDep = (SwDepend*)pLast; - SwDDETable* pDDETbl = (SwDDETable*)pDep->GetToTell(); - pDDETbl->NoDDETable(); - } - - } while( 0 != ( pLast = aIter++ )); + SwFieldHint aHint( pPaM ); + SwClientIter aIter( *pType ); + for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ ) + { + pPaM->DeleteMark(); + pClient->SwClientNotifyCall( *pType, aHint ); + } Pop( FALSE ); EndAllAction(); diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index f7764ed2ebca..fb9bdaaaaeb5 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -39,7 +39,7 @@ #include #include #include - +#include TYPEINIT1( SwDDETable, SwTable ); @@ -101,6 +101,14 @@ void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SwTable::Modify( pOld, pNew ); } +void SwDDETable::SwClientNotify( const SwModify&, const SfxHint& rHint ) +{ + const SwFieldHint* pHint = dynamic_cast( &rHint ); + if ( pHint ) + // replace DDETable by real table + NoDDETable(); +} + void SwDDETable::ChangeContent() { ASSERT( GetFrmFmt(), "Kein FrameFormat" ); diff --git a/sw/source/core/inc/attrhint.hxx b/sw/source/core/inc/attrhint.hxx new file mode 100644 index 000000000000..da2ed160b9c4 --- /dev/null +++ b/sw/source/core/inc/attrhint.hxx @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _ATTRHINT_HXX +#define _ATTRHINT_HXX + +#include + +class SwAttrHint : public SfxHint +{ + sal_Int32 nId; +public: + SwAttrHint( sal_Int32 n ) + : nId(n) + {} + + sal_Int32 GetId() const { return nId; } +}; + +#endif diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index e51ae5139881..9b8a0d7c3876 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -50,7 +50,6 @@ namespace sw { namespace mark { class MarkBase : virtual public IMark - , private ::boost::noncopyable { public: //getters diff --git a/sw/source/core/inc/fieldhint.hxx b/sw/source/core/inc/fieldhint.hxx new file mode 100644 index 000000000000..82955be53bc8 --- /dev/null +++ b/sw/source/core/inc/fieldhint.hxx @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _FIELDHINT_HXX +#define _FIELDHINT_HXX + +#include + +class SwFieldHint : public SfxHint +{ + SwPaM* pPaM; +public: + SwFieldHint( SwPaM* p ) + : pPaM(p) + {} + + SwPaM* GetPaM() const { return pPaM; } +}; + +#endif diff --git a/sw/source/core/inc/pagedeschint.hxx b/sw/source/core/inc/pagedeschint.hxx new file mode 100644 index 000000000000..b18ed39e3315 --- /dev/null +++ b/sw/source/core/inc/pagedeschint.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _PAGEDESCHINT_HXX +#define _PAGEDESCHINT_HXX + +#include + +class SwPageDesc; + +class SwPageDescHint : public SfxHint +{ + SwPageDesc* pPageDesc; +public: + SwPageDescHint( SwPageDesc* p ) + : pPageDesc(p) + {} + + SwPageDesc* GetPageDesc() const { return const_cast(pPageDesc); } +}; + +#endif diff --git a/sw/source/core/inc/prevwpage.hxx b/sw/source/core/inc/prevwpage.hxx index 517f4494b44f..5e9e0d752a4f 100644 --- a/sw/source/core/inc/prevwpage.hxx +++ b/sw/source/core/inc/prevwpage.hxx @@ -1,3 +1,30 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _PREVIEWPAGES_HXX #define _PREVIEWPAGES_HXX diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 0c09ca46612b..b4ecb4a9f733 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -60,7 +60,7 @@ protected: virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat ); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); - virtual void SwClientNotify( SwModify* pModify, USHORT nWhich ); + virtual void SwClientNotify( const SwModify&, const SfxHint& ); public: SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt! diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 1a2e63545034..ac9467ab66c2 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -108,7 +108,7 @@ #include #include #include -#include +#include using namespace ::com::sun::star; using ::rtl::OUString; @@ -653,21 +653,11 @@ SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc ) SwFmtPageDesc::~SwFmtPageDesc() {} -void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rFmt ) -{ - rFmt.Add(this); -} - bool SwFmtPageDesc::KnowsPageDesc() const { return (GetRegisteredIn() != 0); } -bool SwFmtPageDesc::IsRegisteredAt( SwEndNoteInfo* pInfo ) const -{ - return (pInfo->GetPageDescDep() == this); -} - int SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); @@ -681,6 +671,38 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const return new SwFmtPageDesc( *this ); } +void SwFmtPageDesc::SwClientNotify( const SwModify&, const SfxHint& rHint ) +{ + const SwPageDescHint* pHint = dynamic_cast(&rHint); + if ( pHint ) + { + // mba: shouldn't that be broadcasted also? + SwFmtPageDesc aDfltDesc( pHint->GetPageDesc() ); + SwPageDesc* pDesc = pHint->GetPageDesc(); + const SwModify* pMod = GetDefinedIn(); + if ( pMod ) + { + if( pMod->ISA( SwCntntNode ) ) + ((SwCntntNode*)pMod)->SetAttr( aDfltDesc ); + else if( pMod->ISA( SwFmt )) + ((SwFmt*)pMod)->SetFmtAttr( aDfltDesc ); + else + { + DBG_ERROR( "What kind of SwModify is this?" ); + RegisterToPageDesc( *pDesc ); + } + } + else + // there could be an Undo-copy + RegisterToPageDesc( *pDesc ); + } +} + +void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rDesc ) +{ + rDesc.Add( this ); +} + void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !pDefinedIn ) diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 32aed8691795..d5ccc299be9f 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include #include #include #include @@ -2477,13 +2477,15 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -void SwSectionFrm::SwClientNotify( SwModify*, USHORT nWhich ) +void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) { - if ( nWhich == RES_OBJECTDYING ) + const SfxSimpleHint* pSimpleHint = dynamic_cast(&rHint); + if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() ) + { SwSectionFrm::MoveCntntAndDelete( this, TRUE ); + } } - void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, BYTE &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 8d4721ff23ff..79bf770b4e16 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -43,7 +43,7 @@ #include "calc.hxx" // Update fuer UserFields #include "hints.hxx" #include - +#include #include TYPEINIT3( SwFmtFld, SfxPoolItem, SwClient,SfxBroadcaster) @@ -159,6 +159,29 @@ SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const return new SwFmtFld( *this ); } +void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint ) +{ + if( !pTxtAttr ) + return; + + const SwFieldHint* pHint = dynamic_cast( &rHint ); + if ( pHint ) + { + // replace field content by text + SwPaM* pPaM = pHint->GetPaM(); + SwDoc* pDoc = pPaM->GetDoc(); + const SwTxtNode& rTxtNode = pTxtAttr->GetTxtNode(); + pPaM->GetPoint()->nNode = rTxtNode; + pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *pTxtAttr->GetStart() ); + + String const aEntry( GetFld()->ExpandField( pDoc->IsClipBoard() ) ); + pPaM->SetMark(); + pPaM->Move( fnMoveForward ); + pDoc->DeleteRange( *pPaM ); + pDoc->InsertString( *pPaM, aEntry ); + } +} + void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( !pTxtAttr ) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 6109aaa7364e..8dc7febc9314 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -92,6 +92,7 @@ #include #include #include +#include SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 ) @@ -123,21 +124,7 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere, // --> OD 2005-11-03 #125329# // call method only for the document nodes array if ( IsDocNodes() ) - { - //if ( pColl && NO_NUMBERING != pColl->GetOutlineLevel() ) //#outline level,removed by zhaojianwei - //{ - // UpdateOutlineNode( *pNode, NO_NUMBERING, pColl->GetOutlineLevel() ); - //} -// if ( pColl && 0 != pColl->GetAttrOutlineLevel() )//#outline level,added by zhaojianwei -// { -// UpdateOutlineNode( *pNode, 0, pColl->GetAttrOutlineLevel() ); -// }//<--end -// else - { - UpdateOutlineNode(*pNode); - } - } - // <-- + UpdateOutlineNode(*pNode); //Wenn es noch kein Layout gibt oder in einer versteckten Section // stehen, brauchen wir uns um das MakeFrms nicht bemuehen. @@ -5062,9 +5049,10 @@ bool SwTxtNode::IsInContent() const return !GetDoc()->IsInHeaderFooter( SwNodeIndex(*this) ); } -void SwTxtNode::SwClientNotify( SwModify* pModify, USHORT nWhich ) +void SwTxtNode::SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) { - if ( nWhich == RES_CONDTXTFMTCOLL && pModify == GetRegisteredIn() ) + const SwAttrHint* pHint = dynamic_cast(&rHint); + if ( pHint && pHint->GetId() == RES_CONDTXTFMTCOLL && &rModify == GetRegisteredIn() ) ChkCondColl(); } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 25f40e4900e5..e72e48b4ade5 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -537,7 +537,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) case WID_PAGE_STYLE : { String aString; - if( rFtnInfo.GetPageDescDep()->GetRegisteredIn() ) + if( rFtnInfo.KnowsPageDesc() ) { SwStyleNameMapper::FillProgName( rFtnInfo.GetPageDesc( *pDoc )->GetName(), @@ -809,7 +809,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) case WID_PAGE_STYLE : { String aString; - if( rEndInfo.GetPageDescDep()->GetRegisteredIn() ) + if( rEndInfo.KnowsPageDesc() ) { SwStyleNameMapper::FillProgName( rEndInfo.GetPageDesc( *pDoc )->GetName(), diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 4bec5c07e8a7..00949e605f65 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1034,8 +1034,8 @@ BOOL SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) USHORT nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator ); sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos ); - SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType( - SwDDEFieldType( rData.sPar1, sCmd, (USHORT)nFormatId )); + SwDDEFieldType aTyp( rData.sPar1, sCmd, (USHORT)nFormatId ); + SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType( aTyp ); pFld = new SwDDEField( pTyp ); break; } -- cgit From e22a1e2f5c5ed74c22849c9b5bb59dd8f47bffbc Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 22 Dec 2010 12:45:53 +0100 Subject: CWS swlayoutrefactoring: conflict resolution after resync to DEV300_m96 --- sw/inc/frmfmt.hxx | 4 -- sw/inc/printdata.hxx | 12 +--- sw/inc/unotxdoc.hxx | 17 +---- sw/sdi/_docsh.sdi | 14 ---- sw/source/core/draw/dview.cxx | 15 ----- sw/source/core/edit/edfld.cxx | 39 ------------ sw/source/core/fields/dbfld.cxx | 4 -- sw/source/core/fields/tblcalc.cxx | 4 -- sw/source/core/frmedt/feshview.cxx | 4 -- sw/source/core/frmedt/tblsel.cxx | 3 - sw/source/core/inc/cellfrm.hxx | 8 +-- sw/source/core/inc/flyfrm.hxx | 6 -- sw/source/core/inc/frame.hxx | 6 -- sw/source/core/inc/notxtfrm.hxx | 5 -- sw/source/core/inc/txtfrm.hxx | 5 -- sw/source/core/layout/fly.cxx | 11 ++-- sw/source/core/layout/paintfrm.cxx | 20 ------ sw/source/core/txtnode/ndtxt.cxx | 8 +-- sw/source/core/unocore/unotbl.cxx | 17 ----- sw/source/core/view/vprint.cxx | 127 ------------------------------------- sw/source/ui/app/docsh2.cxx | 61 +----------------- sw/source/ui/uno/unotxdoc.cxx | 5 -- 22 files changed, 10 insertions(+), 385 deletions(-) diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index a252969a3106..178645f5ec7e 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -29,11 +29,7 @@ #include #include -<<<<<<< local -======= #include - ->>>>>>> other #include #include "swdllapi.h" diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 51cf486479ef..1e16d3d782e9 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -45,12 +45,8 @@ class _SetGetExpFlds; class SwViewOption; class OutputDevice; class SwViewOptionAdjust_Impl; -<<<<<<< local class SwPrtOptions; class ViewShell; -======= -class SwWrtShell; ->>>>>>> other class SfxViewShell; // forward declarations @@ -271,15 +267,9 @@ public: void DeletePostItData(); bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } -<<<<<<< local bool NeedNewViewOptionAdjust( const ViewShell& ) const; void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions ); - void ViewOptionAdjust( const SwPrtOptions *pPrtOptions ); -======= - bool NeedNewViewOptionAdjust( const SwWrtShell& ) const; - void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions ); - void ViewOptionAdjust( SwPrintData const*const pPrtOptions ); ->>>>>>> other + void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); void ViewOptionAdjustStop(); bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 1da33a545874..df3d700e67d6 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -129,13 +129,7 @@ class SfxViewFrame; class SwPrintUIOptions; class SwPrintData; class SwRenderData; -<<<<<<< local -class SwPrtOptions; class ViewShell; -======= -class SwWrtShell; ->>>>>>> other - typedef UnoActionContext* UnoActionContextPtr; SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4) @@ -609,17 +603,8 @@ class SwViewOptionAdjust_Impl public: SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ); ~SwViewOptionAdjust_Impl(); -<<<<<<< local - - void AdjustViewOptions( const SwPrtOptions *pPrtOptions ); - + void AdjustViewOptions( SwPrintData const* const pPrtOptions ); bool checkShell( const ViewShell& rCompare ) const -======= - - void AdjustViewOptions( SwPrintData const*const pPrtOptions ); - - bool checkShell( const SwWrtShell& rCompare ) const ->>>>>>> other { return &rCompare == &m_rShell; } }; diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index 3660722c6d4b..ad37160a3c1f 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -121,25 +121,11 @@ interface BaseTextDocument StateMethod = GetState ; ] -<<<<<<< local -======= - SID_BROWSER_MODE - [ - ExecMethod = Execute; - StateMethod = GetState; - ] - - FN_PRINT_LAYOUT - [ - ExecMethod = Execute; - StateMethod = GetState; - ] SID_MAIL_PREPAREEXPORT [ ExecMethod = Execute ; StateMethod = GetState; ] ->>>>>>> other } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index e2ac04bf7e85..207e3f0d4f68 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -1110,18 +1110,3 @@ void SwDrawView::DeleteMarked() pTmpRoot->EndAllAction(); //swmod 080218 } -<<<<<<< local -======= -/******** -JP 02.10.98: sollte als Fix fuer 57153 gelten, hatte aber Nebenwirkungen, - wie Bug 57475 -const SdrMarkList& SwDrawView::GetMarkedObjectList() const -{ - FlushComeBackTimer(); - return FmFormView::GetMarkedObjectList(); -} -*************/ - - - ->>>>>>> other diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index b200bbd8bb3f..a49f2a26af86 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -203,50 +203,11 @@ void SwEditShell::FieldToText( SwFieldType* pType ) SwFieldHint aHint( pPaM ); SwClientIter aIter( *pType ); -<<<<<<< local for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ ) { pPaM->DeleteMark(); pClient->SwClientNotifyCall( *pType, aHint ); } -======= - SwClient * pLast = aIter.GoStart(); - - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do { - pPaM->DeleteMark(); - const SwFmtFld* pFmtFld = bDDEFld - ? PTR_CAST( SwFmtFld, pLast ) - : (SwFmtFld*)pLast; - - if( pFmtFld ) - { - if( !pFmtFld->GetTxtFld() ) - continue; - - // kann keine DDETabelle sein - const SwTxtNode& rTxtNode = pFmtFld->GetTxtFld()->GetTxtNode(); - pPaM->GetPoint()->nNode = rTxtNode; - pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, - *pFmtFld->GetTxtFld()->GetStart() ); - - // Feldinhalt durch Text ersetzen - String const aEntry( pFmtFld->GetFld()->ExpandField(true) ); - pPaM->SetMark(); - pPaM->Move( fnMoveForward ); - GetDoc()->DeleteRange( *pPaM ); - GetDoc()->InsertString( *pPaM, aEntry ); - } - else if( bDDEFld ) - { - // DDETabelle - SwDepend* pDep = (SwDepend*)pLast; - SwDDETable* pDDETbl = (SwDDETable*)pDep->GetToTell(); - pDDETbl->NoDDETable(); - } - - } while( 0 != ( pLast = aIter++ )); ->>>>>>> other Pop( FALSE ); EndAllAction(); diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 166989d9d828..9a26fff02c02 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -48,11 +48,7 @@ #include #include #include -<<<<<<< local #include -======= - ->>>>>>> other using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star; diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index 51df9807599b..8c0cc509a669 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -38,10 +38,6 @@ #include #include // fuer _SetGetExpFld #include -<<<<<<< local -======= - ->>>>>>> other using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 578f638d50b3..f6492d2be4b9 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -49,12 +49,8 @@ #include #include #include -<<<<<<< local -======= - #include #include ->>>>>>> other #include // fuer InitFldTypes #include #include diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 2f8a69fffd68..36683730e760 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -54,11 +54,8 @@ #include #include #include -<<<<<<< local #include -======= #include ->>>>>>> other //siehe auch swtable.cxx #define COLFUZZY 20L diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index 11a73b370f02..86a2c1f655e1 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -48,13 +48,7 @@ public: ~SwCellFrm(); virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; -<<<<<<< local - virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; -======= - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - virtual void Paint( SwRect const&, - SwPrintData const*const pPrintData = NULL ) const; ->>>>>>> other + virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( BOOL bVert ); // --> OD 2010-02-17 #i103961# diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index b6207fe98bf4..0b957911cd8b 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -28,11 +28,8 @@ #define SW_FLYFRM_HXX #include "layfrm.hxx" -<<<<<<< local #include -======= #include "frmfmt.hxx" ->>>>>>> other class SwPageFrm; class SwFmtFrmSize; @@ -289,15 +286,12 @@ public: @author OD */ virtual bool IsFormatPossible() const; -<<<<<<< local static void GetAnchoredObjects( std::list&, const SwFmt& rFmt ); -======= // overwriting "SwFrmFmt *SwLayoutFrm::GetFmt" to provide the correct derived return type. // (This is in order to skip on the otherwise necessary casting of the result to // 'SwFlyFrmFmt *' after calls to this function. The casting is now done in this function.) virtual const SwFlyFrmFmt *GetFmt() const; virtual SwFlyFrmFmt *GetFmt(); ->>>>>>> other }; #endif diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index c4c79e7d210b..7e9a9d99c8e4 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -55,14 +55,8 @@ class SvxBrushItem; class SwSelectionList; struct SwPosition; struct SwCrsrMoveState; -<<<<<<< local -class SwPrtOptions; class SwFmt; -======= class SwPrintData; - -// --> OD 2004-07-06 #i28701# ->>>>>>> other class SwSortedObjs; class SwAnchoredObject; diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index 9a4844a65964..421584f5a827 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -56,13 +56,8 @@ public: SwNoTxtFrm( SwNoTxtNode * const, SwFrm* ); ~SwNoTxtFrm(); -<<<<<<< local - virtual void Paint(const SwRect&, const SwPrtOptions *pPrintData = NULL ) const; -======= - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; ->>>>>>> other virtual BOOL GetCharRect( SwRect &, const SwPosition&, SwCrsrMoveState* = 0) const; BOOL GetCrsrOfst(SwPosition* pPos, Point& aPoint, diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index dafdd255746e..1dbda6d0614f 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -295,13 +295,8 @@ public: void PaintExtraData( const SwRect & rRect ) const; //Seitennummer usw. SwRect Paint(); -<<<<<<< local - virtual void Paint( const SwRect &, const SwPrtOptions *pPrintData = NULL ) const; -======= virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); ->>>>>>> other virtual sal_Bool GetInfo( SfxPoolItem & ) const; //Layoutorientiertes Cursortravelling: Linker, rechter Rand, diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index bad3594ea1b5..b026bcca27a6 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2935,23 +2935,20 @@ bool SwFlyFrm::IsFormatPossible() const !IsLocked() && !IsColLocked(); } -<<<<<<< local void SwFlyFrm::GetAnchoredObjects( std::list& aList, const SwFmt& rFmt ) -======= -const SwFlyFrmFmt * SwFlyFrm::GetFmt() const ->>>>>>> other { -<<<<<<< local SwIterator aIter( rFmt ); for( SwFlyFrm* pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() ) aList.push_back( pFlyFrm ); -======= +} + +const SwFlyFrmFmt * SwFlyFrm::GetFmt() const +{ return static_cast< const SwFlyFrmFmt * >( GetDep() ); } SwFlyFrmFmt * SwFlyFrm::GetFmt() { return static_cast< SwFlyFrmFmt * >( GetDep() ); ->>>>>>> other } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 179697eb0ee2..f43cb2e0d45a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -29,11 +29,7 @@ #include "precompiled_sw.hxx" #include -<<<<<<< local #include -======= - ->>>>>>> other #include #include #define _SVSTDARR_LONGS @@ -46,19 +42,11 @@ #include #include #include -<<<<<<< local -======= -// <-- ->>>>>>> other #include #include - #include #include -<<<<<<< local #include -======= ->>>>>>> other #include #include #include @@ -93,15 +81,7 @@ #include #include #include -<<<<<<< local -======= -// OD 20.12.2002 #94627# ->>>>>>> other #include -<<<<<<< local -======= -// OD 28.02.2003 #b4779636#, #107692# ->>>>>>> other #include #include #include diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 61a15c188b47..ff7a6a20b899 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2542,20 +2542,14 @@ void SwTxtNode::NumRuleChgd() } SetInSwFntCache( FALSE ); -<<<<<<< local - - SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); - NotifyClients( &rLR, &rLR ); -======= // Sending "noop" modify in order to cause invalidations of registered // instances to get the list style change respectively the change // in the list tree reflected in the layout. // Important note: { SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); - SwModify::Modify( &rLR, &rLR ); + NotifyClients( &rLR, &rLR ); } ->>>>>>> other } // -> #i27615# diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 5ee03182a08a..ed925932e31b 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2079,24 +2079,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc) rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() ); } } -<<<<<<< local -======= -/* -----------------------------10.03.00 18:02-------------------------------- ->>>>>>> other - -<<<<<<< local -SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef ) -{ - uno::Reference xTunnel( xRef, uno::UNO_QUERY); - if(xTunnel.is()) - return reinterpret_cast< SwXTextTable * >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextTable::getUnoTunnelId()) )); - return 0; -} -======= - ---------------------------------------------------------------------------*/ ->>>>>>> other const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 4351e9286bab..b9cf9173a02c 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -369,110 +369,6 @@ void ViewShell::CalcPagesForPrint( USHORT nMax ) /******************************************************************************/ -<<<<<<< local -SwDoc * ViewShell::CreatePrtDoc( SfxObjectShellRef &rDocShellRef) -{ - ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); - SwFEShell* pFESh = (SwFEShell*)this; - // Wir bauen uns ein neues Dokument - SwDoc *pPrtDoc = new SwDoc; - pPrtDoc->acquire(); - pPrtDoc->SetRefForDocShell( (SfxObjectShellRef*)&(long&)rDocShellRef ); - pPrtDoc->LockExpFlds(); - - const SfxPoolItem* pCpyItem; - const SfxItemPool& rPool = GetAttrPool(); - for( USHORT nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh ) - if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) ) - pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem ); - - // JP 29.07.99 - Bug 67951 - set all Styles from the SourceDoc into - // the PrintDoc - will be replaced! - pPrtDoc->ReplaceStyles( *GetDoc() ); - - SwShellCrsr *pActCrsr = pFESh->_GetCrsr(); - SwShellCrsr *pFirstCrsr = dynamic_cast(pActCrsr->GetNext()); - if( !pActCrsr->HasMark() ) // bei Multiselektion kann der aktuelle Cursor leer sein - { - pActCrsr = dynamic_cast(pActCrsr->GetPrev()); - } - - Point aSelPoint; - if( pFESh->IsTableMode() ) - { - SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr(); - - const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode(); - const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0; - if( pCntntFrm ) - { - SwRect aCharRect; - SwCrsrMoveState aTmpState( MV_NONE ); - pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState ); - aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); - } - } - else - { - aSelPoint = pFirstCrsr->GetSttPos(); - } - - const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint ); - ASSERT( pPage, "no page found!" ); - - // get page descriptor - fall back to the first one if pPage could not be found - const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName( - pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 ); - - if( !pFESh->IsTableMode() && pActCrsr->HasMark() ) - { // Am letzten Absatz die Absatzattribute richten: - SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() ); - SwTxtNode* pTxtNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx )->GetTxtNode(); - SwCntntNode *pLastNd = - pActCrsr->GetCntntNode( (*pActCrsr->GetMark()) <= (*pActCrsr->GetPoint()) ); - // Hier werden die Absatzattribute des ersten Absatzes uebertragen - if( pLastNd && pLastNd->IsTxtNode() ) - ((SwTxtNode*)pLastNd)->CopyCollFmt( *pTxtNd ); - } - - // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) -// if( aDocShellRef.Is() ) -// SwDataExchange::InitOle( aDocShellRef, pPrtDoc ); - // und fuellen es mit dem selektierten Bereich - pFESh->Copy( pPrtDoc ); - - //Jetzt noch am ersten Absatz die Seitenvorlage setzen - { - SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() ); - SwCntntNode* pCNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx ); // gehe zum 1. ContentNode - if( pFESh->IsTableMode() ) - { - SwTableNode* pTNd = pCNd->FindTableNode(); - if( pTNd ) - pTNd->GetTable().GetFrmFmt()->SetFmtAttr( SwFmtPageDesc( pPageDesc ) ); - } - else - { - pCNd->SetAttr( SwFmtPageDesc( pPageDesc ) ); - if( pFirstCrsr->HasMark() ) - { - SwTxtNode *pTxtNd = pCNd->GetTxtNode(); - if( pTxtNd ) - { - SwCntntNode *pFirstNd = - pFirstCrsr->GetCntntNode( (*pFirstCrsr->GetMark()) > (*pFirstCrsr->GetPoint()) ); - // Hier werden die Absatzattribute des ersten Absatzes uebertragen - if( pFirstNd && pFirstNd->IsTxtNode() ) - ((SwTxtNode*)pFirstNd)->CopyCollFmt( *pTxtNd ); - } - } - } - } - return pPrtDoc; -} - -======= ->>>>>>> other SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) { ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only"); @@ -620,29 +516,6 @@ sal_Bool ViewShell::PrintOrPDFExport( pOutDevDoc = GetDoc(); pShell = new ViewShell( *this, 0, pOutDev ); -<<<<<<< local - // PDF export for (multi-)selection has already generated a temporary document - // with the selected text. (see XRenderable implementation in unotxdoc.cxx) - // Thus we like to go in the 'else' part here in that case. - // Is is implemented this way because PDF export calls this Prt function - // once per page and we do not like to always have the temporary document - // to be created that often here in the 'then' part. - if ( bSelection ) - { - pOutDevDoc = CreatePrtDoc( aDocShellRef ); - - // eine ViewShell darauf - pShell = new ViewShell( *pOutDevDoc, 0, pOpt, pOutDev ); - pOutDevDoc->SetRefForDocShell( 0 ); - } - else - { - pOutDevDoc = GetDoc(); - pShell = new ViewShell( *this, 0, pOutDev, VSHELLFLAG_SHARELAYOUT ); - } - -======= ->>>>>>> other SdrView *pDrawView = pShell->GetDrawView(); if (pDrawView) { diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index a66dbddcb8cf..daf610215421 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1190,63 +1190,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(FALSE, TRUE, TRUE, FALSE ); break; -<<<<<<< local - case SID_MAIL_EXPORT_FINISHED: -======= - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - BOOL bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static USHORT __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - case SID_MAIL_PREPAREEXPORT: { //pWrtShell is not set in page preview @@ -1259,8 +1202,8 @@ void SwDocShell::Execute(SfxRequest& rReq) pWrtShell->EndAllAction(); } break; - case SID_MAIL_EXPORT_FINISHED: ->>>>>>> other + + case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) pWrtShell->StartAllAction(); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index a51bf422bce3..c6cd30b8bfb4 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2735,13 +2735,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( m_pRenderData->SetSwPrtOptions( new SwPrintData ); m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); -<<<<<<< local if (pSwView) -======= - - if (pView->IsA(aSwViewTypeId)) ->>>>>>> other { // PDF export should not make use of the SwPrtOptions const SwPrintData *pPrtOptions = (bIsPDFExport) -- cgit From 0729b2664f9c9cc9926ad8d7e0820b6abf38c268 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Fri, 7 Jan 2011 13:20:38 +0100 Subject: chart51: #i106137# Formatting Toolbar - Focus doesn't switch when select an other element --- chart2/source/controller/main/ChartController_Window.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 56908ac4ef79..ab7a492c307c 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1655,7 +1655,16 @@ bool ChartController::requestQuickHelp( if ( bSuccess ) { + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + if ( m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() ) + { + this->EndTextEdit(); + } this->impl_selectObjectAndNotiy(); + if ( m_pChartWindow ) + { + m_pChartWindow->Invalidate(); + } return sal_True; } -- cgit From a5a00255b3b1d0b9736615fb2a7c2376f0584091 Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Fri, 7 Jan 2011 17:09:35 +0100 Subject: chart51:#i116352# Error: XMLShapeExport::exportShape(), exception caught --- xmloff/source/draw/shapeexport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index d3dd99967ae9..dcdbd7948149 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -711,7 +711,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) ) { if( aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape && aShapeInfo.meShapeType != XmlShapeTypePresPageShape && - aShapeInfo.meShapeType != XmlShapeTypeHandoutShape ) + aShapeInfo.meShapeType != XmlShapeTypeHandoutShape && aShapeInfo.meShapeType != XmlShapeTypeDrawChartShape ) try { -- cgit From 3ca89e01c999f957a2d7f0a8a65400965ffccb2f Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Wed, 19 Jan 2011 17:13:10 +0100 Subject: chart51: #i103864# Data labels overlining --- .../CharacterPropertyItemConverter.cxx | 67 ++++++++++++++++++++++ chart2/source/inc/CharacterProperties.hxx | 3 + chart2/source/tools/CharacterProperties.cxx | 25 ++++++++ chart2/source/view/main/PropertyMapper.cxx | 3 + 4 files changed, 98 insertions(+) diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx index 3382ae1ff085..c1f6c1a24472 100644 --- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -193,6 +193,40 @@ void CharacterPropertyItemConverter::FillSpecialItem( } break; + case EE_CHAR_OVERLINE: + { + SvxOverlineItem aItem( UNDERLINE_NONE, EE_CHAR_OVERLINE ); + bool bModified = false; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) ); + if ( aValue.hasValue() ) + { + aItem.PutValue( aValue, MID_TL_STYLE ); + bModified = true; + } + + aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) ); + if ( aValue.hasValue() && + ( *reinterpret_cast< const sal_Bool* >( aValue.getValue() ) != sal_False ) ) + { + aItem.PutValue( aValue, MID_TL_HASCOLOR ); + bModified = true; + } + + aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) ); + if ( aValue.hasValue() ) + { + aItem.PutValue( aValue, MID_TL_COLOR ); + bModified = true; + } + + if ( bModified ) + { + rOutItemSet.Put( aItem ); + } + } + break; + case EE_CHAR_ITALIC: case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: @@ -397,6 +431,39 @@ bool CharacterPropertyItemConverter::ApplySpecialItem( } break; + case EE_CHAR_OVERLINE: + { + const SvxOverlineItem& rItem = static_cast< const SvxOverlineItem & >( rItemSet.Get( nWhichId ) ); + + if ( rItem.QueryValue( aValue, MID_TL_STYLE ) ) + { + if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) ) + { + GetPropertySet()->setPropertyValue( C2U( "CharOverline" ), aValue ); + bChanged = true; + } + } + + if ( rItem.QueryValue( aValue, MID_TL_COLOR ) ) + { + if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) ) ) + { + GetPropertySet()->setPropertyValue( C2U( "CharOverlineColor" ), aValue ); + bChanged = true; + } + } + + if ( rItem.QueryValue( aValue, MID_TL_HASCOLOR ) ) + { + if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) ) ) + { + GetPropertySet()->setPropertyValue( C2U( "CharOverlineHasColor" ), aValue ); + bChanged = true; + } + } + } + break; + case EE_CHAR_ITALIC: case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx index 0742435e9bfe..676618d0bc5c 100644 --- a/chart2/source/inc/CharacterProperties.hxx +++ b/chart2/source/inc/CharacterProperties.hxx @@ -63,6 +63,9 @@ public: PROP_CHAR_UNDERLINE, PROP_CHAR_UNDERLINE_COLOR, PROP_CHAR_UNDERLINE_HAS_COLOR, + PROP_CHAR_OVERLINE, + PROP_CHAR_OVERLINE_COLOR, + PROP_CHAR_OVERLINE_HAS_COLOR, PROP_CHAR_WEIGHT, PROP_CHAR_POSTURE, PROP_CHAR_AUTO_KERNING, diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index cca655780a79..f0d310173ebb 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -161,6 +161,28 @@ void CharacterProperties::AddPropertiesToVector( ::getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT )); + // CharOverline (see awt.FontUnderline) + rOutProperties.push_back( + Property( C2U( "CharOverline" ), + PROP_CHAR_OVERLINE, + ::getCppuType( reinterpret_cast< const sal_Int16* >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ) ); + // CharOverlineColor + rOutProperties.push_back( + Property( C2U( "CharOverlineColor" ), + PROP_CHAR_OVERLINE_COLOR, + ::getCppuType( reinterpret_cast< const sal_Int32* >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID ) ); + // CharOverlineHasColor + rOutProperties.push_back( + Property( C2U( "CharOverlineHasColor" ), + PROP_CHAR_OVERLINE_HAS_COLOR, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ) ); // CharWeight (see awt.FontWeight) rOutProperties.push_back( Property( C2U( "CharWeight" ), @@ -503,6 +525,9 @@ void CharacterProperties::AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO) ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE ); + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO) + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true ); diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 1979582763fa..82f3f48ea3ae 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -244,6 +244,9 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProper ( C2U( "CharUnderline" ), C2U("CharUnderline") ) ( C2U( "CharUnderlineColor" ), C2U("CharUnderlineColor") ) ( C2U( "CharUnderlineHasColor" ), C2U("CharUnderlineHasColor") ) + ( C2U( "CharOverline" ), C2U("CharOverline") ) + ( C2U( "CharOverlineColor" ), C2U("CharOverlineColor") ) + ( C2U( "CharOverlineHasColor" ), C2U("CharOverlineHasColor") ) ( C2U( "CharWeight" ), C2U("CharWeight") ) ( C2U( "CharWeightAsian" ), C2U("CharWeightAsian") ) ( C2U( "CharWeightComplex" ), C2U("CharWeightComplex") ) -- cgit From 9bf8bf6f7ef3cc0090d7a863f81ac289deb932da Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Fri, 21 Jan 2011 15:26:21 +0100 Subject: chart51: #i116544# copy/paste error with complex series labels --- xmloff/source/chart/SchXMLExport.cxx | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e6f6fc6d9340..636eff5e24f1 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -588,24 +588,20 @@ OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) return aResult.makeStringAndClear(); } -OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xLabelSeq ) +void lcl_getLabelStringSequence( Sequence< OUString >& rOutLabels, const Reference< chart2::data::XDataSequence > & xLabelSeq ) { - Sequence< OUString > aLabels; - uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xLabelSeq, uno::UNO_QUERY ); if( xTextualDataSequence.is()) { - aLabels = xTextualDataSequence->getTextualData(); + rOutLabels = xTextualDataSequence->getTextualData(); } else if( xLabelSeq.is()) { Sequence< uno::Any > aAnies( xLabelSeq->getData()); - aLabels.realloc( aAnies.getLength()); + rOutLabels.realloc( aAnies.getLength()); for( sal_Int32 i=0; i>= aLabels[i]; + aAnies[i] >>= rOutLabels[i]; } - - return lcl_flattenStringSequence( aLabels ); } sal_Int32 lcl_getMaxSequenceLength( @@ -788,15 +784,21 @@ lcl_TableData lcl_getDataForLocalTable( Sequence< OUString > aSimpleCategories; if( xComplexDescriptionAccess.is() ) { + //categories if( bSeriesFromColumns ) + { aSimpleCategories = xComplexDescriptionAccess->getRowDescriptions(); + aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions(); + } else + { aSimpleCategories = xComplexDescriptionAccess->getColumnDescriptions(); - - aResult.aComplexColumnDescriptions = xComplexDescriptionAccess->getComplexColumnDescriptions(); - aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions(); + aResult.aComplexColumnDescriptions = xComplexDescriptionAccess->getComplexColumnDescriptions(); + } } + //series values and series labels + SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size(); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin()); SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end()); @@ -825,6 +827,7 @@ lcl_TableData lcl_getDataForLocalTable( tStringVector& rCategories = bSeriesFromColumns ? aResult.aRowDescriptions : aResult.aColumnDescriptions; tStringVector& rLabels = bSeriesFromColumns ? aResult.aColumnDescriptions : aResult.aRowDescriptions; + Sequence< Sequence< OUString > >& rComplexLabels = bSeriesFromColumns ? aResult.aComplexColumnDescriptions : aResult.aComplexRowDescriptions;//#i116544# //categories lcl_SequenceToVector( aSimpleCategories, rCategories ); @@ -844,16 +847,21 @@ lcl_TableData lcl_getDataForLocalTable( for( ; aIt != aEnd; ++aIt, ++nSeqIdx ) { OUString aRange; + Sequence< OUString >& rCurrentComplexLabel = rComplexLabels[nSeqIdx]; if( aIt->first.is()) { - rLabels[nSeqIdx] = lcl_getLabelString( aIt->first ); + lcl_getLabelStringSequence( rCurrentComplexLabel, aIt->first ); + rLabels[nSeqIdx] = lcl_flattenStringSequence( rCurrentComplexLabel ); aRange = aIt->first->getSourceRangeRepresentation(); if( xRangeConversion.is()) aRange = xRangeConversion->convertRangeToXML( aRange ); } else if( aIt->second.is()) - rLabels[nSeqIdx] = lcl_flattenStringSequence( + { + rCurrentComplexLabel.realloc(1); + rLabels[nSeqIdx] = rCurrentComplexLabel[0] = lcl_flattenStringSequence( aIt->second->generateLabel( chart2::data::LabelOrigin_SHORT_SIDE )); + } if( bSeriesFromColumns ) aResult.aColumnDescriptions_Ranges.push_back( aRange ); else -- cgit From 6457e973f502108024336f65d32be7c33d1c6865 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Feb 2011 10:20:10 +0100 Subject: debuglevels: #i116839# --- graphite/makefile.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/graphite/makefile.mk b/graphite/makefile.mk index b9ecb7aea396..3721fda49bef 100644 --- a/graphite/makefile.mk +++ b/graphite/makefile.mk @@ -71,7 +71,7 @@ VCNUM=8 # make use of stlport headerfiles EXT_USE_STLPORT=TRUE BUILD_ACTION=nmake VERBOSE=1 -.IF "$(debug)"=="true" +.IF "x$(debug)"!="x" BUILD_FLAGS= "CFG=DEBUG" CFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!) .ELSE @@ -90,7 +90,7 @@ BUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll .IF "$(COM)"=="GCC" # Does linux want --disable-shared? -.IF "$(debug)"=="true" +.IF "x$(debug)"!="x" GR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared .ELSE GR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared @@ -123,7 +123,7 @@ BUILD_DIR=$(CONFIGURE_DIR) .IF "$(OS)"=="WNT" && "$(COM)"!="GCC" #OUT2LIB=win32$/bin.msvc$/*.lib -.IF "$(debug)"=="true" +.IF "x$(debug)"!="x" OUT2LIB=engine$/debug$/*.lib .ELSE OUT2LIB=engine$/release$/*.lib @@ -141,7 +141,7 @@ OUT2LIB+=src$/.libs$/libgraphite.*.dylib .ELSE .IF "$(OS)"=="WNT" && "$(COM)"!="GCC" #OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll -.IF "$(debug)"=="true" +.IF "x$(debug)"!="x" OUT2BIN= \ # engine$/debug$/*.dll \ engine$/debug$/*.pdb -- cgit From 673f8e891f21fa015370529f3856690d517e3c22 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:44:14 +0100 Subject: debuglevels: #i116845# introduce CaptureAssertions, to forward assertions raised during Basic script execution to a user-defined function --- basic/source/classes/sbxmod.cxx | 3 + basic/source/inc/sbdiagnose.hxx | 34 ++++++++++ basic/source/runtime/makefile.mk | 3 +- basic/source/runtime/rtlproto.hxx | 1 + basic/source/runtime/sbdiagnose.cxx | 131 ++++++++++++++++++++++++++++++++++++ basic/source/runtime/stdobj.cxx | 2 + 6 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 basic/source/inc/sbdiagnose.hxx create mode 100644 basic/source/runtime/sbdiagnose.cxx diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0f807db7cf8f..51eeb61c9625 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -36,6 +36,7 @@ #include #include #include +#include "sbdiagnose.hxx" #include "sb.hxx" #include #include "sbjsmod.hxx" @@ -1180,6 +1181,8 @@ USHORT SbModule::Run( SbMethod* pMeth ) GlobalRunDeInit(); + ResetCapturedAssertions(); + // VBA always ensures screenupdating is enabled after completing if ( mbVBACompat ) VBAUnlockControllers( PTR_CAST( StarBASIC, GetParent() ) ); diff --git a/basic/source/inc/sbdiagnose.hxx b/basic/source/inc/sbdiagnose.hxx new file mode 100644 index 000000000000..065efdb183e1 --- /dev/null +++ b/basic/source/inc/sbdiagnose.hxx @@ -0,0 +1,34 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2011 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 BASIC_SBDIAGNOSE_HXX +#define BASIC_SBDIAGNOSE_HXX + +#ifdef DBG_UTIL +void ResetCapturedAssertions(); +#endif + +#endif // BASIC_SBDIAGNOSE_HXX diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk index 8ca052aaae1a..329448c67e75 100644 --- a/basic/source/runtime/makefile.mk +++ b/basic/source/runtime/makefile.mk @@ -54,7 +54,8 @@ SLOFILES= \ $(SLO)$/methods1.obj \ $(SLO)$/props.obj \ $(SLO)$/ddectrl.obj \ - $(SLO)$/dllmgr.obj + $(SLO)$/dllmgr.obj \ + $(SLO)$/sbdiagnose.obj .IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI" SLOFILES+= $(SLO)$/wnt.obj diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx index ba7af48c8472..aa5946fb304f 100644 --- a/basic/source/runtime/rtlproto.hxx +++ b/basic/source/runtime/rtlproto.hxx @@ -344,6 +344,7 @@ extern RTLFUNC(CDateToIso); extern RTLFUNC(CDateFromIso); extern RTLFUNC(CompatibilityMode); extern RTLFUNC(CDec); +extern RTLFUNC(CaptureAssertions); extern RTLFUNC(Partition); // Fong diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx new file mode 100644 index 000000000000..d779fe17e254 --- /dev/null +++ b/basic/source/runtime/sbdiagnose.cxx @@ -0,0 +1,131 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2011 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +#include "precompiled_basic.hxx" + +#include "rtlproto.hxx" +#include "sbdiagnose.hxx" + +#include "basic/sbstar.hxx" + +#include +#include + +#ifdef DBG_UTIL + +static DbgChannelId nRestoreChannelId = 0; +static DbgChannelId nAssertionChannelId = 0; +static StarBASICRef xAssertionChannelBasic; +static String sCaptureFunctionName; +static bool bReportingAssertion = false; + +void ResetCapturedAssertions() +{ + DBG_INSTOUTERROR( nRestoreChannelId != 0 ? nRestoreChannelId : DBG_OUT_NULL ); + nRestoreChannelId = 0; + xAssertionChannelBasic = NULL; + sCaptureFunctionName = String(); + bReportingAssertion = false; +} + +void DbgReportAssertion( const sal_Char* i_assertionMessage ) +{ + if ( !xAssertionChannelBasic ) + { + ResetCapturedAssertions(); + return; + } + + // prevent infinite recursion + if ( bReportingAssertion ) + return; + ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true ); + + SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) ); + SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING ); + xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) ); + xArguments->Put( xMessageText, 1 ); + + ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments ); + if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 ) + ResetCapturedAssertions(); +} + +#endif + +/// capture assertions, route them to the given given Basic function +RTLFUNC(CaptureAssertions) +{ + (void)bWrite; + + // need exactly one argument + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + +#ifdef DBG_UTIL + DBG_TESTSOLARMUTEX(); + + String const sFunctionName = rPar.Get(1)->GetString(); + if ( sFunctionName.Len() == 0 ) + { + ResetCapturedAssertions(); + return; + } + + if ( nAssertionChannelId == 0 ) + { + // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API? + // A named channel would mean it would appear in the nonpro-debug-options dialog + nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion ); + } + + DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut(); + if ( nCurrentChannelId != nAssertionChannelId ) + { + // remember the current channel + nRestoreChannelId = nCurrentChannelId; + + // set the new channel + DBG_INSTOUTERROR( nAssertionChannelId ); + + // ensure OSL assertions are captured, too + DbgData aData( *DbgGetData() ); + aData.bHookOSLAssert = TRUE; + DbgUpdateOslHook( &aData ); + } + + xAssertionChannelBasic = pBasic; + sCaptureFunctionName = sFunctionName; +#else + (void)pBasic; + (void)rPar; + (void)bWrite; +#endif +} + diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 39f92afdea4a..863c12f29288 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -147,6 +147,8 @@ static Methods aMethods[] = { { "number", SbxDOUBLE, 0,NULL,0 }, { "CreateObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateObject ),0 }, { "class", SbxSTRING, 0,NULL,0 }, +{ "CaptureAssertions", SbxNULL, 1 | _FUNCTION, RTLNAME(CaptureAssertions), 0 }, + { "methodName", SbxSTRING, 0, NULL, 0 }, { "CreateUnoListener",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 }, { "prefix", SbxSTRING, 0,NULL,0 }, { "typename", SbxSTRING, 0,NULL,0 }, -- cgit From 50d0937a706fd9c3aeebebd55e21d60499b8be20 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:58:37 +0100 Subject: debuglevels: some cleanup of the smoketest code, in preparation of #i116845# --- smoketestoo_native/data/Events.xml | 23 +++++++ smoketestoo_native/data/Global.xml | 94 ++++++++++++-------------- smoketestoo_native/data/Test_10er.xml | 120 ++++++++++++++++------------------ smoketestoo_native/data/content.xml | 87 +++++++++++++++++++++++- 4 files changed, 208 insertions(+), 116 deletions(-) diff --git a/smoketestoo_native/data/Events.xml b/smoketestoo_native/data/Events.xml index 61272293f633..414f2c48e884 100644 --- a/smoketestoo_native/data/Events.xml +++ b/smoketestoo_native/data/Events.xml @@ -28,6 +28,8 @@ REM ***** BASIC ***** +Global s_CloseListenerCalled As Boolean + Sub PressCancel gDlgState = cDlgCancel end Sub @@ -40,4 +42,25 @@ Sub PressTest gOptionsDialog.EndExecute() gDlgState = cDlgStartTest end Sub + +Sub closeListener_queryClosing + ' not interested in + closeListener_queryClosing = TRUE +End Sub + +Sub closeListener_notifyClosing + s_CloseListenerCalled = TRUE +End Sub + +Sub closeListener_disposing + ' not interested in +End Sub + +Sub ResetCloseListenerFlag + s_CloseListenerCalled = FALSE +End Sub + +Function HasCloseListenerBeenCalled As Boolean + HasCloseListenerBeenCalled = s_CloseListenerCalled +End Function diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index 1ff082b0a1eb..e80ded136725 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -35,21 +35,21 @@ const cParagraphBreak = 0 global const cExtensionFileName = "TestExtension.oxt" -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4, cDocWrite = 5 +global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 global const cLogfileFailed = 255 global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 -global const cStMessage = 12, cStHTML = 6, cStChart = 4, cStJava = 7 +global const cStHTML = 6, cStChart = 4, cStJava = 7 global const cStMath = 5, cStDataBase = 9 global const cStExtension = 11 global const cStNone = -1 global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 -global const frmWriter = 1, frmCalc = 2, frmMessage = 3, frmImpress = 4 -global const frmMath = 5, frmImage = 6, frmChart = 7, frmHyperText = 8, frmDraw = 9 +global const frmWriter = 1, frmCalc = 2, frmImpress = 4 +global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 @@ -156,31 +156,27 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableColums(3) as string - tableColums(cDocNew) = "new" - tableColums(cDocSaveOpen8) = "V8.0" - tableColums(cDocSaveOpenXML) = "XML" - tableColums(cDocSaveOpen50) = "V5.0" -' tableColums(cDocClose) = "close" + dim tableRows(4) as string + tableRows(cDocNew) = "new" + tableRows(cDocSaveOpen8) = "V8.0" + tableRows(cDocSaveOpenXML) = "XML" + tableRows(cDocSaveOpen50) = "V5.0" + tableRows(cDocClose) = "close" - aDoc = gOutPutDoc + aDoc = gOutPutDoc - xText = aDoc.Text - xCursor = xText.createTextCursor() + xText = aDoc.Text + xCursor = xText.createTextCursor() -' xCursor.gotoStart(FALSE) -' xCursor.GoRight (2, False) -' SetParagraphBreak (xCursor) -' SetParagraphBreak (xCursor) - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) + xCursor.gotoStart(FALSE) + xCursor.GoRight (4, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) - table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(7,9) + table = aDoc.createInstance("com.sun.star.text.TextTable") + table.initialize(6,9) table.Name = "StTab1" xText.insertTextContent(xCursor, table, FALSE) @@ -200,8 +196,6 @@ Sub CreateStatusTable next i% xCursor.gotoStart(FALSE) -' SetParagraphBreak (xCursor) -' SetParagraphBreak (xCursor) tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() @@ -209,11 +203,11 @@ Sub CreateStatusTable xCell.BackTransparent = False xCell.BackColor = cCoGrey - for i% = 0 to 3 + for i% = 0 to 4 tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) + xCell.String=tableRows(i%) xCell.BackTransparent = False xCell.BackColor = cCoGrey @@ -228,13 +222,13 @@ Sub CreateStatusTable2 tableHeaders(3) = "" tableHeaders(4) = "" - dim tableColums(5) as string - tableColums(cDBService ) = "services" - tableColums(cDBOpen ) = "open" - tableColums(cDBInsert ) = "insert" - tableColums(cDBDelete ) = "delete" - tableColums(cDBSeek ) = "seek" - tableColums(cDBClose ) = "close" + dim tableRows(5) as string + tableRows(cDBService ) = "services" + tableRows(cDBOpen ) = "open" + tableRows(cDBInsert ) = "insert" + tableRows(cDBDelete ) = "delete" + tableRows(cDBSeek ) = "seek" + tableRows(cDBClose ) = "close" dim tableColums2(3) as string tableColums2(cEXTService ) = "services" @@ -284,11 +278,11 @@ Sub CreateStatusTable2 for i% = 0 to 5 tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums(i%) + xCell = table.getCellByName(cName) + xCell.String=tableRows(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% tableCursor.gotoStart(FALSE) @@ -312,7 +306,7 @@ Sub CreateDocState 'table = aDoc.TextTables.GetByName ("StTab1") for j% = 0 to 7 - for i% = 0 to 5 + for i% = 0 to 4 sRangeName = GetRangeName(j%, i%+1) tableCursor = table.createCursorByCellName(sRangeName) @@ -386,23 +380,19 @@ end Sub Function GetStatusType (nDocType as Integer) as Integer Select Case ( nDocType ) case frmWriter - GetStatusType = cStWriter ' Textdokument + GetStatusType = cStWriter ' text document case frmCalc - GetStatusType = cStCalc 'Tabellendokument - case frmMessage - GetStatusType = cStMessage 'Nachricht + GetStatusType = cStCalc ' spreadsheet document case frmImpress - GetStatusType = cStPraesentation 'Präsentation + GetStatusType = cStPraesentation ' presentation case frmDraw - GetStatusType = cStZeichnen 'Zeichnen + GetStatusType = cStZeichnen ' drawing case frmMath - GetStatusType = cStMath 'Formel - case frmImage - GetStatusType = cStBild 'Bild + GetStatusType = cStMath ' formula case frmHyperText - GetStatusType = cStHTML 'Hypertext-Dokument + GetStatusType = cStHTML ' HTML document case frmChart - GetStatusType = cStChart 'Diagramm + GetStatusType = cStChart ' chart case frmJava GetStatusType = cStJava 'Java case frmDataBase diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index 56a8d130fc13..c48f564cd447 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -30,8 +30,8 @@ const sSWLogFileName = "swlog.dat", sSCLogFileName = "sclog.dat" const sSDLogFileName = "sdlog.dat", sSMathLogFileName = "smalog.dat" -const sSImDLogFileName = "simlog.dat", sSChartLogFileName = "schlog.dat" -const sSHptLogFileName = "shptlog.dat", sSMessageLogFileName = "smeslog.dat" +const sSChartLogFileName = "schlog.dat" +const sSHptLogFileName = "shptlog.dat" const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" const sLogFileName = "log.dat" @@ -107,18 +107,12 @@ Sub DeleteAllLogFiles() If FileExists (sWorkPath+sSMathLogFileName) then Kill (sWorkPath+sSMathLogFileName) End If - If FileExists (sWorkPath+sSImDLogFileName) then - Kill (sWorkPath+sSImDLogFileName) - End If If FileExists (sWorkPath+sSChartLogFileName) then Kill (sWorkPath+sSChartLogFileName) End If If FileExists (sWorkPath+sSHptLogFileName) then Kill (sWorkPath+sSHptLogFileName) End If - If FileExists (sWorkPath+sSMessageLogFileName) then - Kill (sWorkPath+sSMessageLogFileName) - End If If FileExists (sWorkPath+sSDrawLogFileName) then Kill (sWorkPath+sSDrawLogFileName) End If @@ -321,7 +315,7 @@ end Sub Sub MakeDocTest (FilterType as Integer) Dim oDoc as Object Dim sFileNameXML$, sFileName8$ - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR @@ -343,13 +337,11 @@ Sub MakeDocTest (FilterType as Integer) sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFltXML) SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML)) end if -' oDoc.dispose nCurrentAction = cDocClose - oDoc.close (true) -' bError = true ' nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) -' SetStatus (FilterType, cDocClose, bError) + bSuccess = CloseDoc( oDoc ) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) + SetStatus (FilterType, cDocClose, bSuccess) nCurrentAction = cDocSaveOpen8 if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then oDoc = LoadDoc (sFileName8) @@ -360,7 +352,6 @@ Sub MakeDocTest (FilterType as Integer) SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc)) if not IsNull (oDoc) then -' oDoc.dispose nCurrentAction = cDocClose oDoc.close (true) end If @@ -376,7 +367,6 @@ Sub MakeDocTest (FilterType as Integer) SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc)) if not IsNull (oDoc) then -' oDoc.dispose nCurrentAction = cDocClose oDoc.close (true) end If @@ -402,7 +392,7 @@ End Sub Sub MakeNewDoc (FilterType as Integer) DIM oDoc as Object - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 nCurrentAction = cLogfileFailed @@ -415,12 +405,10 @@ Sub MakeNewDoc (FilterType as Integer) SetStatus (FilterType, cDocNew, not IsNull (oDoc)) if not IsNull (oDoc) then nCurrentAction = cDocClose -' oDoc.dispose - oDoc.close (true) -' bError = true ' nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) -' LogState (bError, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) -' SetStatus (FilterType, cDocClose, bError) + bSuccess = CloseDoc( oDoc ) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) + SetStatus (FilterType, cDocClose, bSuccess) end If Print #FileChannel, "---" Close #FileChannel% @@ -445,7 +433,7 @@ Sub MakeChartTest (FilterType as Integer) Dim oRange(0) as New com.sun.star.table.CellRangeAddress Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" - Dim bError as Boolean + Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo CHARTTESTERROR nCurrentAction = cLogfileFailed @@ -455,11 +443,10 @@ Sub MakeChartTest (FilterType as Integer) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) - bError=oCharts.HasByName(cChartName) - LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, bError) -' oDoc.dispose + bSuccess=oCharts.HasByName(cChartName) + LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) + LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) + SetStatus (FilterType, cDocNew, bSuccess) nCurrentAction = cDocClose oDoc.close (true) else @@ -520,48 +507,44 @@ end Function Function GetDocFilter (DocType as Integer) as String Select Case ( DocType ) case frmWriter or cFlt8 - GetDocFilter = "writer8" ' Textdokument + GetDocFilter = "writer8" ' text document case frmCalc or cFlt8 - GetDocFilter = "calc8" 'Tabellendokument + GetDocFilter = "calc8" ' spreadsheet document case frmImpress or cFlt8 - GetDocFilter = "impress8" 'Präsentation + GetDocFilter = "impress8" ' presentation case frmDraw or cFlt8 - GetDocFilter = "draw8" 'Zeichen + GetDocFilter = "draw8" ' drawing case frmMath or cFlt8 - GetDocFilter = "math8" 'Formel + GetDocFilter = "math8" ' formula case frmWriter or cFltXML - GetDocFilter = "StarOffice XML (Writer)" ' Textdokument + GetDocFilter = "StarOffice XML (Writer)" ' text document case frmCalc or cFltXML - GetDocFilter = "StarOffice XML (Calc)" 'Tabellendokument + GetDocFilter = "StarOffice XML (Calc)" ' spreadsheet document case frmImpress or cFltXML - GetDocFilter = "StarOffice XML (Impress)" 'Präsentation + GetDocFilter = "StarOffice XML (Impress)" ' presentation case frmDraw or cFltXML - GetDocFilter = "StarOffice XML (Draw)" 'Zeichen + GetDocFilter = "StarOffice XML (Draw)" ' drawing case frmMath or cFltXML - GetDocFilter = "StarOffice XML (Math)" 'Formel + GetDocFilter = "StarOffice XML (Math)" ' formula case frmHyperText, frmHyperText or cFltXML - GetDocFilter = "HTML" 'Hypertext-Dokument + GetDocFilter = "HTML" ' HTML document case frmWriter or cFltNewDoc - GetDocFilter = "swriter" ' Textdokument + GetDocFilter = "swriter" ' text document case frmCalc or cFltNewDoc - GetDocFilter = "scalc" 'Tabellendokument - case frmMessage or cFltNewDoc - GetDocFilter = "Message" 'Nachricht + GetDocFilter = "scalc" ' spreadsheet document case frmImpress or cFltNewDoc - GetDocFilter = "simpress" 'Präsentation + GetDocFilter = "simpress" ' presentation case frmDraw or cFltNewDoc - GetDocFilter = "sdraw" 'Zeichen + GetDocFilter = "sdraw" ' drawing case frmMath or cFltNewDoc - GetDocFilter = "smath" 'Formel - case frmImage or cFltNewDoc - GetDocFilter = "simage" 'Bild + GetDocFilter = "smath" ' formula case frmHyperText or cFltNewDoc - GetDocFilter = "swriter/web" 'Hypertext-Dokument + GetDocFilter = "swriter/web" ' HTML document case frmChart or cFltNewDoc - GetDocFilter = "schart" 'Diagramm + GetDocFilter = "schart" ' chart case else GetDocFilter = "" end Select @@ -570,23 +553,19 @@ end Function Function GetLogFileName (DocType as Integer) as String Select Case ( DocType ) case frmWriter - GetLogFileName = sSWLogFileName ' Textdokument + GetLogFileName = sSWLogFileName ' text document case frmCalc - GetLogFileName = sSCLogFileName 'Tabellendokument - case frmMessage - GetLogFileName = sSMessageLogFileName 'Nachricht + GetLogFileName = sSCLogFileName ' spreadsheet document case frmImpress - GetLogFileName = sSDLogFileName 'PrÕsentation + GetLogFileName = sSDLogFileName ' presentation case frmDraw - GetLogFileName = sSDrawLogFileName 'Zeichnen + GetLogFileName = sSDrawLogFileName ' drawing case frmMath - GetLogFileName = sSMathLogFileName 'Formel - case frmImage - GetLogFileName = sSImDLogFileName 'Bild + GetLogFileName = sSMathLogFileName ' formula case frmHyperText - GetLogFileName = sSHptLogFileName 'Hypertext-Dokument + GetLogFileName = sSHptLogFileName ' HTML document case frmChart - GetLogFileName = sSChartLogFileName 'Diagramm + GetLogFileName = sSChartLogFileName ' chart case frmJava GetLogFileName = sJavaLogFileName 'Java case frmDataBase @@ -694,4 +673,19 @@ Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string ) MessageBox "Filtername is unknown!" end if end Sub + +Function CloseDoc( oDoc as Object ) + Dim oListener as Object + oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" ) + oDoc.addCloseListener( oListener ) + + Events.ResetCloseListenerFlag() + oDoc.close( true ) + closeDoc = Events.HasCloseListenerBeenCalled() + + if ( Not Events.HasCloseListenerBeenCalled() ) Then + ' do this only if closing was not successful - otherwise, we'd get a DisposedException + oDoc.removeCloseListener( oListener ) + End If +End Function diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml index dcd31b1759e4..3c81bbfbad5e 100644 --- a/smoketestoo_native/data/content.xml +++ b/smoketestoo_native/data/content.xml @@ -25,4 +25,89 @@ * for a copy of the LGPLv3 License. * **********************************************************************--> -stardiv.one.form.control.CommandButtonstardiv.one.form.control.CommandButtonstardiv.one.form.control.CommandButton + + + + + + + + + + + + + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 325b08b894be41b87f353010156ce38b9a1cfaee Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:00 +0100 Subject: debuglevels: capture assertions during the test run, let the test fail in case we encounter an assertion. Still missing: Refactor the tests so that the currently running test case ("open doc", "save doc", etc.) is known in the assertion handler, so we can mark the proper test case as "failed". Currently, the "new doc" case is marked, which is wrong. --- smoketestoo_native/data/Global.xml | 29 ++++++- smoketestoo_native/data/Test_10er.xml | 140 ++++++++++++++++------------------ smoketestoo_native/data/Test_DB.xml | 38 +++------ smoketestoo_native/data/Test_Ext.xml | 26 +++---- 4 files changed, 111 insertions(+), 122 deletions(-) diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index e80ded136725..3569343530ba 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -126,7 +126,14 @@ Sub ClearAllText call ClearStatus end Sub +Sub AssertionHandler( sMessage as String ) + LogTestResult( cDocNew, "assertion caught: " + sMessage, FALSE ) + 'TODO: get the proper test case number +End Sub + Sub Main + CaptureAssertions( "AssertionHandler" ) + call SetGlobalDoc if bShowTable then call ClearDoc (gOutPutDoc) @@ -143,6 +150,8 @@ Sub Main call CreateSecondState gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if + + CaptureAssertions( "" ) End Sub Sub CreateStatusTable @@ -362,10 +371,21 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) end Function -Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean) +Sub LogTestResult( nTestCase as Integer, sTestCaseDescription as String, bSuccess as Boolean ) + If ( nTestCase = cLogfileFailed ) Then + LogState( FALSE, "creating logfile '" + GetLogFileName( g_CurrentDocTest ) + "' failed", MainFileChannel ) + SetStatus( 0, FALSE ) + Else + LogState( bSuccess, sTestCaseDescription, FileChannel ) + LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + SetStatus( nTestCase, bSuccess ) + End If +End Sub + +Sub SetStatus( nAction as Integer, bState as Boolean ) Dim nStatusType as Integer Dim nState as integer - nStatusType = GetStatusType (nDocType) + nStatusType = GetStatusType( g_CurrentDocTest ) If nStatusType = cStNone then Exit Sub if bState then @@ -374,6 +394,11 @@ Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean) nState = cLogFalse end If + If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then + ' don't overwrite a previous "failed" state for this this + nState = cLogFalse + End If + gErrorState (nStatusType, nAction) = nState end Sub diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index c48f564cd447..b586d9ba4bd1 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -42,6 +42,8 @@ const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" const cMessageNewDoc = "New Document" const cMessageCloseDoc = "Close Document" +Global g_CurrentDocTest As Integer + Global sWorkPath$ Global sWorkPathURL$ Global FileChannel% @@ -193,34 +195,44 @@ DIM nStrPos as Long MainFileChannel = OpenLogDat (sLogFileName) call WriteTestSequence (MainFileChannel) if bMakeWriterTest then - call MakeDocTest (frmWriter) + g_CurrentDocTest = frmWriter + call MakeDocTest end if if bMakeCalcTest then - call MakeDocTest (frmCalc) + g_CurrentDocTest = frmCalc + call MakeDocTest end if if bMakeImpressTest then - call MakeDocTest (frmImpress) + g_CurrentDocTest = frmImpress + call MakeDocTest end if if bMakeDrawTest then - call MakeDocTest (frmDraw) + g_CurrentDocTest = frmDraw + call MakeDocTest end if if bMakeHTMLTest then - call MakeDocTest (frmHyperText) + g_CurrentDocTest = frmHyperText + call MakeDocTest end if if bMakeChartTest then - call MakeChartTest (frmChart) + g_CurrentDocTest = frmChart + call MakeChartTest end if if bMakeMathTest then - call MakeNewDoc (frmMath) + g_CurrentDocTest = frmMath + call MakeNewDoc end if if bMakeJavaTest then - call TestJava (frmJava) + g_CurrentDocTest = frmJava + call TestJava end if if bMakeDBTest then - call Test_DB.TestDB (frmDataBase) + g_CurrentDocTest = frmDataBase + call Test_DB.TestDB end if if bMakeExtensionTest then - call Test_Ext.TestExtensions (frmExtension) + g_CurrentDocTest = frmExtension + call Test_Ext.TestExtensions end if Close #MainFileChannel @@ -312,7 +324,7 @@ Sub WriteExtensionTests (sText as string, nFileChannel as integer) Print #nFileChannel, sWriteStr end Sub -Sub MakeDocTest (FilterType as Integer) +Sub MakeDocTest Dim oDoc as Object Dim sFileNameXML$, sFileName8$ Dim bSuccess as Boolean @@ -320,36 +332,30 @@ Sub MakeDocTest (FilterType as Integer) On Local Error GoTo DOCTESTERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(FilterType or cFltNewDoc)) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oDoc)) - if not IsNull (oDoc) then - nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(FilterType or cFlt8)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) + LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + if not IsNull (oDoc) then + nCurrentAction = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then + sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFlt8) + SaveDoc (sFileName8, oDoc, GetDocFilter(g_CurrentDocTest or cFlt8)) end if nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(FilterType or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML)) + if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then + sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFltXML) + SaveDoc (sFileNameXML, oDoc, GetDocFilter(g_CurrentDocTest or cFltXML)) end if nCurrentAction = cDocClose bSuccess = CloseDoc( oDoc ) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) - SetStatus (FilterType, cDocClose, bSuccess) + LogTestResult( cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) nCurrentAction = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then + if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, FileChannel) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, MainFileChannel) - SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc)) + LogTestResult(cDocSaveOpen8, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose @@ -358,13 +364,11 @@ Sub MakeDocTest (FilterType as Integer) end if nCurrentAction = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then + if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, FileChannel) - LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, MainFileChannel) - SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc)) + LogTestResult(cDocSaveOpenXML, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose @@ -379,36 +383,30 @@ Sub MakeDocTest (FilterType as Integer) DOCTESTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult(nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) Close #FileChannel% End If Exit Sub ' With error End Sub -Sub MakeNewDoc (FilterType as Integer) +Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDocNew -' oDoc = Documents.Add(GetDocFilter(FilterType)) - oDoc = LoadDoc ("private:factory/" + GetDocFilter(FilterType or cFltNewDoc)) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oDoc)) +' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) + LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then nCurrentAction = cDocClose bSuccess = CloseDoc( oDoc ) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType)+" "+ cMessageCloseDoc, MainFileChannel) - SetStatus (FilterType, cDocClose, bSuccess) + LogTestResult(cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If Print #FileChannel, "---" Close #FileChannel% @@ -416,43 +414,37 @@ Sub MakeNewDoc (FilterType as Integer) DOCTESTERROR2: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) Close #FileChannel% End If Exit Sub ' With error End Sub -Sub MakeChartTest (FilterType as Integer) +Sub MakeChartTest Dim oCharts as Object Dim oDoc as Object Dim oRange(0) as New com.sun.star.table.CellRangeAddress Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" - Dim bSuccess as Boolean - Dim nCurrentAction as Integer - On Local Error GoTo CHARTTESTERROR - nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) - nCurrentAction = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) + Dim bSuccess as Boolean + Dim nCurrentAction as Integer + On Local Error GoTo CHARTTESTERROR + nCurrentAction = cLogfileFailed + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + nCurrentAction = cDocNew + oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) bSuccess=oCharts.HasByName(cChartName) - LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (bSuccess, GetDocFilter(FilterType or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, bSuccess) + LogTestResult( cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) nCurrentAction = cDocClose oDoc.close (true) else - LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, MainFileChannel) - SetStatus (frmCalc, cDocNew, not IsNull (oDoc)) + LogTestResult( cDocNew, GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if Print #FileChannel, "---" Close #FileChannel% @@ -460,12 +452,10 @@ Sub MakeChartTest (FilterType as Integer) CHARTTESTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDocNew, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FileChannel) - LogState (False, GetDocFilter(FilterType or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FALSE ) Close #FileChannel% End If Exit Sub ' With error @@ -599,13 +589,11 @@ Function IsFilterAvailable (FilterType as Integer) as boolean end if End Function -Function TestJava (FilterType as Integer) as boolean +Function TestJava Dim oObj as Object - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) oObj = createUnoService(cUnoJavaLoader) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, FileChannel) - LogState (not IsNull (oObj), "Java "+ cMessageNewDoc, MainFileChannel) - SetStatus (FilterType, cDocNew, not IsNull (oObj)) + LogTestResult( cDocNew, "Java "+ cMessageNewDoc, not IsNull (oObj) ) Print #FileChannel, "---" Close #FileChannel% diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 34ade11f75fb..56e55e846c3a 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -35,7 +35,7 @@ const cMessageDatabaseDelete = "Delete record from Database" const cMessageDatabaseSeek = "Read other record from Database" const cMessageDatabaseClose = "Close Database" -Sub TestDB (FilterType as Integer) +Sub TestDB Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object Dim sDBName as String, sTable as String, sCurrentMessage as String @@ -47,7 +47,7 @@ Const sTestString = "Automatical Test" On Local Error GoTo DBERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) nCurrentAction = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext @@ -62,9 +62,7 @@ Const sTestString = "Automatical Test" sTable=oDataSource.Tables.ElementNames(0) oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - LogState (not IsNull (oDBConnection), "Database "+ cMessageDatabaseOpen, FileChannel) - LogState (not IsNull (oDBConnection), "Database "+ cMessageDatabaseOpen, MainFileChannel) - SetStatus (FilterType, cDBOpen, not IsNull (oDBConnection)) + LogTestResult( cDBOpen, "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then Close #FileChannel% Exit Sub @@ -77,14 +75,10 @@ Const sTestString = "Automatical Test" oRowSet = createUnoService(cUnoRowSet) if (IsNull(oRowSet)) then - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService + " " + cUnoRowSet, FileChannel) - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService + " " + cUnoRowSet, MainFileChannel) - SetStatus (FilterType, cDBService, not IsNull (oRowSet)) + LogTestResult( cDBService, "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) Exit Sub else - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService, FileChannel) - LogState (not IsNull (oRowSet), "Database "+ cMessageDatabaseService, MainFileChannel) - SetStatus (FilterType, cDBService, not IsNull (oRowSet)) + LogTestResult( cDBService, "Database "+ cMessageDatabaseService, TRUE ) End If nCurrentAction = cDBInsert @@ -105,9 +99,7 @@ Const sTestString = "Automatical Test" oRowSet.moveToCurrentRow() bResult = (oRowSet.getString(5) = sTestString) - LogState (bResult, "Database "+ cMessageDatabaseInsert, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseInsert, MainFileChannel) - SetStatus (FilterType, cDBInsert, bResult) + LogTestResult( cDBInsert, "Database "+ cMessageDatabaseInsert, bResult ) 'delete only if insert passed @@ -120,9 +112,7 @@ Const sTestString = "Automatical Test" oRowSet.next() bResult = (nRowCount - oRowSet.RowCount = 1) End If - LogState (bResult, "Database "+ cMessageDatabaseDelete, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseDelete, MainFileChannel) - SetStatus (FilterType, cDBDelete, bResult) + LogTestResult( cDBDelete, "Database "+ cMessageDatabaseDelete, bResult ) End If ' read other record @@ -131,16 +121,12 @@ Const sTestString = "Automatical Test" sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) - LogState (bResult, "Database "+ cMessageDatabaseSeek, FileChannel) - LogState (bResult, "Database "+ cMessageDatabaseSeek, MainFileChannel) - SetStatus (FilterType, cDBSeek, bResult) + LogTestResult( cDBSeek, "Database "+ cMessageDatabaseSeek, bResult ) nCurrentAction = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() - LogState (True, "Database "+ cMessageDatabaseClose, FileChannel) - LogState (True, "Database "+ cMessageDatabaseClose, MainFileChannel) - SetStatus (FilterType, cDBClose, True) + LogTestResult( cDBClose, "Database "+ cMessageDatabaseClose, True ) Print #FileChannel, "---" Close #FileChannel% @@ -148,12 +134,10 @@ Const sTestString = "Automatical Test" DBERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cDBOpen, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, "Database "+ sCurrentMessage, FileChannel) - LogState (False, "Database "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, "Database "+ sCurrentMessage, FALSE ) Close #FileChannel% End If Exit Sub ' With error diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 31d27dc7a4a7..534917f02eac 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -32,7 +32,7 @@ const cMessageExtensionService = "Extension Service" const cMessageExtensionInstall = "Install Extension" const cMessageExtensionUninstall = "Uninstall Extension" -Sub TestExtensions (FilterType as Integer) +Sub TestExtensions Dim oTestExtension as Object, obj_null as Object Dim sCurrentMessage as String Dim nCurrentAction as Integer @@ -43,7 +43,7 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q On Local Error GoTo EXTERROR nCurrentAction = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(FilterType)) + FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) sCurrentMessage = cMessageExtensionService nCurrentAction = cEXTService @@ -58,11 +58,9 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q ctx = getDefaultContext ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - LogState (not IsNull (ext_mgr), "Extension "+ cMessageExtensionService, FileChannel) - LogState (not IsNull (ext_mgr), "Extension "+ cMessageExtensionService, MainFileChannel) - SetStatus (FilterType, cEXTService, not IsNull (ext_mgr)) + LogTestResult( cEXTService, "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #FileChannel% + Close #FileChannel% Exit Sub End If @@ -79,11 +77,9 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q 'Check if the extension has been added by creating a service which is contained in the extension. oTestExtension = createUnoService(cUnoSmoketestTestExtension) bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogState (bResult, "Extension "+ cMessageExtensionInstall, FileChannel) - LogState (bResult, "Extension "+ cMessageExtensionInstall, MainFileChannel) - SetStatus (FilterType, cEXTInstall, bResult) + LogTestResult( cEXTInstall, "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #FileChannel% + Close #FileChannel% Exit Sub End If @@ -97,9 +93,7 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q oTestExtension = createUnoService(cUnoSmoketestTestExtension) 'The service must not be available anymore. Therefor isNull must return true. - LogState (IsNull (oTestExtension), "Extension "+ cMessageExtensionUninstall, FileChannel) - LogState (IsNull (oTestExtension), "Extension "+ cMessageExtensionUninstall, MainFileChannel) - SetStatus (FilterType, cEXTUninstall, IsNull (oTestExtension)) + LogTestResult( cEXTUninstall, "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) Print #FileChannel, "---" Close #FileChannel% @@ -107,12 +101,10 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q EXTERROR: If (nCurrentAction = cLogfileFailed) then - SetStatus (FilterType, cEXTService, False) + LogTestResult( cLogfileFailed, "", False ) Exit Sub else - LogState (False, "Extension "+ sCurrentMessage, FileChannel) - LogState (False, "Extension "+ sCurrentMessage, MainFileChannel) - SetStatus (FilterType, nCurrentAction, False) + LogTestResult( nCurrentAction, "Extension "+ sCurrentMessage, False ) Close #FileChannel% End If Exit Sub ' With error -- cgit From 2b35c388bb80f1d7739afec38dbc842240babbdd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: make the current test case a global variable, so the AssertionHandler can use it --- smoketestoo_native/data/Global.xml | 12 +++--- smoketestoo_native/data/Test_10er.xml | 77 +++++++++++++++++------------------ smoketestoo_native/data/Test_DB.xml | 47 +++++++++++---------- smoketestoo_native/data/Test_Ext.xml | 31 +++++++------- 4 files changed, 82 insertions(+), 85 deletions(-) diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index 3569343530ba..5da3617fad9b 100644 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -53,6 +53,9 @@ global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 +Global g_CurrentDocTest As Integer +Global g_CurrentTestCase As Integer + global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 'UserFieldKennungen @@ -127,8 +130,7 @@ Sub ClearAllText end Sub Sub AssertionHandler( sMessage as String ) - LogTestResult( cDocNew, "assertion caught: " + sMessage, FALSE ) - 'TODO: get the proper test case number + LogTestResult( "assertion caught: " + sMessage, FALSE ) End Sub Sub Main @@ -371,14 +373,14 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) end Function -Sub LogTestResult( nTestCase as Integer, sTestCaseDescription as String, bSuccess as Boolean ) - If ( nTestCase = cLogfileFailed ) Then +Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) + If ( g_CurrentTestCase = cLogfileFailed ) Then LogState( FALSE, "creating logfile '" + GetLogFileName( g_CurrentDocTest ) + "' failed", MainFileChannel ) SetStatus( 0, FALSE ) Else LogState( bSuccess, sTestCaseDescription, FileChannel ) LogState( bSuccess, sTestCaseDescription, MainFileChannel ) - SetStatus( nTestCase, bSuccess ) + SetStatus( g_CurrentTestCase, bSuccess ) End If End Sub diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index b586d9ba4bd1..84a8321deced 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -42,8 +42,6 @@ const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" const cMessageNewDoc = "New Document" const cMessageCloseDoc = "Close Document" -Global g_CurrentDocTest As Integer - Global sWorkPath$ Global sWorkPathURL$ Global FileChannel% @@ -328,50 +326,49 @@ Sub MakeDocTest Dim oDoc as Object Dim sFileNameXML$, sFileName8$ Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) - if not IsNull (oDoc) then - nCurrentAction = cDocSaveOpen8 + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + if not IsNull (oDoc) then + g_CurrentTestCase = cDocSaveOpen8 if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFlt8) SaveDoc (sFileName8, oDoc, GetDocFilter(g_CurrentDocTest or cFlt8)) end if - nCurrentAction = cDocSaveOpenXML + g_CurrentTestCase = cDocSaveOpenXML if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFltXML) SaveDoc (sFileNameXML, oDoc, GetDocFilter(g_CurrentDocTest or cFltXML)) end if - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - nCurrentAction = cDocSaveOpen8 + LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + g_CurrentTestCase = cDocSaveOpen8 if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogTestResult(cDocSaveOpen8, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose oDoc.close (true) end If end if - nCurrentAction = cDocSaveOpenXML + g_CurrentTestCase = cDocSaveOpenXML if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogTestResult(cDocSaveOpenXML, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose oDoc.close (true) end If end if @@ -382,11 +379,11 @@ Sub MakeDocTest Exit Sub ' Without error DOCTESTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult(nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) Close #FileChannel% End If Exit Sub ' With error @@ -395,29 +392,28 @@ End Sub Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo DOCTESTERROR2 - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = cDocNew ' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult(cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - nCurrentAction = cDocClose + g_CurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult(cDocClose, GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error DOCTESTERROR2: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), False ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) Close #FileChannel% End If Exit Sub ' With error @@ -430,32 +426,31 @@ Sub MakeChartTest Dim oRect as New com.sun.star.awt.Rectangle const cChartName="TestChart" Dim bSuccess as Boolean - Dim nCurrentAction as Integer On Local Error GoTo CHARTTESTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDocNew + g_CurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) bSuccess=oCharts.HasByName(cChartName) - LogTestResult( cDocNew, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - nCurrentAction = cDocClose + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + g_CurrentTestCase = cDocClose oDoc.close (true) else - LogTestResult( cDocNew, GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) + LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error CHARTTESTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(nCurrentAction), FALSE ) + LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), FALSE ) Close #FileChannel% End If Exit Sub ' With error @@ -591,9 +586,11 @@ End Function Function TestJava Dim oObj as Object + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - oObj = createUnoService(cUnoJavaLoader) - LogTestResult( cDocNew, "Java "+ cMessageNewDoc, not IsNull (oObj) ) + g_CurrentTestCase = cDocNew + oObj = createUnoService( cUnoJavaLoader ) + LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) Print #FileChannel, "---" Close #FileChannel% diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 56e55e846c3a..512a1abb1214 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -37,32 +37,31 @@ const cMessageDatabaseClose = "Close Database" Sub TestDB -Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object -Dim sDBName as String, sTable as String, sCurrentMessage as String -Dim nRowCount as Integer, nCurrentAction as Integer -Dim bResult as Boolean -Const sTestString = "Automatical Test" - + Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object + Dim sDBName as String, sTable as String, sCurrentMessage as String + Dim nRowCount as Integer + Dim bResult as Boolean + Const sTestString = "Automatical Test" On Local Error GoTo DBERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - nCurrentAction = cDBService + g_CurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) sDBName=oDBContext.ElementNames(0) 'Names of Databases - nCurrentAction = cDBOpen + g_CurrentTestCase = cDBOpen sCurrentMessage = cMessageDatabaseOpen oDataSource = oDBContext.GetByName(sDBName) sTable=oDataSource.Tables.ElementNames(0) oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - LogTestResult( cDBOpen, "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) + LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then Close #FileChannel% Exit Sub @@ -70,18 +69,18 @@ Const sTestString = "Automatical Test" ' Database is open now - nCurrentAction = cDBService + g_CurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet oRowSet = createUnoService(cUnoRowSet) if (IsNull(oRowSet)) then - LogTestResult( cDBService, "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) + LogTestResult( "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) Exit Sub else - LogTestResult( cDBService, "Database "+ cMessageDatabaseService, TRUE ) + LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) End If - nCurrentAction = cDBInsert + g_CurrentTestCase = cDBInsert sCurrentMessage = cMessageDatabaseInsert oRowSet.ActiveConnection = oDBConnection @@ -99,12 +98,12 @@ Const sTestString = "Automatical Test" oRowSet.moveToCurrentRow() bResult = (oRowSet.getString(5) = sTestString) - LogTestResult( cDBInsert, "Database "+ cMessageDatabaseInsert, bResult ) + LogTestResult( "Database "+ cMessageDatabaseInsert, bResult ) 'delete only if insert passed if (bResult) Then - nCurrentAction = cDBDelete + g_CurrentTestCase = cDBDelete sCurrentMessage = cMessageDatabaseDelete oRowSet.deleteRow() bResult = (nRowCount - oRowSet.RowCount = 0) @@ -112,32 +111,32 @@ Const sTestString = "Automatical Test" oRowSet.next() bResult = (nRowCount - oRowSet.RowCount = 1) End If - LogTestResult( cDBDelete, "Database "+ cMessageDatabaseDelete, bResult ) + LogTestResult( "Database "+ cMessageDatabaseDelete, bResult ) End If ' read other record - nCurrentAction = cDBSeek + g_CurrentTestCase = cDBSeek sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) - LogTestResult( cDBSeek, "Database "+ cMessageDatabaseSeek, bResult ) + LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - nCurrentAction = cDBClose + g_CurrentTestCase = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() - LogTestResult( cDBClose, "Database "+ cMessageDatabaseClose, True ) + LogTestResult( "Database "+ cMessageDatabaseClose, True ) Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error DBERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, "Database "+ sCurrentMessage, FALSE ) + LogTestResult( "Database "+ sCurrentMessage, FALSE ) Close #FileChannel% End If Exit Sub ' With error diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 534917f02eac..9d3931643658 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -33,20 +33,19 @@ const cMessageExtensionInstall = "Install Extension" const cMessageExtensionUninstall = "Uninstall Extension" Sub TestExtensions -Dim oTestExtension as Object, obj_null as Object -Dim sCurrentMessage as String -Dim nCurrentAction as Integer -Dim bResult as Boolean -Dim sImplementationNameString as String -sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" + Dim oTestExtension as Object, obj_null as Object + Dim sCurrentMessage as String + Dim bResult as Boolean + Dim sImplementationNameString as String + sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" On Local Error GoTo EXTERROR - nCurrentAction = cLogfileFailed + g_CurrentTestCase = cLogfileFailed FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) sCurrentMessage = cMessageExtensionService - nCurrentAction = cEXTService + g_CurrentTestCase = cEXTService 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for 'adding the extension. The implementation is in @@ -58,14 +57,14 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q ctx = getDefaultContext ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - LogTestResult( cEXTService, "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) + LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then Close #FileChannel% Exit Sub End If sCurrentMessage = cMessageExtensionInstall - nCurrentAction = cEXTInstall + g_CurrentTestCase = cEXTInstall 'Add the extension. We must provide a file URL here. 'By passing "user" we determine that the actions we perform on @@ -77,14 +76,14 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q 'Check if the extension has been added by creating a service which is contained in the extension. oTestExtension = createUnoService(cUnoSmoketestTestExtension) bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogTestResult( cEXTInstall, "Extension "+ cMessageExtensionInstall, bResult ) + LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then Close #FileChannel% Exit Sub End If sCurrentMessage = cMessageExtensionUninstall - nCurrentAction = cEXTUninstall + g_CurrentTestCase = cEXTUninstall 'Remove the package ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) @@ -93,18 +92,18 @@ sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension&q oTestExtension = createUnoService(cUnoSmoketestTestExtension) 'The service must not be available anymore. Therefor isNull must return true. - LogTestResult( cEXTUninstall, "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) + LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) Print #FileChannel, "---" Close #FileChannel% Exit Sub ' Without error EXTERROR: - If (nCurrentAction = cLogfileFailed) then - LogTestResult( cLogfileFailed, "", False ) + If ( g_CurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) Exit Sub else - LogTestResult( nCurrentAction, "Extension "+ sCurrentMessage, False ) + LogTestResult( "Extension "+ sCurrentMessage, False ) Close #FileChannel% End If Exit Sub ' With error -- cgit From 2af2e7681a5e6c9a5cf854741454fce8c4696afa Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: also log errors during the test's glue code (well, assertions, at least) --- smoketestoo_native/data/Global.xml | 365 ++++++++++++++++++++-------------- smoketestoo_native/data/Test_10er.xml | 178 +++++++++-------- smoketestoo_native/data/Test_DB.xml | 31 +-- smoketestoo_native/data/Test_Ext.xml | 26 ++- 4 files changed, 339 insertions(+), 261 deletions(-) mode change 100644 => 100755 smoketestoo_native/data/Global.xml diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml old mode 100644 new mode 100755 index 5da3617fad9b..a412b9d2259c --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -28,7 +28,7 @@ REM ***** BASIC ***** -const cMaxErrorStates = 13 +const cMaxErrorStates = 14 const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 const cParagraphBreak = 0 @@ -38,12 +38,14 @@ global const cExtensionFileName = "TestExtension.oxt" global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 +global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 global const cLogfileFailed = 255 global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 global const cStHTML = 6, cStChart = 4, cStJava = 7 global const cStMath = 5, cStDataBase = 9 global const cStExtension = 11 +global const cStTestGlue = 12 global const cStNone = -1 global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 @@ -52,9 +54,10 @@ global const frmWriter = 1, frmCalc = 2, frmImpress = 4 global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 +global const frmTestGlue = 15 -Global g_CurrentDocTest As Integer -Global g_CurrentTestCase As Integer +Global gCurrentDocTest As Integer +Global gCurrentTestCase As Integer global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 @@ -94,6 +97,7 @@ Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "S Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2 global gErrorState (cMaxErrorStates, 5) as integer +Global gTestCaseAnnotations( cMaxErrorStates, 5 ) As String global gOutputDoc as Object global gOutputDocNotUno as Object @@ -112,20 +116,21 @@ global sExtensionURL as string Dim gDlgState as Integer Sub SetGlobalDoc - gOutPutDoc = ThisComponent + gOutputDoc = ThisComponent end Sub Sub ClearStatus for j% = 0 to cMaxErrorStates for i% = 0 to 5 - gErrorState (j%, i%) = cLogUnknown + gErrorState (j%, i%) = cLogUnknown + gTestCaseAnnotations( J%, i% ) = "" next i% next j% end Sub Sub ClearAllText call SetGlobalDoc - call ClearDoc (gOutPutDoc) + call ClearDoc (gOutputDoc) call ClearStatus end Sub @@ -134,11 +139,18 @@ Sub AssertionHandler( sMessage as String ) End Sub Sub Main - CaptureAssertions( "AssertionHandler" ) + CaptureAssertions( "AssertionHandler" ) + + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherSetupDoc call SetGlobalDoc + + Dim bWasModified as Boolean + bWasModified = gOutputDoc.isModified() + if bShowTable then - call ClearDoc (gOutPutDoc) + call ClearDoc (gOutputDoc) end If call ClearStatus @@ -146,6 +158,8 @@ Sub Main Call Test_10er.Main if bShowTable then + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherWriteStatus call CreateStatusTable2 call CreateStatusTable call CreateDocState @@ -153,7 +167,9 @@ Sub Main gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if - CaptureAssertions( "" ) + gOutputDoc.setModified( bWasModified ) + + CaptureAssertions( "" ) End Sub Sub CreateStatusTable @@ -167,26 +183,26 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableRows(4) as string - tableRows(cDocNew) = "new" - tableRows(cDocSaveOpen8) = "V8.0" - tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocSaveOpen50) = "V5.0" - tableRows(cDocClose) = "close" + dim tableRows(4) as string + tableRows(cDocNew) = "new" + tableRows(cDocSaveOpen8) = "V8.0" + tableRows(cDocSaveOpenXML) = "XML" + tableRows(cDocSaveOpen50) = "V5.0" + tableRows(cDocClose) = "close" - aDoc = gOutPutDoc + aDoc = gOutputDoc - xText = aDoc.Text - xCursor = xText.createTextCursor() + xText = aDoc.Text + xCursor = xText.createTextCursor() - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) + xCursor.gotoStart(FALSE) + xCursor.GoRight (4, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) - table = aDoc.createInstance("com.sun.star.text.TextTable") + table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(6,9) table.Name = "StTab1" xText.insertTextContent(xCursor, table, FALSE) @@ -196,57 +212,61 @@ Sub CreateStatusTable tableCursor.goRight(1,FALSE) for i% = 0 to 7 - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableHeaders(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey - tableCursor.goRight(1,FALSE) + tableCursor.goRight(1,FALSE) next i% xCursor.gotoStart(FALSE) tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell = table.getCellByName(cName) + xCell.BackTransparent = False + xCell.BackColor = cCoGrey for i% = 0 to 4 tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableRows(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% end Sub Sub CreateStatusTable2 dim tableHeaders(5) as string - tableHeaders(cStDataBase-9) = "Database" + tableHeaders(0) = "Database" tableHeaders(1) = "" - tableHeaders(cStExtension-9) = "Extension" + tableHeaders(2) = "Extension" tableHeaders(3) = "" - tableHeaders(4) = "" + tableHeaders(4) = "Other" + + dim tableRows(5) as string + tableRows(cDBService ) = "services" + tableRows(cDBOpen ) = "open" + tableRows(cDBInsert ) = "insert" + tableRows(cDBDelete ) = "delete" + tableRows(cDBSeek ) = "seek" + tableRows(cDBClose ) = "close" - dim tableRows(5) as string - tableRows(cDBService ) = "services" - tableRows(cDBOpen ) = "open" - tableRows(cDBInsert ) = "insert" - tableRows(cDBDelete ) = "delete" - tableRows(cDBSeek ) = "seek" - tableRows(cDBClose ) = "close" + dim tableRows2(2) as string + tableRows2(cEXTService ) = "services" + tableRows2(cEXTInstall ) = "install" + tableRows2(cEXTUninstall ) = "uninstall" - dim tableColums2(3) as string - tableColums2(cEXTService ) = "services" - tableColums2(cEXTInstall ) = "install" - tableColums2(cEXTUninstall ) = "uninstall" + dim tableRows3(1) as string + tableRows3(cOtherSetupDoc ) = "setup doc" + tableRows3(cOtherWriteStatus ) = "write status" - aDoc = gOutPutDoc + aDoc = gOutputDoc xText = aDoc.Text xCursor = xText.createTextCursor() @@ -260,7 +280,7 @@ Sub CreateStatusTable2 table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(7,6) table.Name = "StTab2" - 'table.RelativeWidth =500 + table.BackColor = cCoGrey xText.insertTextContent(xCursor, table, FALSE) @@ -268,7 +288,7 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) tableCursor.goRight(1,FALSE) - for i% = 0 to 5 + for i% = LBound( tableHeaders ) to UBound( tableHeaders ) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) xCell.String=tableHeaders(i%) @@ -282,11 +302,11 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell = table.getCellByName(cName) + xCell.BackTransparent = False + xCell.BackColor = cCoGrey - for i% = 0 to 5 + for i% = LBound( tableRows ) to UBound( tableRows ) tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() xCell = table.getCellByName(cName) @@ -299,22 +319,34 @@ Sub CreateStatusTable2 tableCursor.gotoStart(FALSE) tableCursor.goRight(2,FALSE) - for i% = 0 to 3 + for i% = LBound( tableRows2 ) to UBound( tableRows2 ) tableCursor.goDown(1,FALSE) cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableColums2(i%) + xCell = table.getCellByName(cName) + xCell.String=tableRows2(i%) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + xCell.BackTransparent = False + xCell.BackColor = cCoGrey + next i% + + tableCursor.gotoStart(FALSE) + tableCursor.goRight(4,FALSE) + + for i% = LBound( tableRows3 ) to UBound( tableRows3 ) + tableCursor.goDown(1,FALSE) + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + xCell.String=tableRows3(i%) + + xCell.BackTransparent = False + xCell.BackColor = cCoGrey next i% end Sub Sub CreateDocState - aDoc = gOutPutDoc + aDoc = gOutputDoc table = aDoc.TextTables.GetByIndex (1) - 'table = aDoc.TextTables.GetByName ("StTab1") for j% = 0 to 7 for i% = 0 to 4 @@ -322,49 +354,62 @@ Sub CreateDocState tableCursor = table.createCursorByCellName(sRangeName) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - - xCell.BackTransparent = False - - if gErrorState (j%, i%) = cLogTrue then - xCell.BackColor = cCoGreen - else if gErrorState (j%, i%) = cLogFalse then - xCell.BackColor = cCoRed - else - xCell.BackColor = cCoGrey - end If - end If - + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + + xCell.BackTransparent = False + + If gErrorState (j%, i%) = cLogTrue Then + xCell.BackColor = cCoGreen + else + If gErrorState (j%, i%) = cLogFalse Then + xCell.BackColor = cCoRed + If ( gTestCaseAnnotations( j%, i% ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( j%, i% ) + xCell.insertTextContent( xCell, annotation, false ) + End If + else + xCell.BackColor = cCoGrey + end If + end If next i% next j% end Sub Sub CreateSecondState - aDoc = gOutPutDoc + aDoc = gOutputDoc table = aDoc.TextTables.GetByIndex (0) - 'table = aDoc.TextTables.GetByName ("StTab2") - for j% = 0 to cMaxErrorStates-9 - for i% = 0 to 5 - sRangeName = GetRangeName(j%, i%+1) - - tableCursor = table.createCursorByCellName(sRangeName) - - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - - xCell.BackTransparent = False - - if gErrorState (j%+9, i%) = cLogTrue then - xCell.BackColor = cCoGreen - else if gErrorState (j%+9, i%) = cLogFalse then - xCell.BackColor = cCoRed - else - xCell.BackColor = cCoGrey - end If + Dim stateIndex(2) as Integer + stateIndex(0) = cStDataBase + stateIndex(1) = cStExtension + stateIndex(2) = cStTestGlue + + Dim j as Integer + For j = LBound( stateIndex ) To UBound( stateIndex ) + for i% = 1 to 6 + tableCell = table.getCellByPosition( 2 * j + 1, i% ) + tableCell.BackTransparent = False + + if gErrorState( stateIndex(j), i% - 1 ) = cLogTrue then + tableCell.BackColor = cCoGreen + else + if gErrorState ( stateIndex(j), i% - 1 ) = cLogFalse then + tableCell.BackColor = cCoRed + If ( gTestCaseAnnotations( stateIndex(j), i% - 1 ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( stateIndex(j), i% - 1 ) + tableCell.insertTextContent( tableCell, annotation, false ) + End If + else + tableCell.BackColor = cCoGrey + end If end If - next i% next j% end Sub @@ -374,20 +419,26 @@ Function GetRangeName (nColumn as integer, nRow as integer) as string end Function Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) - If ( g_CurrentTestCase = cLogfileFailed ) Then - LogState( FALSE, "creating logfile '" + GetLogFileName( g_CurrentDocTest ) + "' failed", MainFileChannel ) - SetStatus( 0, FALSE ) + If ( gCurrentTestCase = cLogfileFailed ) Then + Dim sAnnotation as String + sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" + LogState( FALSE, sAnnotation, MainFileChannel ) + SetStatus( 0, FALSE, sAnnotation ) Else - LogState( bSuccess, sTestCaseDescription, FileChannel ) - LogState( bSuccess, sTestCaseDescription, MainFileChannel ) - SetStatus( g_CurrentTestCase, bSuccess ) + If ( LocalFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, LocalFileChannel ) + EndIf + if ( MainFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + EndIf + SetStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) End If End Sub -Sub SetStatus( nAction as Integer, bState as Boolean ) +Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) Dim nStatusType as Integer Dim nState as integer - nStatusType = GetStatusType( g_CurrentDocTest ) + nStatusType = GetStatusType( gCurrentDocTest ) If nStatusType = cStNone then Exit Sub if bState then @@ -402,6 +453,10 @@ Sub SetStatus( nAction as Integer, bState as Boolean ) End If gErrorState (nStatusType, nAction) = nState + + If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then + gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) + End If end Sub Function GetStatusType (nDocType as Integer) as Integer @@ -422,6 +477,8 @@ Function GetStatusType (nDocType as Integer) as Integer GetStatusType = cStChart ' chart case frmJava GetStatusType = cStJava 'Java + case frmTestGlue + GetStatusType = cStTestGlue ' test framework case frmDataBase GetStatusType = cStDataBase 'DataBase case frmExtension @@ -511,56 +568,56 @@ end Sub Sub SetOptions call SetGlobalDoc - SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl("cbSaveOpen50Test").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutPutDoc) - SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutPutDoc) + SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl("cbSaveOpen50Test").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc) end Sub Sub GetOptions call SetGlobalDoc - gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutPutDoc))) - gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutPutDoc))) - gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutPutDoc))) - gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutPutDoc))) - gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutPutDoc))) - gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutPutDoc))) - gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutPutDoc))) - gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutPutDoc))) - gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc))) - gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpen50Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc))) - gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc))) - gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc))) + gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutputDoc))) + gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutputDoc))) + gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutputDoc))) + gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutputDoc))) + gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutputDoc))) + gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutputDoc))) + gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutputDoc))) + gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutputDoc))) + gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc))) + gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpen50Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc))) + gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc))) End Sub Sub ReadOptions call SetGlobalDoc - bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutPutDoc) - bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutPutDoc) - bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutPutDoc) - bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutPutDoc) - bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutPutDoc) - bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutPutDoc) - bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutPutDoc) - bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutPutDoc) - bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc) - bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutPutDoc) - bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc) - bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc) - bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc) - bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc) + bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutputDoc) + bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutputDoc) + bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutputDoc) + bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutputDoc) + bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutputDoc) + bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutputDoc) + bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutputDoc) + bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutputDoc) + bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutputDoc) + bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutputDoc) + bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc) + bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc) + bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) + bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) end Sub Sub SetDefaultOptions @@ -596,8 +653,8 @@ Sub StartTestByOptions call ReadOptions call Main if bMakeTerminateAfterTest then - ClearDocFull (gOutPutDoc) - gOutPutDoc.dispose + ClearDocFull (gOutputDoc) + gOutputDoc.dispose 'StarDesktop.Terminate 'EnableReschedule( false ) diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml index 84a8321deced..a6f46b01eb78 100644 --- a/smoketestoo_native/data/Test_10er.xml +++ b/smoketestoo_native/data/Test_10er.xml @@ -34,6 +34,7 @@ const sSChartLogFileName = "schlog.dat" const sSHptLogFileName = "shptlog.dat" const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" +const sTestGlueLogFileName = "testgluelog.dat" const sLogFileName = "log.dat" const cTempFileName = "ttt" @@ -44,7 +45,7 @@ const cMessageCloseDoc = "Close Document" Global sWorkPath$ Global sWorkPathURL$ -Global FileChannel% +Global LocalFileChannel% Global MainFileChannel% Sub Main @@ -119,6 +120,9 @@ Sub DeleteAllLogFiles() If FileExists (sWorkPath+sJavaLogFileName) then Kill (sWorkPath+sJavaLogFileName) End If + If FileExists (sWorkPath+sTestGlueLogFileName) then + Kill (sWorkPath+sTestGlueLogFileName) + End If If FileExists (sWorkPath+sSDBLogFileName) then Kill (sWorkPath+sSDBLogFileName) End If @@ -182,7 +186,7 @@ DIM nStrPos as Long end if 'search ExtensionURL - sDocURL = gOutPutDoc.URL + sDocURL = gOutputDoc.URL CompatibilityMode(true) nStrPos = InStrRev (sDocURL, "/" ) CompatibilityMode(false) @@ -191,86 +195,87 @@ DIM nStrPos as Long call DeleteAllSavedFiles() call DeleteAllLogFiles() MainFileChannel = OpenLogDat (sLogFileName) - call WriteTestSequence (MainFileChannel) + call WriteTestSequence if bMakeWriterTest then - g_CurrentDocTest = frmWriter + gCurrentDocTest = frmWriter call MakeDocTest end if if bMakeCalcTest then - g_CurrentDocTest = frmCalc + gCurrentDocTest = frmCalc call MakeDocTest end if if bMakeImpressTest then - g_CurrentDocTest = frmImpress + gCurrentDocTest = frmImpress call MakeDocTest end if if bMakeDrawTest then - g_CurrentDocTest = frmDraw + gCurrentDocTest = frmDraw call MakeDocTest end if if bMakeHTMLTest then - g_CurrentDocTest = frmHyperText + gCurrentDocTest = frmHyperText call MakeDocTest end if if bMakeChartTest then - g_CurrentDocTest = frmChart + gCurrentDocTest = frmChart call MakeChartTest end if if bMakeMathTest then - g_CurrentDocTest = frmMath + gCurrentDocTest = frmMath call MakeNewDoc end if if bMakeJavaTest then - g_CurrentDocTest = frmJava + gCurrentDocTest = frmJava call TestJava end if if bMakeDBTest then - g_CurrentDocTest = frmDataBase + gCurrentDocTest = frmDataBase call Test_DB.TestDB end if if bMakeExtensionTest then - g_CurrentDocTest = frmExtension + gCurrentDocTest = frmExtension call Test_Ext.TestExtensions end if Close #MainFileChannel + MainFileChannel = 0 end Sub -Sub WriteTestSequence (FileChannel as integer) - Print #FileChannel, "Sequence of testing" +Sub WriteTestSequence + Print #MainFileChannel, "Sequence of testing" if bMakeWriterTest then - WriteTests ("writer : ", true, FileChannel) + WriteTests ("writer : ", true, MainFileChannel) end if if bMakeCalcTest then - WriteTests ("calc : ", true, FileChannel) + WriteTests ("calc : ", true, MainFileChannel) end if if bMakeImpressTest then - WriteTests ("impress : ", true, FileChannel) + WriteTests ("impress : ", true, MainFileChannel) end if if bMakeDrawTest then - WriteTests ("draw : ", true, FileChannel) + WriteTests ("draw : ", true, MainFileChannel) end if if bMakeHTMLTest then - WriteTests ("HTML : ", true, FileChannel) + WriteTests ("HTML : ", true, MainFileChannel) end if if bMakeChartTest then - WriteTests ("chart : ", false, FileChannel) + WriteTests ("chart : ", false, MainFileChannel) end if if bMakeMathTest then - WriteTests ("math : ", false, FileChannel) + WriteTests ("math : ", false, MainFileChannel) end if if bMakeJavaTest then - WriteTests ("Java : ", false, FileChannel) + WriteTests ("Java : ", false, MainFileChannel) end if if bMakeDBTest then - WriteDBTests ("Database : ", FileChannel) + WriteDBTests ("Database : ", MainFileChannel) end if if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", FileChannel) + WriteExtensionTests ("Extension : ", MainFileChannel) end if - Print #FileChannel + Print #MainFileChannel end Sub Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) @@ -328,63 +333,65 @@ Sub MakeDocTest Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(g_CurrentDocTest or cFlt8)) + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then + sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFlt8) + SaveDoc (sFileName8, oDoc, GetDocFilter(gCurrentDocTest or cFlt8)) end if - g_CurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(g_CurrentDocTest or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(g_CurrentDocTest or cFltXML)) + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then + sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFltXML) + SaveDoc (sFileNameXML, oDoc, GetDocFilter(gCurrentDocTest or cFltXML)) end if - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - g_CurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (g_CurrentDocTest or cFlt8) then + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then oDoc = LoadDoc (sFileName8) ' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if - g_CurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (g_CurrentDocTest or cFltXML) then + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then oDoc = LoadDoc (sFileNameXML) ' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose oDoc.close (true) end If end if end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DOCTESTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -393,28 +400,30 @@ Sub MakeNewDoc DIM oDoc as Object Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR2 - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew -' oDoc = Documents.Add(GetDocFilter(g_CurrentDocTest)) - oDoc = LoadDoc ("private:factory/" + GetDocFilter(g_CurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew +' oDoc = Documents.Add(GetDocFilter(gCurrentDocTest)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) if not IsNull (oDoc) then - g_CurrentTestCase = cDocClose + gCurrentTestCase = cDocClose bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(g_CurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DOCTESTERROR2: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), False ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -427,31 +436,33 @@ Sub MakeChartTest const cChartName="TestChart" Dim bSuccess as Boolean On Local Error GoTo CHARTTESTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) if not IsNull (oDoc) then oCharts = oDoc.sheets(0).Charts oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) bSuccess=oCharts.HasByName(cChartName) - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - g_CurrentTestCase = cDocClose + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + gCurrentTestCase = cDocClose oDoc.close (true) else LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error CHARTTESTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else - LogTestResult( GetDocFilter(g_CurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(g_CurrentTestCase), FALSE ) - Close #FileChannel% + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub @@ -553,6 +564,8 @@ Function GetLogFileName (DocType as Integer) as String GetLogFileName = sSChartLogFileName ' chart case frmJava GetLogFileName = sJavaLogFileName 'Java + case frmOther + GetLogFileName = sTestGlueLogFileName ' test framework case frmDataBase GetLogFileName = sSDBLogFileName 'Database case frmExtension @@ -586,14 +599,15 @@ End Function Function TestJava Dim oObj as Object - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) - g_CurrentTestCase = cDocNew + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew oObj = createUnoService( cUnoJavaLoader ) LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 TestJava = not IsNull (oObj) End Function diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml index 512a1abb1214..a9f1fc2e316d 100644 --- a/smoketestoo_native/data/Test_DB.xml +++ b/smoketestoo_native/data/Test_DB.xml @@ -45,16 +45,16 @@ Sub TestDB On Local Error GoTo DBERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - g_CurrentTestCase = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext oDBContext = CreateUnoService(cUnoDatabaseContext) sDBName=oDBContext.ElementNames(0) 'Names of Databases - g_CurrentTestCase = cDBOpen + gCurrentTestCase = cDBOpen sCurrentMessage = cMessageDatabaseOpen oDataSource = oDBContext.GetByName(sDBName) @@ -63,13 +63,14 @@ Sub TestDB LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If ' Database is open now - g_CurrentTestCase = cDBService + gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet oRowSet = createUnoService(cUnoRowSet) @@ -80,7 +81,7 @@ Sub TestDB LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) End If - g_CurrentTestCase = cDBInsert + gCurrentTestCase = cDBInsert sCurrentMessage = cMessageDatabaseInsert oRowSet.ActiveConnection = oDBConnection @@ -103,7 +104,7 @@ Sub TestDB 'delete only if insert passed if (bResult) Then - g_CurrentTestCase = cDBDelete + gCurrentTestCase = cDBDelete sCurrentMessage = cMessageDatabaseDelete oRowSet.deleteRow() bResult = (nRowCount - oRowSet.RowCount = 0) @@ -116,28 +117,30 @@ Sub TestDB ' read other record - g_CurrentTestCase = cDBSeek + gCurrentTestCase = cDBSeek sCurrentMessage = cMessageDatabaseSeek oRowSet.first() bResult = not (oRowSet.getString(5) = sTestString) LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - g_CurrentTestCase = cDBClose + gCurrentTestCase = cDBClose sCurrentMessage = cMessageDatabaseClose oDBConnection.Dispose() LogTestResult( "Database "+ cMessageDatabaseClose, True ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error DBERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else LogTestResult( "Database "+ sCurrentMessage, FALSE ) - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error End Sub diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml index 9d3931643658..735aae537596 100644 --- a/smoketestoo_native/data/Test_Ext.xml +++ b/smoketestoo_native/data/Test_Ext.xml @@ -41,11 +41,11 @@ Sub TestExtensions On Local Error GoTo EXTERROR - g_CurrentTestCase = cLogfileFailed - FileChannel% = OpenLogDat (GetLogFileName(g_CurrentDocTest)) + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) sCurrentMessage = cMessageExtensionService - g_CurrentTestCase = cEXTService + gCurrentTestCase = cEXTService 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for 'adding the extension. The implementation is in @@ -59,12 +59,13 @@ Sub TestExtensions LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If sCurrentMessage = cMessageExtensionInstall - g_CurrentTestCase = cEXTInstall + gCurrentTestCase = cEXTInstall 'Add the extension. We must provide a file URL here. 'By passing "user" we determine that the actions we perform on @@ -78,12 +79,13 @@ Sub TestExtensions bResult = (oTestExtension.getImplementationName = sImplementationNameString) LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub End If sCurrentMessage = cMessageExtensionUninstall - g_CurrentTestCase = cEXTUninstall + gCurrentTestCase = cEXTUninstall 'Remove the package ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) @@ -94,17 +96,19 @@ Sub TestExtensions 'The service must not be available anymore. Therefor isNull must return true. LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - Print #FileChannel, "---" - Close #FileChannel% + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 Exit Sub ' Without error EXTERROR: - If ( g_CurrentTestCase = cLogfileFailed ) then + If ( gCurrentTestCase = cLogfileFailed ) then LogTestResult( "", False ) Exit Sub else LogTestResult( "Extension "+ sCurrentMessage, False ) - Close #FileChannel% + Close #LocalFileChannel% + LocalFileChannel = 0 End If Exit Sub ' With error -- cgit From d4526842788adf0dcdaacc19f5c53bf9717b3d58 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: make dialog somewhat more usable --- smoketestoo_native/data/OptionsDlg.xml | 43 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml index 213c880d4d51..942500f61d71 100644 --- a/smoketestoo_native/data/OptionsDlg.xml +++ b/smoketestoo_native/data/OptionsDlg.xml @@ -28,35 +28,38 @@ - + - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + - + - + - - - - -- cgit From 77acab01ada07c352cd85383240b8281ef591064 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Feb 2011 12:59:01 +0100 Subject: debuglevels: removed the dead code and UI for binary file formats - no tests existed for this --- smoketestoo_native/data/Global.xml | 137 +++++++++++---------------------- smoketestoo_native/data/OptionsDlg.xml | 1 - 2 files changed, 43 insertions(+), 95 deletions(-) diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml index a412b9d2259c..d437eafe3457 100755 --- a/smoketestoo_native/data/Global.xml +++ b/smoketestoo_native/data/Global.xml @@ -35,7 +35,7 @@ const cParagraphBreak = 0 global const cExtensionFileName = "TestExtension.oxt" -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocSaveOpen50 = 3, cDocClose = 4 +global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 @@ -89,7 +89,7 @@ Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = &qu Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart" Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database" Global const cUserFieldTestExtension = "Extension" -Global const cUserFieldTestOpenSaveXML = "SaveOpenXML", cUserFieldTestOpenSave50 = "SaveOpen50" +Global const cUserFieldTestOpenSaveXML = "SaveOpenXML" Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8" Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard" @@ -107,7 +107,7 @@ Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest a Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean Global bMakeExtensionTest as boolean -Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean +Global bMakeSaveOpenXMLTest as boolean Global bMakeTerminateAfterTest as boolean, bShowTable as boolean Global bMakeSaveOpen8Test as boolean @@ -139,11 +139,12 @@ Sub AssertionHandler( sMessage as String ) End Sub Sub Main - CaptureAssertions( "AssertionHandler" ) - gCurrentDocTest = frmTestGlue gCurrentTestCase = cOtherSetupDoc + On Local Error Goto MainError + CaptureAssertions( "AssertionHandler" ) + call SetGlobalDoc Dim bWasModified as Boolean @@ -155,14 +156,18 @@ Sub Main call ClearStatus + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + Call Test_10er.Main + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherWriteStatus if bShowTable then - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherWriteStatus call CreateStatusTable2 call CreateStatusTable call CreateDocState + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result call CreateSecondState gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage end if @@ -170,8 +175,23 @@ Sub Main gOutputDoc.setModified( bWasModified ) CaptureAssertions( "" ) + Exit Sub + +MainError: + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) End Sub +Function GetTestGlueDescription( nTestCase as Integer ) + Select Case ( nTestCase ) + case cOtherSetupDoc + GetTestGlueDescription = "setup test document" + case cOtherWriteStatus + GetTestGlueDescription = "write test status" + case Else + GetTestGlueDescription = "" + End Select +End Function + Sub CreateStatusTable dim tableHeaders(7) as string tableHeaders(cStWriter) = "Writer" @@ -183,11 +203,10 @@ Sub CreateStatusTable tableHeaders(cStHTML) = "HTML" tableHeaders(cStJava) = "Java" - dim tableRows(4) as string + dim tableRows(3) as string tableRows(cDocNew) = "new" tableRows(cDocSaveOpen8) = "V8.0" tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocSaveOpen50) = "V5.0" tableRows(cDocClose) = "close" aDoc = gOutputDoc @@ -205,6 +224,7 @@ Sub CreateStatusTable table = aDoc.createInstance("com.sun.star.text.TextTable") table.initialize(6,9) table.Name = "StTab1" + table.BackColor = cCoGrey xText.insertTextContent(xCursor, table, FALSE) tableCursor = table.createCursorByCellName(table.CellNames(0)) @@ -212,37 +232,13 @@ Sub CreateStatusTable tableCursor.goRight(1,FALSE) for i% = 0 to 7 - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - tableCursor.goRight(1,FALSE) - next i% - - xCursor.gotoStart(FALSE) - - tableCursor.gotoStart(FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - for i% = 0 to 4 - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders( i% ) next i% end Sub Sub CreateStatusTable2 - dim tableHeaders(5) as string + dim tableHeaders(4) as string tableHeaders(0) = "Database" tableHeaders(1) = "" tableHeaders(2) = "Extension" @@ -263,8 +259,8 @@ Sub CreateStatusTable2 tableRows2(cEXTUninstall ) = "uninstall" dim tableRows3(1) as string - tableRows3(cOtherSetupDoc ) = "setup doc" - tableRows3(cOtherWriteStatus ) = "write status" + tableRows3(cOtherSetupDoc ) = "setup test" + tableRows3(cOtherWriteStatus ) = "write test result" aDoc = gOutputDoc @@ -284,62 +280,24 @@ Sub CreateStatusTable2 xText.insertTextContent(xCursor, table, FALSE) - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - for i% = LBound( tableHeaders ) to UBound( tableHeaders ) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableHeaders(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - - tableCursor.goRight(1,FALSE) + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders(i%) next i% - tableCursor.gotoStart(FALSE) - - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.BackTransparent = False - xCell.BackColor = cCoGrey - for i% = LBound( tableRows ) to UBound( tableRows ) - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) next i% - tableCursor.gotoStart(FALSE) - tableCursor.goRight(2,FALSE) - for i% = LBound( tableRows2 ) to UBound( tableRows2 ) - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows2(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( 2, i% + 1 ) + tableCell.String=tableRows2(i%) next i% - tableCursor.gotoStart(FALSE) - tableCursor.goRight(4,FALSE) - for i% = LBound( tableRows3 ) to UBound( tableRows3 ) - tableCursor.goDown(1,FALSE) - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - xCell.String=tableRows3(i%) - - xCell.BackTransparent = False - xCell.BackColor = cCoGrey + tableCell = table.getCellByPosition( 4, i% + 1 ) + tableCell.String=tableRows3(i%) next i% end Sub @@ -579,7 +537,6 @@ Sub SetOptions SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc) SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc) SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl("cbSaveOpen50Test").getState), gOutputDoc) SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc) SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc) end Sub @@ -597,7 +554,6 @@ Sub GetOptions gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc))) gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc))) gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc))) - gOptionsDialog.getControl("cbSaveOpen50Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc))) gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc))) gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc))) End Sub @@ -615,7 +571,6 @@ Sub ReadOptions bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutputDoc) bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutputDoc) bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc) - bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutputDoc) bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) end Sub @@ -639,11 +594,6 @@ Sub SetDefaultOptions End If bMakeSaveOpenXMLTest = true REM Disable StarOffice 5.0 tests in case binfilter has not been included - if Environ("WITH_BINFILTER") = "NO" then - bMakeSaveOpen50Test = false - else - bMakeSaveOpen50Test = true - End If bMakeSaveOpen8Test = true bMakeTerminateAfterTest = false end Sub @@ -678,11 +628,10 @@ Function StartTestWithDefaultOptions component(cStJava) = "Java" component(cStDataBase) = "Base" component(cStExtension) = "Extensions" - dim action(3) as string + dim action(2) as string action(cDocNew) = "new" action(cDocSaveOpen8) = "V8.0" action(cDocSaveOpenXML) = "XML" - action(cDocSaveOpen50) = "V5.0" dim baseAction(5) as string baseAction(cDBService) = "services" baseAction(cDBOpen) = "open" diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml index 942500f61d71..c03026185886 100644 --- a/smoketestoo_native/data/OptionsDlg.xml +++ b/smoketestoo_native/data/OptionsDlg.xml @@ -47,7 +47,6 @@ - -- cgit From 9592c3b711e572baf0e426460b0fb295686c7d21 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:21:59 +0100 Subject: debuglevels: ResetCapturedAssertions not available in product build --- basic/source/classes/sbxmod.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 51eeb61c9625..0cc06f263057 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1181,7 +1181,9 @@ USHORT SbModule::Run( SbMethod* pMeth ) GlobalRunDeInit(); +#ifdef DBG_UTIL ResetCapturedAssertions(); +#endif // VBA always ensures screenupdating is enabled after completing if ( mbVBACompat ) -- cgit From 5bf017167656d80386f2078feef6e33ba9cb65a9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 8 Feb 2011 17:04:14 +0100 Subject: sw34bf03: #i116555#: PropertyActionsOOo.cxx: ignore fo:wrap-option (transplanted from e392ccc02819bb6bb3b290c3a81bb23ea9e01d11) --- xmloff/source/transform/PropertyActionsOOo.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx b/xmloff/source/transform/PropertyActionsOOo.cxx index bc91561de206..e0b9259787eb 100644 --- a/xmloff/source/transform/PropertyActionsOOo.cxx +++ b/xmloff/source/transform/PropertyActionsOOo.cxx @@ -649,6 +649,8 @@ XMLTransformerActionInit aTextPropertyOOoAttrActionTable[] = NO_PARAMS }, /* #i113645# */ { XML_NAMESPACE_STYLE, XML_TEXT_OVERLINE_COLOR, XML_ATACTION_REMOVE, NO_PARAMS }, /* #i113645# */ + { XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_ATACTION_REMOVE, + NO_PARAMS }, /* #i116555# */ { XML_NAMESPACE_OFFICE, XML_TOKEN_INVALID, XML_ATACTION_EOT, NO_PARAMS } }; -- cgit From 749c27fafbe1e57b7ba25f759272c02de20469e0 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 9 Feb 2011 15:55:27 +0100 Subject: CWS swlayoutrefactoring: fix merge conflicts --- sw/inc/calbck.hxx | 71 +- sw/inc/crsrsh.hxx | 5 - sw/inc/docsh.hxx | 6 +- sw/inc/docufld.hxx | 8 - sw/inc/expfld.hxx | 12 +- sw/inc/fchrfmt.hxx | 6 - sw/inc/fmtfld.hxx | 10 - sw/inc/fmthdft.hxx | 15 - sw/inc/format.hxx | 5 - sw/inc/reffld.hxx | 11 +- sw/inc/swcrsr.hxx | 23 - sw/inc/txtatr.hxx | 11 - sw/inc/txtinet.hxx | 5 - sw/inc/undobj.hxx | 1156 -------------------------------- sw/inc/usrfld.hxx | 10 +- sw/inc/viewopt.hxx | 29 +- sw/source/core/attr/calbck.cxx | 92 +-- sw/source/core/attr/format.cxx | 16 +- sw/source/core/crsr/callnk.cxx | 12 +- sw/source/core/crsr/callnk.hxx | 6 +- sw/source/core/crsr/crsrsh.cxx | 90 +-- sw/source/core/crsr/crstrvl.cxx | 59 +- sw/source/core/crsr/pam.cxx | 18 +- sw/source/core/crsr/swcrsr.cxx | 12 +- sw/source/core/crsr/trvltbl.cxx | 7 +- sw/source/core/crsr/unocrsr.cxx | 10 +- sw/source/core/crsr/viscrs.cxx | 13 +- sw/source/core/doc/doc.cxx | 35 +- sw/source/core/doc/docdesc.cxx | 70 +- sw/source/core/doc/docdraw.cxx | 6 +- sw/source/core/doc/docfld.cxx | 12 +- sw/source/core/doc/docfly.cxx | 39 +- sw/source/core/doc/docfmt.cxx | 13 +- sw/source/core/doc/docftn.cxx | 12 +- sw/source/core/doc/doclay.cxx | 5 - sw/source/core/doc/docnew.cxx | 5 - sw/source/core/doc/docnum.cxx | 17 - sw/source/core/doc/doctxm.cxx | 37 +- sw/source/core/doc/fmtcol.cxx | 6 - sw/source/core/doc/htmltbl.cxx | 15 +- sw/source/core/doc/number.cxx | 7 +- sw/source/core/doc/tblrwcl.cxx | 13 +- sw/source/core/docnode/ndsect.cxx | 28 +- sw/source/core/docnode/ndtbl.cxx | 66 +- sw/source/core/docnode/ndtbl1.cxx | 8 - sw/source/core/docnode/node.cxx | 93 +-- sw/source/core/docnode/node2lay.cxx | 15 - sw/source/core/docnode/section.cxx | 67 +- sw/source/core/docnode/swbaslnk.cxx | 21 - sw/source/core/draw/dcontact.cxx | 91 +-- sw/source/core/draw/dview.cxx | 12 - sw/source/core/edit/edfld.cxx | 12 +- sw/source/core/edit/edfldexp.cxx | 7 - sw/source/core/edit/editsh.cxx | 12 +- sw/source/core/edit/edlingu.cxx | 12 +- sw/source/core/edit/edundo.cxx | 9 +- sw/source/core/fields/authfld.cxx | 47 -- sw/source/core/fields/cellfml.cxx | 25 +- sw/source/core/fields/dbfld.cxx | 91 --- sw/source/core/fields/ddefld.cxx | 5 - sw/source/core/fields/docufld.cxx | 131 ---- sw/source/core/fields/expfld.cxx | 49 -- sw/source/core/fields/reffld.cxx | 27 +- sw/source/core/fields/tblcalc.cxx | 12 - sw/source/core/frmedt/fecopy.cxx | 6 +- sw/source/core/frmedt/fedesc.cxx | 13 +- sw/source/core/frmedt/fefly1.cxx | 6 +- sw/source/core/frmedt/feflyole.cxx | 7 +- sw/source/core/frmedt/feshview.cxx | 16 +- sw/source/core/frmedt/fetab.cxx | 6 +- sw/source/core/frmedt/fews.cxx | 13 +- sw/source/core/frmedt/tblsel.cxx | 54 +- sw/source/core/inc/UndoAttribute.hxx | 2 +- sw/source/core/inc/UndoCore.hxx | 2 +- sw/source/core/inc/cellfrm.hxx | 7 - sw/source/core/inc/cntfrm.hxx | 12 +- sw/source/core/inc/flyfrm.hxx | 11 +- sw/source/core/inc/frame.hxx | 19 +- sw/source/core/inc/frmtool.hxx | 6 +- sw/source/core/inc/hffrm.hxx | 6 +- sw/source/core/inc/pagefrm.hxx | 6 +- sw/source/core/inc/sectfrm.hxx | 11 +- sw/source/core/inc/tabfrm.hxx | 18 +- sw/source/core/layout/colfrm.cxx | 6 +- sw/source/core/layout/flowfrm.cxx | 12 +- sw/source/core/layout/fly.cxx | 17 +- sw/source/core/layout/flycnt.cxx | 6 +- sw/source/core/layout/flylay.cxx | 20 +- sw/source/core/layout/flypos.cxx | 22 +- sw/source/core/layout/frmtool.cxx | 47 +- sw/source/core/layout/ftnfrm.cxx | 31 +- sw/source/core/layout/hffrm.cxx | 19 +- sw/source/core/layout/layact.cxx | 29 +- sw/source/core/layout/newfrm.cxx | 12 +- sw/source/core/layout/pagechg.cxx | 19 +- sw/source/core/layout/pagedesc.cxx | 13 +- sw/source/core/layout/paintfrm.cxx | 19 +- sw/source/core/layout/sectfrm.cxx | 24 +- sw/source/core/layout/tabfrm.cxx | 24 +- sw/source/core/layout/trvlfrm.cxx | 28 +- sw/source/core/layout/wsfrm.cxx | 57 +- sw/source/core/table/swtable.cxx | 18 - sw/source/core/text/itratr.cxx | 5 - sw/source/core/text/porfld.cxx | 7 +- sw/source/core/tox/tox.cxx | 7 - sw/source/core/tox/txmsrt.cxx | 6 +- sw/source/core/txtnode/atrftn.cxx | 4 - sw/source/core/txtnode/fntcache.cxx | 7 +- sw/source/core/txtnode/txtatr2.cxx | 5 - sw/source/core/undo/rolbck.cxx | 6 +- sw/source/core/undo/undobj1.cxx | 8 +- sw/source/core/undo/undraw.cxx | 17 - sw/source/core/undo/untbl.cxx | 20 +- sw/source/core/unocore/unocoll.cxx | 30 - sw/source/core/unocore/unodraw.cxx | 5 - sw/source/core/unocore/unofield.cxx | 27 - sw/source/core/unocore/unoframe.cxx | 15 - sw/source/core/unocore/unoidx.cxx | 20 - sw/source/core/unocore/unoredlines.cxx | 15 - sw/source/core/unocore/unotbl.cxx | 63 +- sw/source/core/view/vdraw.cxx | 6 +- sw/source/core/view/viewsh.cxx | 31 +- sw/source/core/view/vnew.cxx | 3 - sw/source/core/view/vprint.cxx | 17 +- sw/source/ui/app/docsh.cxx | 35 +- sw/source/ui/app/docsh2.cxx | 133 ---- sw/source/ui/config/viewopt.cxx | 11 +- sw/source/ui/fldui/fldmgr.cxx | 5 - sw/source/ui/uiview/pview.cxx | 36 +- sw/source/ui/uiview/srcview.cxx | 5 - sw/source/ui/uiview/view.cxx | 15 +- sw/source/ui/uiview/viewport.cxx | 24 +- sw/source/ui/uiview/viewtab.cxx | 18 +- sw/source/ui/uno/unotxdoc.cxx | 6 +- 134 files changed, 200 insertions(+), 3906 deletions(-) diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 17e01f2b78b2..94648f650470 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -74,7 +74,6 @@ class SW_DLLPUBLIC SwClient : ::boost::noncopyable friend class SwModify; friend class SwClientIter; -<<<<<<< local SwClient *pLeft, *pRight; // double-linked list of other clients SwModify *pRegisteredIn; // event source @@ -88,17 +87,6 @@ class SW_DLLPUBLIC SwClient : ::boost::noncopyable // mba: IMHO these methods should be pure virtual virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ); -======= - SwClient *pLeft, *pRight; // fuer die AVL-Sortierung - sal_Bool bModifyLocked : 1; // wird in SwModify::Modify benutzt, - // eigentlich ein Member des SwModify - // aber aus Platzgruenden hier. - sal_Bool bInModify : 1; // ist in einem Modify. (Debug!!!) - sal_Bool bInDocDTOR : 1; // Doc wird zerstoert, nicht "abmelden" - sal_Bool bInCache : 1; // Ist im BorderAttrCache des Layout, - // Traegt sich dann im Modify aus! - sal_Bool bInSwFntCache : 1; // Ist im SwFont-Cache der Formatierung ->>>>>>> other protected: // single argument ctors shall be explicit. @@ -128,37 +116,13 @@ public: // needed for class SwClientIter TYPEINFO(); -<<<<<<< local // get information about attribute - virtual BOOL GetInfo( SfxPoolItem& ) const; -======= - void LockModify() { bModifyLocked = sal_True; } - void UnlockModify() { bModifyLocked = sal_False; } - void SetInCache( sal_Bool bNew ) { bInCache = bNew; } - void SetInSwFntCache( sal_Bool bNew ) { bInSwFntCache = bNew; } - sal_Bool IsModifyLocked() const { return bModifyLocked; } - sal_Bool IsInDocDTOR() const { return bInDocDTOR; } - sal_Bool IsInCache() const { return bInCache; } - sal_Bool IsInSwFntCache() const { return bInSwFntCache; } - - // erfrage vom Client Informationen virtual sal_Bool GetInfo( SfxPoolItem& ) const; - -private: - SwClient( const SwClient& ); - SwClient &operator=( const SwClient& ); ->>>>>>> other }; inline SwClient::SwClient() : -<<<<<<< local pLeft(0), pRight(0), pRegisteredIn(0), mbIsAllowedToBeRemovedInModifyCall(false) {} -======= - pLeft(0), pRight(0), pRegisteredIn(0) -{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = sal_False; } - ->>>>>>> other // ---------- // SwModify @@ -200,37 +164,21 @@ public: SwClient* Remove(SwClient *pDepend); const SwClient* GetDepends() const { return pRoot; } -<<<<<<< local // get information about attribute - virtual BOOL GetInfo( SfxPoolItem& ) const; -======= - // erfrage vom Client Informationen virtual sal_Bool GetInfo( SfxPoolItem& ) const; ->>>>>>> other -<<<<<<< local - void LockModify() { bModifyLocked = TRUE; } - void UnlockModify() { bModifyLocked = FALSE; } + void LockModify() { bModifyLocked = sal_True; } + void UnlockModify() { bModifyLocked = sal_False; } void SetInCache( BOOL bNew ) { bInCache = bNew; } void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; } - void SetInDocDTOR() { bInDocDTOR = TRUE; } - BOOL IsModifyLocked() const { return bModifyLocked; } - BOOL IsInDocDTOR() const { return bInDocDTOR; } - BOOL IsInCache() const { return bInCache; } - BOOL IsInSwFntCache() const { return bInSwFntCache; } -======= - void SetInDocDTOR() { bInDocDTOR = sal_True; } ->>>>>>> other + void SetInDocDTOR() { bInDocDTOR = sal_True; } + sal_Bool IsModifyLocked() const { return bModifyLocked; } + sal_Bool IsInDocDTOR() const { return bInDocDTOR; } + sal_Bool IsInCache() const { return bInCache; } + sal_Bool IsInSwFntCache() const { return bInSwFntCache; } void CheckCaching( const sal_uInt16 nWhich ); - -<<<<<<< local bool IsLastDepend() { return pRoot && pRoot->IsLast(); } -======= - sal_Bool IsLastDepend() const - { return pRoot && !pRoot->pLeft && !pRoot->pRight; } ->>>>>>> other - int GetClientCount() const; }; @@ -251,12 +199,7 @@ public: SwClient* GetToTell() { return pToTell; } -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem & ) const; -======= - // erfrage vom Client Informationen virtual sal_Bool GetInfo( SfxPoolItem & ) const; ->>>>>>> other protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ); diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 69bbb7e82143..6dbb2fbc3fe7 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -337,15 +337,10 @@ public: SwCrsrShell( SwCrsrShell& rShell, Window *pWin ); virtual ~SwCrsrShell(); -<<<<<<< local -======= - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - // IShellCursorSupplier virtual SwPaM & CreateNewShellCursor(); virtual SwPaM & GetCurrentShellCursor(); ->>>>>>> other // neuen Cusror erzeugen und den alten anhaengen SwPaM * CreateCrsr(); // loesche den aktuellen Cursor und der folgende wird zum Aktuellen diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 037002afbd20..cf475663c5cd 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -278,11 +278,7 @@ public: void EnterWait( sal_Bool bLockDispatcher ); void LeaveWait( sal_Bool bLockDispatcher ); -<<<<<<< local - void ToggleBrowserMode(BOOL bOn, SwView* pView); -======= - void ToggleBrowserMode(sal_Bool bOn, SwView* pView = 0); ->>>>>>> other + void ToggleBrowserMode(sal_Bool bOn, SwView* pView); sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, sal_Bool bUnoCall ); diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 70dbd5c0576e..4889288caf09 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -688,15 +688,7 @@ protected: public: SwRefPageGetFieldType( SwDoc* pDoc ); virtual SwFieldType* Copy() const; -<<<<<<< local - USHORT MakeSetList( _SetGetExpFlds& rTmpLst ); -======= - - // ueberlagert, um alle RefPageGet-Felder zu updaten - virtual void Modify( SfxPoolItem *, SfxPoolItem * ); sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst ); - ->>>>>>> other SwDoc* GetDoc() const { return pDoc; } }; diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 567e92b84e9b..3d3169fcf27a 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -160,19 +160,13 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType { String sName; const SwNode* pOutlChgNd; -// sal_Unicode cDelim; String sDelim; -<<<<<<< local - USHORT nType; - BYTE nLevel; - BOOL bDeleted; -protected: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); -======= sal_uInt16 nType; sal_uInt8 nLevel; sal_Bool bDeleted; ->>>>>>> other + +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ); public: SwSetExpFieldType( SwDoc* pDoc, const String& rName, diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx index 0fa469cbd046..53de41c11e3b 100644 --- a/sw/inc/fchrfmt.hxx +++ b/sw/inc/fchrfmt.hxx @@ -75,13 +75,7 @@ public: virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - // an das SwTxtCharFmt weiterleiten (vom SwClient) -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; -======= - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; ->>>>>>> other void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); } SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index a0534c01573f..372fa82fe5e7 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -74,12 +74,7 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; -======= - virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; ->>>>>>> other const SwField *GetFld() const { return pField; } SwField *GetFld() { return pField; } @@ -97,14 +92,9 @@ public: const SwTxtFld *GetTxtFld() const { return pTxtAttr; } SwTxtFld *GetTxtFld() { return pTxtAttr; } -<<<<<<< local - BOOL IsFldInDoc() const; - BOOL IsProtect() const; void RegisterToFieldType( SwFieldType& ); -======= sal_Bool IsFldInDoc() const; sal_Bool IsProtect() const; ->>>>>>> other }; class SW_DLLPUBLIC SwFmtFldHint : public SfxHint diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx index 9db05e8c7ac1..73a56a283a2b 100644 --- a/sw/inc/fmthdft.hxx +++ b/sw/inc/fmthdft.hxx @@ -64,14 +64,9 @@ public: const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)GetRegisteredIn(); } -<<<<<<< local - BOOL IsActive() const { return bActive; } - void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } void RegisterToFormat( SwFmt& rFmt ); -======= sal_Bool IsActive() const { return bActive; } void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; } ->>>>>>> other }; @@ -103,22 +98,12 @@ public: const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)GetRegisteredIn(); } -<<<<<<< local - BOOL IsActive() const { return bActive; } - void SetActive( BOOL bNew = TRUE ) { bActive = bNew; } void RegisterToFormat( SwFmt& rFmt ); -======= sal_Bool IsActive() const { return bActive; } void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; } ->>>>>>> other }; -<<<<<<< local - -inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const -======= inline const SwFmtHeader &SwAttrSet::GetHeader(sal_Bool bInP) const ->>>>>>> other { return (const SwFmtHeader&)Get( RES_HEADER,bInP); } inline const SwFmtFooter &SwAttrSet::GetFooter(sal_Bool bInP) const { return (const SwFmtFooter&)Get( RES_FOOTER,bInP); } diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 64a8aa1dc5d9..b553c9eadbd2 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -111,13 +111,8 @@ public: virtual sal_uInt16 ResetAllFmtAttr(); // <-- -<<<<<<< local inline SwFmt* DerivedFrom() const { return (SwFmt*)GetRegisteredIn(); } - inline BOOL IsDefault() const { return DerivedFrom() == 0; } -======= - inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; } inline sal_Bool IsDefault() const { return DerivedFrom() == 0; } ->>>>>>> other inline const String& GetName() const { return aFmtName; } void SetName( const String& rNewName, sal_Bool bBroadcast=sal_False ); diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index e2b1f5bbb97b..daf690861260 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -72,6 +72,9 @@ enum REFERENCEMARK class SwGetRefFieldType : public SwFieldType { SwDoc* pDoc; +protected: + // ueberlagert, um alle Ref-Felder zu updaten + virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); public: SwGetRefFieldType(SwDoc* pDoc ); virtual SwFieldType* Copy() const; @@ -81,16 +84,8 @@ public: void MergeWithOtherDoc( SwDoc& rDestDoc ); static SwTxtNode* FindAnchor( SwDoc* pDoc, const String& rRefMark, -<<<<<<< local - USHORT nSubType, USHORT nSeqNo, - USHORT* pStt, USHORT* pEnd = 0 ); -protected: - // ueberlagert, um alle Ref-Felder zu updaten - virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); -======= sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16* pStt, sal_uInt16* pEnd = 0 ); ->>>>>>> other }; /*-------------------------------------------------------------------- diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index d9cb307e5ad8..01087cf0b3ef 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -127,17 +127,6 @@ public: const SfxItemSet* rReplSet = 0 ); // UI versions -<<<<<<< local - BOOL IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; - BOOL IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; - BOOL IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; - BOOL IsStartEndSentence( bool bEnd ) const; - BOOL GoStartWord(); - BOOL GoEndWord(); - BOOL GoNextWord(); - BOOL GoPrevWord(); - BOOL SelectWord( ViewShell* pViewShell, const Point* pPt = 0 ); -======= sal_Bool IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; sal_Bool IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; sal_Bool IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; @@ -147,20 +136,9 @@ public: sal_Bool GoNextWord(); sal_Bool GoPrevWord(); sal_Bool SelectWord( const Point* pPt = 0 ); ->>>>>>> other // API versions of above functions (will be used with a different // WordType for the break iterator) -<<<<<<< local - BOOL IsStartWordWT( sal_Int16 nWordType ) const; - BOOL IsEndWordWT( sal_Int16 nWordType ) const; - BOOL IsInWordWT( sal_Int16 nWordType ) const; - BOOL GoStartWordWT( sal_Int16 nWordType ); - BOOL GoEndWordWT( sal_Int16 nWordType ); - BOOL GoNextWordWT( sal_Int16 nWordType ); - BOOL GoPrevWordWT( sal_Int16 nWordType ); - BOOL SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt = 0 ); -======= sal_Bool IsStartWordWT( sal_Int16 nWordType ) const; sal_Bool IsEndWordWT( sal_Int16 nWordType ) const; sal_Bool IsInWordWT( sal_Int16 nWordType ) const; @@ -169,7 +147,6 @@ public: sal_Bool GoNextWordWT( sal_Int16 nWordType ); sal_Bool GoPrevWordWT( sal_Int16 nWordType ); sal_Bool SelectWordWT( sal_Int16 nWordType, const Point* pPt = 0 ); ->>>>>>> other enum SentenceMoveType { diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index ee41569cf50a..6990f07c42a5 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -45,15 +45,9 @@ public: SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); virtual ~SwTxtCharFmt( ); -<<<<<<< local // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!) void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* ); bool GetInfo( SfxPoolItem& rInfo ) const; -======= - // werden vom SwFmtCharFmt hierher weitergeleitet - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; ->>>>>>> other // get and set TxtNode pointer void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; } @@ -101,12 +95,7 @@ public: virtual ~SwTxtRuby(); TYPEINFO(); -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; -======= - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; ->>>>>>> other SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode); diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index c5459453604e..5ea0df9fe3b2 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -50,12 +50,7 @@ public: virtual ~SwTxtINetFmt(); TYPEINFO(); -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; -======= - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; ->>>>>>> other SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode); diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 76cc31ba4c4f..9d447c18034f 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -234,471 +234,7 @@ public: class SwUndoInsLayFmt; -<<<<<<< local -public: - SwUndoStart( SwUndoId nId ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // -> #111827# - virtual String GetComment() const; - void SetRewriter(const SwRewriter & rRewriter); - virtual SwRewriter GetRewriter() const; - // <- #111827# - - virtual SwUndoId GetEffectiveId() const; - SwUndoId GetUserId() const { return nUserId; } - // Setzen vom End-Undo-Offset geschieht im Doc::EndUndo - USHORT GetEndOffset() const { return nEndOffset; } - void SetEndOffset( USHORT n ) { nEndOffset = n; } -}; - -class SwUndoEnd: public SwUndo -{ - // Um innerhalb von Undo zuerkennen, wann ein Ende vorliegt, gibt - // GetId() immer die UNDO_END zurueck. Die UserId kann ueber - // GetUserId() erfragt werden. - SwUndoId nUserId; - // fuer die "Verpointerung" von Start- und End-Undos - USHORT nSttOffset; - - SwRewriter mRewriter; - -public: - SwUndoEnd( SwUndoId nId ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // -> #111827# - virtual String GetComment() const; - void SetRewriter(const SwRewriter & rRewriter); - virtual SwRewriter GetRewriter() const; - // <- #111827# - - virtual SwUndoId GetEffectiveId() const; - SwUndoId GetUserId() const { return nUserId; } - - // Setzen vom Start-Undo-Offset geschieht im Doc::EndUndo - void SetSttOffset(USHORT _nSttOffSet) { nSttOffset = _nSttOffSet; } - USHORT GetSttOffset() const { return nSttOffset; } -}; - -class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt -{ - SwPosition *pPos; // Inhalt fuers Redo - String *pTxt, *pUndoTxt; - SwRedlineData* pRedlData; - ULONG nNode; - xub_StrLen nCntnt, nLen; - BOOL bIsWordDelim : 1; - BOOL bIsAppend : 1; - - const IDocumentContentOperations::InsertFlags m_nInsertFlags; - - friend class SwDoc; // eigentlich nur SwDoc::Insert( String ) - BOOL CanGrouping( sal_Unicode cIns ); - BOOL CanGrouping( const SwPosition& rPos ); - - SwDoc * pDoc; - - void Init(const SwNodeIndex & rNode); - String * GetTxtFromDoc() const; - -public: - SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen, - const IDocumentContentOperations::InsertFlags nInsertFlags, - BOOL bWDelim = TRUE ); - SwUndoInsert( const SwNodeIndex& rNode ); - virtual ~SwUndoInsert(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // #111827# - /** - Returns rewriter for this undo object. - - The returned rewriter has the following rule: - - $1 -> '' - - is shortened to a length of nUndoStringLength. - - @return rewriter for this undo object - */ - virtual SwRewriter GetRewriter() const; - - - DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert) -}; - - -class SwUndoDelete: public SwUndo, private SwUndRng, private SwUndoSaveCntnt -{ - SwNodeIndex* pMvStt; // Position der Nodes im UndoNodes-Array - String *pSttStr, *pEndStr; - SwRedlineData* pRedlData; - SwRedlineSaveDatas* pRedlSaveData; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; - ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; - - String sTableName; - - ULONG nNode; - ULONG nNdDiff; // Differenz von Nodes vor-nach Delete - ULONG nSectDiff; // Diff. von Nodes vor/nach Move mit SectionNodes - ULONG nReplaceDummy; // Diff. to a temporary dummy object - USHORT nSetPos; - - BOOL bGroup : 1; // TRUE: ist schon eine Gruppe; wird in CanGrouping() ausgwertet !! - BOOL bBackSp : 1; // TRUE: wenn Gruppierung und der Inhalt davor geloescht wird - BOOL bJoinNext: 1; // TRUE: wenn der Bereich von Oben nach unten geht - BOOL bTblDelLastNd : 1; // TRUE: TextNode hinter der Tabelle einf./loeschen - BOOL bDelFullPara : 1; // TRUE: gesamte Nodes wurden geloescht - BOOL bResetPgDesc : 1; // TRUE: am nachfolgenden Node das PgDsc zuruecksetzen - BOOL bResetPgBrk : 1; // TRUE: am nachfolgenden Node das PgBreak zuruecksetzen - BOOL bFromTableCopy : 1; // TRUE: called by SwUndoTblCpyTbl - - BOOL SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, - SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd ); -public: - SwUndoDelete( SwPaM&, BOOL bFullPara = FALSE, BOOL bCalledByTblCpy = FALSE ); - virtual ~SwUndoDelete(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // #111827# - /** - Returns rewriter for this undo object. - - The rewriter consists of the following rule: - - $1 -> '' - - is shortened to nUndoStringLength characters. - - @return rewriter for this undo object - */ - virtual SwRewriter GetRewriter() const; - - BOOL CanGrouping( SwDoc*, const SwPaM& ); - - void SetTblDelLastNd() { bTblDelLastNd = TRUE; } - - // fuer die PageDesc/PageBreak Attribute einer Tabelle - void SetPgBrkFlags( BOOL bPageBreak, BOOL bPageDesc ) - { bResetPgDesc = bPageDesc; bResetPgBrk = bPageBreak; } - - void SetTableName(const String & rName); - - // SwUndoTblCpyTbl needs this information: - long NodeDiff() const { return nSttNode - nEndNode; } - xub_StrLen ContentStart() const { return nSttCntnt; } - BOOL IsDelFullPara() const { return bDelFullPara; } - - DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete) -}; - - -class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt -{ - String aDelStr, aInsStr; - SwRedlineSaveDatas* pRedlSaveData; - ULONG nSttNode; - xub_StrLen nSttCntnt; - BOOL bInsChar : 1; // kein Overwrite mehr; sondern Insert - BOOL bGroup : 1; // TRUE: ist schon eine Gruppe; wird in - // CanGrouping() ausgwertet !! -public: - SwUndoOverwrite( SwDoc*, SwPosition&, sal_Unicode cIns ); - virtual ~SwUndoOverwrite(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // #111827# - /** - Returns the rewriter of this undo object. - - The rewriter contains the following rule: - - $1 -> '' - - is shortened to nUndoStringLength characters. - - @return the rewriter of this undo object - */ - virtual SwRewriter GetRewriter() const; - - BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns ); -}; - - -class SwUndoSplitNode: public SwUndo -{ - SwHistory* pHistory; - SwRedlineData* pRedlData; - ULONG nNode; - xub_StrLen nCntnt; - BOOL bTblFlag : 1; - BOOL bChkTblStt : 1; -public: - SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, BOOL bChkTbl ); - virtual ~SwUndoSplitNode(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - void SetTblFlag() { bTblFlag = TRUE; } -}; - - -class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveCntnt -{ - // nDest.. - Bereich, in den verschoben wurde (nach dem Move!) - // nIns.. - Position, von der verschoben wurde und wieder die neue InsPos. ist - // nMv.. Position auf die verschoben wird (vor dem Move!) ; fuers REDO - ULONG nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode; - xub_StrLen nDestSttCntnt, nDestEndCntnt, nInsPosCntnt, nMvDestCntnt; - - USHORT nFtnStt; // StartPos der Fussnoten in der History - - BOOL bJoinNext : 1, - bJoinPrev : 1, - bMoveRange : 1; - - bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move - - void DelFtn( const SwPaM& ); -public: - SwUndoMove( const SwPaM&, const SwPosition& ); - SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - // setze den Destination-Bereich nach dem Verschieben. - void SetDestRange( const SwPaM&, const SwPosition&, BOOL, BOOL ); - void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd, - const SwNodeIndex& rInsPos ); - - BOOL IsMoveRange() const { return bMoveRange; } - ULONG GetEndNode() const { return nEndNode; } - ULONG GetDestSttNode() const { return nDestSttNode; } - xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; } - - void SetMoveRedlines( bool b ) { bMoveRedlines = b; } - -}; - - -class SwUndoAttr : public SwUndo, private SwUndRng -{ - SfxItemSet m_AttrSet; // attributes for Redo - const ::std::auto_ptr m_pHistory; // History for Undo - ::std::auto_ptr m_pRedlineData; // Redlining - ::std::auto_ptr m_pRedlineSaveData; - ULONG m_nNodeIndex; // Offset: for Redlining - const SetAttrMode m_nInsertFlags; // insert flags - - void RemoveIdx( SwDoc& rDoc ); - -public: - SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags ); - SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags ); - virtual ~SwUndoAttr(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - void SaveRedlineData( const SwPaM& rPam, BOOL bInsCntnt ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - -class SwUndoResetAttr : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr m_pHistory; - SvUShortsSort m_Ids; - const USHORT m_nFormatId; // Format-Id for Redo - -public: - SwUndoResetAttr( const SwPaM&, USHORT nFmtId ); - SwUndoResetAttr( const SwPosition&, USHORT nFmtId ); - virtual ~SwUndoResetAttr(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - void SetAttrs( const SvUShortsSort& rArr ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - -class SwUndoFmtAttr : public SwUndo -{ - friend class SwUndoDefaultAttr; - SwFmt * m_pFmt; - ::std::auto_ptr m_pOldSet; // old attributes - ULONG m_nNodeIndex; - const USHORT m_nFmtWhich; - const bool m_bSaveDrawPt; - - bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc? - void SaveFlyAnchor( bool bSaveDrawPt = false ); - // --> OD 2004-10-26 #i35443# - Add return value, type . - // Return value indicates, if anchor attribute is restored. - // Notes: - If anchor attribute is restored, all other existing attributes - // are also restored. - // - Anchor attribute isn't restored successfully, if it contains - // an invalid anchor position and all other existing attributes - // aren't restored. - // This situation occurs for undo of styles. - bool RestoreFlyAnchor( SwUndoIter& rIter ); - // <-- - // --> OD 2008-02-27 #refactorlists# - removed - void Init(); - // <-- - -public: - // register at the Format and save old attributes - // --> OD 2008-02-27 #refactorlists# - removed - SwUndoFmtAttr( const SfxItemSet& rOldSet, - SwFmt& rFmt, - bool bSaveDrawPt = true ); - // <-- - SwUndoFmtAttr( const SfxPoolItem& rItem, - SwFmt& rFmt, - bool bSaveDrawPt = true ); - virtual ~SwUndoFmtAttr(); - virtual void Undo( SwUndoIter& ); - // --> OD 2004-10-26 #i35443# - calls - nothing else - virtual void Redo( SwUndoIter& ); - // <-- - virtual void Repeat( SwUndoIter& ); - virtual SwRewriter GetRewriter() const; - - void PutAttr( const SfxPoolItem& rItem ); - SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc! -}; - -// --> OD 2008-02-12 #newlistlevelattrs# -class SwUndoFmtResetAttr : public SwUndo -{ - public: - SwUndoFmtResetAttr( SwFmt& rChangedFormat, - const USHORT nWhichId ); - ~SwUndoFmtResetAttr(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - private: - // format at which a certain attribute is reset. - SwFmt * const m_pChangedFormat; - // which ID of the reset attribute - const USHORT m_nWhichId; - // old attribute which has been reset - needed for undo. - ::std::auto_ptr m_pOldItem; -}; -// <-- - -class SwUndoDontExpandFmt : public SwUndo -{ - const ULONG m_nNodeIndex; - const xub_StrLen m_nContentIndex; - -public: - SwUndoDontExpandFmt( const SwPosition& rPos ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - -// helper class to receive changed attribute sets -class SwUndoFmtAttrHelper : public SwClient -{ - ::std::auto_ptr m_pUndo; - const bool m_bSaveDrawPt; -protected: - virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); - -public: - SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true ); - - SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); } - // release the undo object (so it is not deleted here), and return it - SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); } -}; - - -class SwUndoFmtColl : public SwUndo, private SwUndRng -{ - String aFmtName; - SwHistory* pHistory; - SwFmtColl* pFmtColl; - // --> OD 2008-04-15 #refactorlists# - for correct and - // boolean, which indicates that the attributes are reseted at the nodes - // before the format has been applied. - const bool mbReset; - // boolean, which indicates that the list attributes had been reseted at - // the nodes before the format has been applied. - const bool mbResetListAttrs; - // <-- -public: - // --> OD 2008-04-15 #refactorlists# -// SwUndoFmtColl( const SwPaM&, SwFmtColl* ); - SwUndoFmtColl( const SwPaM&, SwFmtColl*, - const bool bReset, - const bool bResetListAttrs ); - // <-- - virtual ~SwUndoFmtColl(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // #111827# - /** - Returns the rewriter for this undo object. - - The rewriter contains one rule: - - $1 -> - - is the name of the format - collection that is applied by the action recorded by this undo - object. - - @return the rewriter for this undo object - */ - virtual SwRewriter GetRewriter() const; - - SwHistory* GetHistory() { return pHistory; } - -}; - - -class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr m_pHistory; - const bool m_bModulus; - -public: - SwUndoMoveLeftMargin( const SwPaM&, BOOL bRight, BOOL bModulus ); - virtual ~SwUndoMoveLeftMargin(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - -// Basis-Klasse fuer Insert von Dokument, Glossaries und Kopieren -======= // base class for insertion of Document, Glossaries and Copy ->>>>>>> other class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt { SwTxtFmtColl *pTxtFmtColl, *pLastNdColl; @@ -796,696 +332,4 @@ public: }; -<<<<<<< local - -class SwUndoSetFlyFmt : public SwUndo, public SwClient -{ - SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat - SwFrmFmt* pOldFmt; // die alte Fly Vorlage - SwFrmFmt* pNewFmt; // die neue Fly Vorlage - SfxItemSet* pItemSet; // die zurueck-/ gesetzten Attribute - ULONG nOldNode, nNewNode; - xub_StrLen nOldCntnt, nNewCntnt; - USHORT nOldAnchorTyp, nNewAnchorTyp; - BOOL bAnchorChgd; - - void PutAttr( USHORT nWhich, const SfxPoolItem* pItem ); - void GetAnchor( SwFmtAnchor& rAnhor, ULONG nNode, xub_StrLen nCntnt ); - -protected: - virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); - -public: - SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt ); - virtual ~SwUndoSetFlyFmt(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - virtual SwRewriter GetRewriter() const; - void DeRegisterFromFormat( SwFmt& ); -}; - -//-------------------------------------------------------------------- - -class _UnReplaceData; -SV_DECL_PTRARR_DEL( _UnReplaceDatas, _UnReplaceData*, 10, 25 ) - -class SwUndoReplace : public SwUndo -{ - friend class SwDoc; - - BOOL bOldIterFlag; // Status vom Undo-Iter vorm 1. Aufruf - USHORT nAktPos; // fuer GetUndoRange und Undo/Redo - _UnReplaceDatas aArr; - SwRedlineData* pRedlData; - -public: - SwUndoReplace(); - virtual ~SwUndoReplace(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - // #111827# - /** - Returns the rewriter of this undo object. - - If this undo object represents several replacements the - rewriter contains the following rules: - - $1 -> - $2 -> occurrences of - $3 -> - - If this undo object represents one replacement the rewriter - contains these rules: - - $1 -> - $2 -> "->" (STR_YIELDS) - $3 -> - - @return the rewriter of this undo object - */ - virtual SwRewriter GetRewriter() const; - - void AddEntry( const SwPaM& rPam, const String& rInsert, BOOL bRegExp ); - void SetEntryEnd( const SwPaM& rPam ); - - BOOL IsFull() const - { return ((USHRT_MAX / sizeof( void* )) - 50 ) < aArr.Count(); } - -}; - - -//-------------------------------------------------------------------- - - -class SwUndoTblHeadline : public SwUndo -{ - ULONG nTblNd; - USHORT nOldHeadline; - USHORT nNewHeadline; -public: - SwUndoTblHeadline( const SwTable&, USHORT nOldHdl, USHORT nNewHdl ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - - -//------------ Undo von Insert-/Delete-Sections ---------------------- - -class SwUndoInsSection : public SwUndo, private SwUndRng -{ -private: - const ::std::auto_ptr m_pSectionData; - const ::std::auto_ptr m_pTOXBase; /// set iff section is TOX - const ::std::auto_ptr m_pAttrSet; - ::std::auto_ptr m_pHistory; - ::std::auto_ptr m_pRedlData; - ULONG m_nSectionNodePos; - bool m_bSplitAtStart : 1; - bool m_bSplitAtEnd : 1; - bool m_bUpdateFtn : 1; - - void Join( SwDoc& rDoc, ULONG nNode ); - -public: - SwUndoInsSection(SwPaM const&, SwSectionData const&, - SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase); - virtual ~SwUndoInsSection(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - void SetSectNdPos(ULONG const nPos) { m_nSectionNodePos = nPos; } - void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart); - void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; } -}; - -SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&); - -SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const); - - -//------------ Undo von verschieben/stufen von Gliederung ---------------- - -class SwUndoOutlineLeftRight : public SwUndo, private SwUndRng -{ - short nOffset; -public: - SwUndoOutlineLeftRight( const SwPaM& rPam, short nOffset ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - -//-------------------------------------------------------------------- - -class SwUndoDefaultAttr : public SwUndo -{ - ::std::auto_ptr m_pOldSet; // the old attributes - ::std::auto_ptr m_pTabStop; - -public: - // registers at the format and saves old attributes - SwUndoDefaultAttr( const SfxItemSet& rOldSet ); - virtual ~SwUndoDefaultAttr(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); -}; - -//-------------------------------------------------------------------- -// ---------- Undo fuer Numerierung ---------------------------------- - -class SwUndoInsNum : public SwUndo, private SwUndRng -{ - SwNumRule aNumRule; - SwHistory* pHistory; - ULONG nSttSet; - SwNumRule* pOldNumRule; - String sReplaceRule; - USHORT nLRSavePos; -public: - SwUndoInsNum( const SwPaM& rPam, const SwNumRule& rRule ); - SwUndoInsNum( const SwNumRule& rOldRule, const SwNumRule& rNewRule, - SwUndoId nUndoId = UNDO_INSFMTATTR ); - SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule, - const String& rReplaceRule ); - virtual ~SwUndoInsNum(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - virtual SwRewriter GetRewriter() const; - - SwHistory* GetHistory(); // wird ggfs. neu angelegt! - void SetSttNum( ULONG nNdIdx ) { nSttSet = nNdIdx; } - void SaveOldNumRule( const SwNumRule& rOld ); - - void SetLRSpaceEndPos(); - -}; - -class SwUndoDelNum : public SwUndo, private SwUndRng -{ - SvULongs aNodeIdx; - SvBytes aLevels; - SvBools aRstLRSpaces; - SwHistory* pHistory; -public: - SwUndoDelNum( const SwPaM& rPam ); - virtual ~SwUndoDelNum(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace ); - SwHistory* GetHistory() { return pHistory; } - -}; - -class SwUndoMoveNum : public SwUndo, private SwUndRng -{ - ULONG nNewStt; - long nOffset; -public: - SwUndoMoveNum( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv = FALSE ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - void SetStartNode( ULONG nValue ) { nNewStt = nValue; } -}; - -class SwUndoNumUpDown : public SwUndo, private SwUndRng -{ - short nOffset; -public: - SwUndoNumUpDown( const SwPaM& rPam, short nOffset ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - -class SwUndoNumOrNoNum : public SwUndo -{ - ULONG nIdx; - BOOL mbNewNum, mbOldNum; - -public: - SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL mbOldNum, - BOOL mbNewNum ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - -class SwUndoNumRuleStart : public SwUndo -{ - ULONG nIdx; - USHORT nOldStt, nNewStt; - BOOL bSetSttValue : 1; - BOOL bFlag : 1; -public: - SwUndoNumRuleStart( const SwPosition& rPos, BOOL bDelete ); - SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt ); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); -}; - -//-------------------------------------------------------------------- -// ---------- Undo fuer DrawObjecte ---------------------------------- - -class SwSdrUndo : public SwUndo -{ - SdrUndoAction* pSdrUndo; - SdrMarkList* pMarkList; // MarkList for all selected SdrObjects -public: - SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList ); - virtual ~SwSdrUndo(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - String GetComment() const; -}; - -class SwUndoDrawGroup : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawGroup( USHORT nCnt ); - virtual ~SwUndoDrawGroup(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - void AddObj( USHORT nPos, SwDrawFrmFmt*, SdrObject* ); - void SetGroupFmt( SwDrawFrmFmt* ); -}; - -// --> OD 2006-11-01 #130889# -// Action "ungroup drawing object" is now splitted into three parts - see -// method : -// - creation for instances for the group members of the -// selected group objects -// - intrinsic ungroup of the selected group objects -// - creation of instances for the former group members and -// connection to the Writer layout. -// Thus, two undo actions (instances of ) are needed: -// - Existing class takes over the part for the formats. -// - New class takes over the part for -// contact object. -class SwUndoDrawUnGroup : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawUnGroup( SdrObjGroup* ); - virtual ~SwUndoDrawUnGroup(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - void AddObj( USHORT nPos, SwDrawFrmFmt* ); -}; - -// --> OD 2006-11-01 #130889# -class SwUndoDrawUnGroupConnectToLayout : public SwUndo -{ - private: - std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs; - - public: - SwUndoDrawUnGroupConnectToLayout(); - virtual ~SwUndoDrawUnGroupConnectToLayout(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt, - SdrObject* pDrawObject ); -}; -// <-- - - -class SwUndoDrawDelete : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawDelete( USHORT nCnt ); - virtual ~SwUndoDrawDelete(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - void AddObj( USHORT nPos, SwDrawFrmFmt*, const SdrMark& ); -}; - -//-------------------------------------------------------------------- - -class SwUndoReRead : public SwUndo -{ - Graphic *pGrf; - String *pNm, *pFltr; - ULONG nPos; - USHORT nMirr; - - void SaveGraphicData( const SwGrfNode& ); - void SetAndSave( SwUndoIter& ); - -public: - SwUndoReRead( const SwPaM& rPam, const SwGrfNode& pGrfNd ); - virtual ~SwUndoReRead(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); -}; - -//-------------------------------------------------------------------- - -class SwUndoInsertLabel : public SwUndo -{ - union { - struct { - // fuer NoTxtFrms - SwUndoInsLayFmt* pUndoFly; - SwUndoFmtAttr* pUndoAttr; - } OBJECT; - struct { - // fuer Tabelle/TextRahmen - SwUndoDelete* pUndoInsNd; - ULONG nNode; - } NODE; - }; - - String sText; - // --> PB 2005-01-06 #i39983# - the separator will be drawed with a character style - String sSeparator; - // <-- - String sNumberSeparator; - String sCharacterStyle; - // OD 2004-04-15 #i26791# - re-store of drawing object position no longer needed - USHORT nFldId; - SwLabelType eType; - BYTE nLayerId; // fuer Zeichen-Objekte - BOOL bBefore :1; - BOOL bUndoKeep :1; - BOOL bCpyBrd :1; - -public: - SwUndoInsertLabel( const SwLabelType eTyp, const String &rText, - // --> PB 2005-01-06 #i39983# - the separator will be drawed with a character style - const String& rSeparator, - // <-- - const String& rNumberSeparator, //#i61007# order of captions - const BOOL bBefore, const USHORT nId, - const String& rCharacterStyle, - const BOOL bCpyBrd ); - virtual ~SwUndoInsertLabel(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - // #111827# - /** - Returns the rewriter of this undo object. - - The rewriter contains this rule: - - $1 -> '' - - is shortened to nUndoStringLength - characters. - - @return the rewriter of this undo object - */ - virtual SwRewriter GetRewriter() const; - - void SetNodePos( ULONG nNd ) - { if( LTYPE_OBJECT != eType ) NODE.nNode = nNd; } - - void SetUndoKeep() { bUndoKeep = TRUE; } - void SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet, SwFrmFmt& rNewFly ); - void SetDrawObj( BYTE nLayerId ); -}; - -//-------------------------------------------------------------------- - -class SwUndoChangeFootNote : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr m_pHistory; - const String m_Text; - const USHORT m_nNumber; - const bool m_bEndNote; - -public: - SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt, - USHORT nNum, bool bIsEndNote ); - virtual ~SwUndoChangeFootNote(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - virtual void Repeat( SwUndoIter& ); - - SwHistory& GetHistory() { return *m_pHistory; } -}; - -class SwUndoFootNoteInfo : public SwUndo -{ - ::std::auto_ptr m_pFootNoteInfo; - -public: - SwUndoFootNoteInfo( const SwFtnInfo &rInfo ); - virtual ~SwUndoFootNoteInfo(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); -}; - -class SwUndoEndNoteInfo : public SwUndo -{ - ::std::auto_ptr m_pEndNoteInfo; - -public: - SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo ); - virtual ~SwUndoEndNoteInfo(); - - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); -}; - - -//-------------------------------------------------------------------- - -struct _UndoTransliterate_Data; -class SwUndoTransliterate : public SwUndo, public SwUndRng -{ - std::vector< _UndoTransliterate_Data * > aChanges; - sal_uInt32 nType; - -public: - SwUndoTransliterate( const SwPaM& rPam, - const utl::TransliterationWrapper& rTrans ); - virtual ~SwUndoTransliterate(); - - virtual void Undo( SwUndoIter& rUndoIter ); - virtual void Redo( SwUndoIter& rUndoIter ); - virtual void Repeat( SwUndoIter& rUndoIter ); - - void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen, - ::com::sun::star::uno::Sequence & rOffsets ); - BOOL HasData() const { return aChanges.size() > 0; } -}; - -//-------------------------------------------------------------------- - -class SwUndoRedline : public SwUndo, public SwUndRng -{ -protected: - SwRedlineData* pRedlData; - SwRedlineSaveDatas* pRedlSaveData; - SwUndoId nUserId; - BOOL bHiddenRedlines; - - virtual void _Undo( SwUndoIter& ); - virtual void _Redo( SwUndoIter& ); - -public: - SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange ); - virtual ~SwUndoRedline(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - - SwUndoId GetUserId() const { return nUserId; } - USHORT GetRedlSaveCount() const - { return pRedlSaveData ? pRedlSaveData->Count() : 0; } -}; - -class SwUndoRedlineDelete : public SwUndoRedline -{ - BOOL bCanGroup : 1; - BOOL bIsDelim : 1; - BOOL bIsBackspace : 1; - - virtual void _Undo( SwUndoIter& ); - virtual void _Redo( SwUndoIter& ); - -public: - SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY ); - - BOOL CanGrouping( const SwUndoRedlineDelete& rPrev ); -}; - -class SwUndoRedlineSort : public SwUndoRedline -{ - SwSortOptions* pOpt; - ULONG nSaveEndNode, nOffset; - xub_StrLen nSaveEndCntnt; - - virtual void _Undo( SwUndoIter& ); - virtual void _Redo( SwUndoIter& ); - -public: - SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt ); - virtual ~SwUndoRedlineSort(); - virtual void Repeat( SwUndoIter& ); - - void SetSaveRange( const SwPaM& rRange ); - void SetOffset( const SwNodeIndex& rIdx ); -}; - -class SwUndoAcceptRedline : public SwUndoRedline -{ - virtual void _Redo( SwUndoIter& ); -public: - SwUndoAcceptRedline( const SwPaM& rRange ); - virtual void Repeat( SwUndoIter& ); -}; - -class SwUndoRejectRedline : public SwUndoRedline -{ - virtual void _Redo( SwUndoIter& ); -public: - SwUndoRejectRedline( const SwPaM& rRange ); - virtual void Repeat( SwUndoIter& ); -}; - -//-------------------------------------------------------------------- - -class SwUndoCompDoc : public SwUndo, public SwUndRng -{ - SwRedlineData* pRedlData; - SwUndoDelete* pUnDel, *pUnDel2; - SwRedlineSaveDatas* pRedlSaveData; - BOOL bInsert; -public: - SwUndoCompDoc( const SwPaM& rRg, BOOL bIns ); - SwUndoCompDoc( const SwRedline& rRedl ); - - virtual ~SwUndoCompDoc(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); -}; - - -//-------------------------------------------------------------------- - -// Object der als Iterator durch die Undo-Liste laeuft, bis die -// letze oder die angegebene Klammerung/Id erreicht ist. - -class SwUndoIter -{ - friend class SwDoc; // um im SwDoc::Undo bWeiter zu stezen - friend void SwUndoEnd::Undo( SwUndoIter& ); - friend void SwUndoStart::Undo( SwUndoIter& ); - friend void SwUndoEnd::Redo( SwUndoIter& ); - friend void SwUndoStart::Redo( SwUndoIter& ); - friend void SwUndoEnd::Repeat( SwUndoIter& ); - friend void SwUndoStart::Repeat( SwUndoIter& ); - friend void SwUndoReplace::Undo( SwUndoIter& ); - friend void SwUndoReplace::Redo( SwUndoIter& ); - - SwUndoId nUndoId; - USHORT nEndCnt; - BOOL bWeiter : 1; - BOOL bUpdateAttr : 1; // Setze das GCAttr an der CursorShell - -public: - SwPaM * pAktPam; // Member fuer das Undo - SwUndo* pLastUndoObj; // fuers Redo, das vorherige UndoObj. - SwFrmFmt* pSelFmt; // ggfs. das Format Rahmen/Object-Selektionen - SdrMarkList* pMarkList; // MarkList for all selected SdrObjects - - SwUndoIter( SwPaM * pPam, SwUndoId nId = UNDO_EMPTY ); - - BOOL IsNextUndo() const { return bWeiter; } - BOOL IsUpdateAttr() const { return bUpdateAttr; } - void SetUpdateAttr( BOOL bNew ) { bUpdateAttr = bNew; } - - inline SwDoc& GetDoc() const; - SwUndoId GetId() const { return nUndoId; } - SwUndoId GetLastUndoId() const - { return pLastUndoObj ? pLastUndoObj->GetId() : UNDO_EMPTY ; } - void ClearSelections() { pSelFmt = 0; pMarkList = 0; } -}; - - -// -> #111827# -const int nUndoStringLength = 20; - -/** - Shortens a string to a maximum length. - - @param rStr the string to be shortened - @param nLength the maximum length for rStr - @param rFillStr string to replace cut out characters with - - If rStr has less than nLength characters it will be returned unaltered. - - If rStr has more than nLength characters the following algorithm - generates the shortened string: - - frontLength = (nLength - length(rFillStr)) / 2 - rearLength = nLength - length(rFillStr) - frontLength - shortenedString = concat() - - Preconditions: - - nLength - length(rFillStr) >= 2 - - @return the shortened string - */ -String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr); -// <- #111827# - -// #16487# -/** - Denotes special characters in a string. - - The rStr is split into parts containing special characters and - parts not containing special characters. In a part containing - special characters all characters are equal. These parts are - maximal. - - @param rStr the string to denote in - - The resulting string is generated by concatenating the found - parts. The parts without special characters are surrounded by - "'". The parts containing special characters are denoted as "n x", - where n is the length of the part and x is the representation of - the special character (i. e. "tab(s)"). - - @return the denoted string -*/ -String DenoteSpecialCharacters(const String & rStr); - -======= ->>>>>>> other #endif diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx index 75e717122150..11d1db177c84 100644 --- a/sw/inc/usrfld.hxx +++ b/sw/inc/usrfld.hxx @@ -71,15 +71,11 @@ public: sal_Bool IsDeleted() const { return bDeleted; } void SetDeleted( sal_Bool b ) { bDeleted = b; } -<<<<<<< local - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nMId ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nMId ); -protected: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); -======= virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nMId ) const; virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nMId ); ->>>>>>> other + +protected: + virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); }; inline sal_Bool SwUserFieldType::IsValid() const diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 8ba1d1b5195b..5638967197ce 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -158,21 +158,10 @@ protected: sal_Bool bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents) sal_Bool bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings sal_Bool bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents - // --> FME 2004-06-29 #114856# Formular view -<<<<<<< local - BOOL mbFormView : 1; -======= sal_Bool bFormView : 1; ->>>>>>> other - // <-- -<<<<<<< local - BOOL mbBookview : 1; // view mode for page preview - BOOL mbBrowseMode : 1; //swmod 080130 - BOOL mbViewLayoutBookMode : 1; // book view mode for edit view -======= + sal_Bool mbBrowseMode : 1; //swmod 080130 sal_Bool bBookview : 1; // view mode for page preview sal_Bool mbViewLayoutBookMode : 1; // book view mode for edit view ->>>>>>> other sal_Bool bShowPlaceHolderFields : 1; //only used in printing! mutable bool bIdle; @@ -419,26 +408,14 @@ public: sal_Bool IsSelectionInReadonly() const {return bSelectionInReadonly;} void SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;} - // --> FME 2004-06-29 #114856# Formular view -<<<<<<< local - BOOL IsFormView() const { return mbFormView; } - void SetFormView( BOOL bSet ) { mbFormView = bSet; } -======= sal_Bool IsFormView() const { return bFormView; } void SetFormView( sal_Bool bSet ) { bFormView = bSet; } ->>>>>>> other // <-- -<<<<<<< local - inline BOOL IsPagePrevBookview() const { return mbBookview; } - inline void SetPagePrevBookview(BOOL bSet) { mbBookview = bSet; } - - inline BOOL getBrowseMode() const { return mbBrowseMode; } - inline void setBrowseMode(BOOL bSet) { mbBrowseMode = bSet; } -======= + inline sal_Bool getBrowseMode() const { return mbBrowseMode; } + inline void setBrowseMode(sal_Bool bSet) { mbBrowseMode = bSet; } inline sal_Bool IsPagePrevBookview() const { return bBookview; } inline void SetPagePrevBookview(sal_Bool bSet) { bBookview = bSet; } ->>>>>>> other sal_Bool IsAutoCompleteWords() const; diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 6a30ed257d41..64eedaf6e419 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -42,15 +42,6 @@ TYPEINIT0(SwClient); SwClient::SwClient(SwModify *pToRegisterIn) : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false) { -<<<<<<< local -======= - bModifyLocked = - bInModify = - bInDocDTOR = - bInCache = sal_False; - bInSwFntCache = sal_False; - ->>>>>>> other if(pToRegisterIn) // connect to SwModify pToRegisterIn->Add(this); @@ -101,19 +92,9 @@ SwClient::~SwClient() } -<<<<<<< local -/*************************************************************************/ -BOOL SwClient::GetInfo( SfxPoolItem& ) const -======= - // erfrage vom Client Informationen sal_Bool SwClient::GetInfo( SfxPoolItem& ) const ->>>>>>> other { -<<<<<<< local - return TRUE; // no information here, return TRUE to enable continuation -======= return sal_True; // und weiter ->>>>>>> other } @@ -198,19 +179,9 @@ void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *p LockModify(); -<<<<<<< local // mba: WTF?! -======= -#ifndef DBG_UTIL - bInModify = sal_True; -#else ->>>>>>> other if( !pOldValue ) -<<<<<<< local - bLockClientList = TRUE; -======= - bInModify = sal_True; ->>>>>>> other + bLockClientList = sal_True; else { // following Modifies shouldn't call an ASSERT @@ -225,53 +196,21 @@ void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *p case RES_REFMARK_DELETED: case RES_TOXMARK_DELETED: case RES_FIELD_DELETED: -<<<<<<< local - bLockClientList = FALSE; -======= - bInModify = sal_False; ->>>>>>> other + bLockClientList = sal_False; break; default: -<<<<<<< local - bLockClientList = TRUE; -======= - bInModify = sal_True; ->>>>>>> other + bLockClientList = sal_True; } } -<<<<<<< local ModifyBroadcast( pOldValue, pNewValue ); - bLockClientList = FALSE; -======= - SwClientIter aIter( *this ); - SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? - do - { - pLast->Modify( pOldValue, pNewValue ); - if( !pRoot ) // Baum schon Weg ?? - break; - } while( 0 != ( pLast = aIter++ )); - - bInModify = sal_False; ->>>>>>> other + bLockClientList = sal_False; UnlockModify(); } -<<<<<<< local -BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const -======= -// erfrage vom Modify Informationen - sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const ->>>>>>> other { -<<<<<<< local - BOOL bRet = TRUE; // means: continue with next one -======= sal_Bool bRet = sal_True; // bedeutet weiter zum naechsten ->>>>>>> other if( pRoot ) { @@ -364,14 +303,9 @@ SwClient* SwModify::Remove(SwClient * pDepend) pDepend->pLeft = 0; pDepend->pRight = 0; } -<<<<<<< local else { ASSERT( false, "SwModify::Remove(): pDepend nicht gefunden" ); -======= - else { - ASSERT( sal_False, "SwModify::Remove(): pDepend nicht gefunden"); ->>>>>>> other } // disconnect client from me @@ -392,19 +326,6 @@ int SwModify::GetClientCount() const return nRet; } -<<<<<<< local -/*************************************************************************/ -======= -/************************************************************************* -|* SwModify::CheckCaching( const sal_uInt16 nWhich ) -|* -|* Ersterstellung JP 25.06.95 -|* Letzte Aenderung JP 25.06.95 -*************************************************************************/ - - ->>>>>>> other - void SwModify::CheckCaching( const sal_uInt16 nWhich ) { if (isCHRATR(nWhich)) @@ -485,12 +406,7 @@ void SwDepend::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) pToTell->SwClientNotifyCall( rMod, rHint ); } -<<<<<<< local -BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const -======= - // erfrage vom Modify Informationen sal_Bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const ->>>>>>> other { return pToTell ? pToTell->GetInfo( rInfo ) : sal_True; } diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 8c80a87738ea..2e4212fea321 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -330,13 +330,8 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) if( aNew.Count() ) // keine mehr gesetzt, dann Ende !! -<<<<<<< local - NotifyClients( &aOld, &aNew ); - bWeiter = FALSE; -======= - SwModify::Modify( &aOld, &aNew ); + NotifyClients( &aOld, &aNew ); bWeiter = sal_False; ->>>>>>> other } break; case RES_FMT_CHG: @@ -358,20 +353,11 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) // Formate (und keine Frames) propagieren. // mba: the code does the opposite from what is written in the comment! ResetWritten(); -<<<<<<< local // mba: here we don't use the additional stuff from NotifyClients(). // should we?! // mba: move the code that ignores this event to the clients ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) ); - bWeiter = FALSE; -======= - SwClientIter aIter( *this ); - for( SwClient *pClient = aIter.First( TYPE(SwFmt) ); pClient; - pClient = aIter.Next() ) - pClient->Modify( pOldValue, pNewValue ); - bWeiter = sal_False; ->>>>>>> other } break; diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index f47e06b81914..8b5bf2fc5a46 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -191,11 +191,7 @@ SwCallLink::~SwCallLink() const SwFrm* pFrm; const SwFlyFrm *pFlyFrm; -<<<<<<< local - if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,FALSE) ) && -======= - if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,sal_False) ) && ->>>>>>> other + if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,sal_False) ) && 0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() ) { const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx(); @@ -212,11 +208,7 @@ SwCallLink::~SwCallLink() } } -<<<<<<< local -long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ) -======= -long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ) ->>>>>>> other +long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ) { SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm; if ( pFrm && !pFrm->IsHiddenNow() ) diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx index 0952bbb256b7..93f6e8f11738 100644 --- a/sw/source/core/crsr/callnk.hxx +++ b/sw/source/core/crsr/callnk.hxx @@ -49,11 +49,7 @@ public: bool bAktSelection ); ~SwCallLink(); -<<<<<<< local - static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ); -======= - static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ); ->>>>>>> other + static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ); }; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index db5ecf0778ca..90eac5ef7d04 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -201,13 +201,8 @@ SwPaM* SwCrsrShell::GetCrsr( sal_Bool bMakeTblCrsr ) const const SwCntntNode* pCNd; if( pTblCrsr->GetPoint()->nNode.GetIndex() && pTblCrsr->GetMark()->nNode.GetIndex() && -<<<<<<< local 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->getLayoutFrm( GetLayout() ) && - 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( GetLayout() ) ) -======= - 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->GetFrm()) ->>>>>>> other + 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->getLayoutFrm( GetLayout() ) ) { SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr; GetLayout()->MakeTblCrsrs( *pTC ); @@ -235,11 +230,7 @@ void SwCrsrShell::StartAction() nAktNdTyp = rNd.GetNodeType(); bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark(); if( ND_TEXTNODE & nAktNdTyp ) -<<<<<<< local - nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, TRUE ); -======= - nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, sal_True ); ->>>>>>> other + nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, sal_True ); else nLeftFrmPos = 0; } @@ -608,13 +599,8 @@ sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage ) SwCrsrSaveState aSaveState( *pCurCrsr ); Point& rPt = pCurCrsr->GetPtPos(); SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()-> -<<<<<<< local - getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), FALSE ); - if( pFrm && TRUE == ( bRet = GetFrmInPage( pFrm, fnWhichPage, -======= - GetFrm( &rPt, pCurCrsr->GetPoint() ); + getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), sal_False ); if( pFrm && sal_True == ( bRet = GetFrmInPage( pFrm, fnWhichPage, ->>>>>>> other fnPosPage, pCurCrsr ) ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) @@ -659,11 +645,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt ) SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); if( pCNd ) { -<<<<<<< local - pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, FALSE )->GetUpper(); -======= - pFrm = pCNd->GetFrm( &rPt, 0, sal_False )->GetUpper(); ->>>>>>> other + pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False )->GetUpper(); while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() ) pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm() : pFrm->GetUpper(); @@ -749,17 +731,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock ) else if( aPos.nNode.GetNode().IsCntntNode() ) { // im gleichen Frame gelandet? -<<<<<<< local SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm( - GetLayout(), &aCharRect.Pos(), 0, FALSE ); + GetLayout(), &aCharRect.Pos(), 0, sal_False ); SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm( - GetLayout(), &aPt, 0, FALSE ); -======= - SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aCharRect.Pos(), 0, sal_False ); - SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aPt, 0, sal_False ); ->>>>>>> other + GetLayout(), &aPt, 0, sal_False ); if( pNew == pOld ) return bRet; } @@ -1443,12 +1418,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) // Second check if mark is in repeated headline: if ( !bInRepeatedHeadline ) { -<<<<<<< local - SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )-> - getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), FALSE ); -======= - SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() ); ->>>>>>> other + SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )-> + getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), sal_False ); ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" ); if ( pMarkTblFrm ) @@ -1660,15 +1631,9 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) do { sal_Bool bAgainst; do { -<<<<<<< local - bAgainst = FALSE; - pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), - &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ); -======= bAgainst = sal_False; - pFrm = pShellCrsr->GetCntntNode()->GetFrm( - &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ); ->>>>>>> other + pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), + &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False ); // ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout // erzeugt werden, weil ja mal hier einer vorhanden war !! if ( !pFrm ) @@ -2181,22 +2146,13 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const sal_Bool bCalcFrm ) const const sal_uInt16* pST = &nStartAction; ++(*((sal_uInt16*)pST)); const Size aOldSz( GetDocSize() ); -<<<<<<< local pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() ); - --(*((USHORT*)pST)); -======= - pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() ); --(*((sal_uInt16*)pST)); ->>>>>>> other if( aOldSz != GetDocSize() ) ((SwCrsrShell*)this)->SizeChgNotify(); } else -<<<<<<< local - pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE); -======= - pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False); ->>>>>>> other + pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False); } return pRet; } @@ -2829,11 +2785,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode(); const SwCntntFrm * pFrm; -<<<<<<< local - if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),FALSE)) && -======= - if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),sal_False)) && ->>>>>>> other + if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),sal_False)) && !IsReadOnlyAvailable() && pFrm->IsProtected() && nNdIdx < rNds.GetEndOfExtras().GetIndex() ) { @@ -2949,11 +2901,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() ) { // Teste mal auf Fly - kann auch noch geschuetzt sein!! -<<<<<<< local - if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,FALSE)) || -======= - if( 0 == (pFrm = pCNd->GetFrm(0,0,sal_False)) || ->>>>>>> other + if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,sal_False)) || ( !IsReadOnlyAvailable() && pFrm->IsProtected() ) || ( bOnlyText && pCNd->IsNoTxtNode() ) ) { @@ -2985,11 +2933,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) // falls Cursor im versteckten Bereich ist, auf jedenfall schon mal // verschieben!! -<<<<<<< local - if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,FALSE) ) -======= - if( !pCNd || !pCNd->GetFrm(0,0,sal_False) ) ->>>>>>> other + if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,sal_False) ) { SwCrsrMoveState aTmpState( MV_NONE ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); @@ -3554,11 +3498,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, SwCrsrMoveState aState; aState.bRealWidth = sal_True; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); -<<<<<<< local - SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), FALSE); -======= - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), sal_False); ->>>>>>> other + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 3270ca0a0e7e..f2624677c4be 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -277,11 +277,7 @@ sal_Bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, sal_Bool bInHeader ) const SwFrm* pFrm; Point aPt( pCurCrsr->GetPtPos() ); -<<<<<<< local - if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) )) -======= - if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, sal_False ) )) ->>>>>>> other + if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False ) )) { // dann kann der Cursor ja auch hinein gesetzt werden SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -483,14 +479,8 @@ sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() ) // auch beim Einsammeln wird nur der erste Frame benutzt! -<<<<<<< local aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), - &aPt, &rPos, FALSE ) ); -======= - aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPt, &rPos, sal_False ) ); ->>>>>>> other - { const SfxPoolItem* pItem; const SwTableBox* pTBox; @@ -508,11 +498,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors const SwCntntFrm* pCFrm; SwNodeIndex aIdx( *pTBox->GetSttNd() ); const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); -<<<<<<< local - if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ) && -======= - if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ) && ->>>>>>> other + if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False ) ) && (IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { _SetGetExpFld aCmp( *pTBox ); @@ -563,12 +549,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext ) if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() ) // auch beim Einsammeln wird nur der erste Frame benutzt! aCurGEF.SetBodyPos( *rPos.nNode.GetNode(). -<<<<<<< local - GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) ); -======= - GetCntntNode()->GetFrm( &aPt, &rPos, sal_False ) ); ->>>>>>> other - + GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, sal_False ) ); { const SfxPoolItem* pItem; const SwCntntFrm* pCFrm; @@ -581,11 +562,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext ) RES_TXTATR_TOXMARK, n ) ) && 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) && ( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() && -<<<<<<< local - 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE )) && -======= - 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, sal_False )) && ->>>>>>> other + 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False )) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj. @@ -652,17 +629,10 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, // es muss immer der 1. Frame gesucht werden Point aPt; SwTxtFld* pTxtFld; -<<<<<<< local SwIterator aIter(rFldType); - BOOL bSubType = nSubType != USHRT_MAX; + bool bSubType = nSubType != USHRT_MAX; for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) && -======= - SwClientIter aIter( (SwFieldType&)rFldType ); - sal_Bool bSubType = nSubType != USHRT_MAX; - for( SwClient* pLast = aIter.First( TYPE( SwFmtFld )); pLast; pLast = aIter.Next() ) - if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && ->>>>>>> other ( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld()) ->GetInputFlag() ) && (!bSubType || (pFmtFld->GetFld()->GetSubType() @@ -670,11 +640,7 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, { SwCntntFrm* pCFrm; const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); -<<<<<<< local - if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE )) && -======= - if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, sal_False )) && ->>>>>>> other + if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False )) && ( bInReadOnly || !pCFrm->IsProtected() )) { _SetGetExpFld* pNew = new _SetGetExpFld( @@ -759,11 +725,7 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext, { // auch beim Einsammeln wird nur der erste Frame benutzt! Point aPt; -<<<<<<< local - aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) ); -======= - aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, sal_False ) ); ->>>>>>> other + aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, sal_False ) ); } sal_Bool bFound = aSrtLst.Seek_Entry( &aSrch, &nPos ); @@ -1626,13 +1588,10 @@ sal_Bool SwContentAtPos::IsInProtectSect() const const SwCntntFrm* pFrm; return pNd && ( pNd->IsInProtectSect() || -<<<<<<< local - ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,FALSE)) && -======= - ( 0 != ( pFrm = pNd->GetFrm(0,0,sal_False)) && ->>>>>>> other + ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,sal_False)) && pFrm->IsProtected() )); } + bool SwContentAtPos::IsInRTLText()const { bool bRet = false; diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index b6615ffae076..e1599db289c9 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -640,11 +640,7 @@ sal_uInt16 SwPaM::GetPageNum( sal_Bool bAtPoint, const Point* pLayPos ) const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark; if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) && -<<<<<<< local - 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, FALSE )) && -======= - 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, sal_False )) && ->>>>>>> other + 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, sal_False )) && 0 != ( pPg = pCFrm->FindPageFrm() )) return pPg->GetPhyPageNum(); return 0; @@ -687,11 +683,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const const SwCntntFrm *pFrm; if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() )) -<<<<<<< local - pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), FALSE ); -======= - pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), sal_False ); ->>>>>>> other + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), sal_False ); else pFrm = 0; @@ -719,11 +711,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode ) { if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() )) -<<<<<<< local - pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), FALSE ); -======= - pFrm = pNd->GetFrm( &aTmpPt, GetMark(), sal_False ); ->>>>>>> other + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), sal_False ); else pFrm = 0; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index ac76ca3f2d04..565500004ff3 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1175,11 +1175,7 @@ sal_Bool SwCursor::GoPrevWord() return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -<<<<<<< local -BOOL SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt ) -======= -sal_Bool SwCursor::SelectWord( const Point* pPt ) ->>>>>>> other +sal_Bool SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt ) { return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt ); } @@ -1357,11 +1353,7 @@ sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType ) return bRet; } -<<<<<<< local -BOOL SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt ) -======= -sal_Bool SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) ->>>>>>> other +sal_Bool SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt ) { SwCrsrSaveState aSave( *this ); diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 0ecc02da4e4a..ee33dd8208e3 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -193,13 +193,8 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) { const SwShellCrsr *pCrsr = _GetCrsr(); const SwFrm* pStartFrm = pFrm; -<<<<<<< local - const SwCntntNode *pCNd = pCrsr->GetCntntNode( FALSE ); - const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0; -======= const SwCntntNode *pCNd = pCrsr->GetCntntNode( sal_False ); - const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0; ->>>>>>> other + const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0; if ( bRow ) { diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx index 050306cdc8a7..7a25fe5c47a2 100644 --- a/sw/source/core/crsr/unocrsr.cxx +++ b/sw/source/core/crsr/unocrsr.cxx @@ -244,15 +244,9 @@ void SwUnoTableCrsr::MakeBoxSels() const SwCntntNode* pCNd; bool bMakeTblCrsrs = true; if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() && -<<<<<<< local 0 != ( pCNd = GetCntntNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) && - 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) ) - bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this ); //swmod 080218 -======= - 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->GetFrm() ) - bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this ); ->>>>>>> other + 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) ) + bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this ); if ( !bMakeTblCrsrs ) { diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 2dc08a28dfd5..f526e9b765a8 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -454,11 +454,7 @@ void SwVisCrsr::_SetPosAndShow() if( rNode.IsTxtNode() ) { const SwTxtNode& rTNd = *rNode.GetTxtNode(); -<<<<<<< local - const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, FALSE ); -======= - const SwFrm* pFrm = rTNd.GetFrm( 0, 0, sal_False ); ->>>>>>> other + const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, sal_False ); if ( pFrm ) { const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo(); @@ -815,13 +811,8 @@ short SwShellCrsr::MaxReplaceArived() // alte Actions beenden; die Tabellen-Frames werden angelegt und // eine SSelection kann erzeugt werden SvUShorts aArr; -<<<<<<< local - USHORT nActCnt; - ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ), -======= sal_uInt16 nActCnt; - ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(), ->>>>>>> other + ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ), *pSh = pShell; do { for( nActCnt = 0; pSh->ActionPend(); ++nActCnt ) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 3271a497f24b..c454da191cf7 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -118,13 +118,11 @@ #include #include #include -<<<<<<< local #include -======= + #include // SwWebDocShell #include // SwPrintOptions ->>>>>>> other #include #include @@ -377,13 +375,8 @@ const i18n::ForbiddenCharacters* return pRet; } -<<<<<<< local -void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang, - /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars ) -======= void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, - /*[in]*/ const i18n::ForbiddenCharacters& rFChars ) ->>>>>>> other + /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars ) { if( !xForbiddenCharsTable.isValid() ) { @@ -1104,16 +1097,9 @@ sal_uInt16 _PostItFld::GetPageNo( //sondern die des ersten Auftretens des PostIts innerhalb des selektierten //Bereichs ermittelt werden. rVirtPgNo = 0; -<<<<<<< local - USHORT nPos = GetCntnt(); + sal_uInt16 nPos = GetCntnt(); SwIterator aIter( GetFld()->GetTxtNode() ); for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) -======= - sal_uInt16 nPos = GetCntnt(); - SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() ); - for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm )); - pFrm; pFrm = (SwTxtFrm*)aIter.Next() ) ->>>>>>> other { if( pFrm->GetOfst() > nPos || (pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) ) @@ -1772,13 +1758,8 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat ) } } -<<<<<<< local rStat.nPage = GetCurrentLayout() ? GetCurrentLayout()->GetPageNum() : 0; //swmod 080218 - rStat.bModified = FALSE; -======= - rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0; rStat.bModified = sal_False; ->>>>>>> other SetDocStat( rStat ); com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aStat( rStat.nPage ? 7 : 6); @@ -2102,19 +2083,9 @@ void SwDoc::InvalidateAutoCompleteFlag() SwRootFrm* pTmpRoot = GetCurrentLayout(); if( pTmpRoot ) { -<<<<<<< local std::set aAllLayouts = GetAllLayouts(); std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));//swmod 080305 - for( ULONG nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd ) -======= - SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower(); - while ( pPage ) - { - pPage->InvalidateAutoCompleteWords(); - pPage = (SwPageFrm*)pPage->GetNext(); - } for( sal_uLong nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd ) ->>>>>>> other { SwTxtNode* pTxtNode = GetNodes()[ nNd ]->GetTxtNode(); if ( pTxtNode ) pTxtNode->SetAutoCompleteWordDirty( true ); diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index f64f37e02011..9faf35b93e40 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -70,12 +70,8 @@ #include #include #include -<<<<<<< local #include -======= #include - ->>>>>>> other #include #include #include @@ -445,28 +441,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) |* |*************************************************************************/ -<<<<<<< local -======= -void lcl_RemoveFrms( SwFrmFmt& rFmt, sal_Bool& rbFtnsRemoved ) -{ - SwClientIter aIter( rFmt ); - SwFrm *pFrm; - for( pFrm = (SwFrm*)aIter.First(TYPE(SwFrm)); pFrm; - pFrm = (SwFrm*)aIter.Next() ) - if ( !rbFtnsRemoved && pFrm->IsPageFrm() && - ((SwPageFrm*)pFrm)->IsFtnPage() ) - { - rFmt.getIDocumentLayoutAccess()->GetRootFrm()->RemoveFtns( 0, sal_False, sal_True ); - rbFtnsRemoved = sal_True; - } - else - { - pFrm->Cut(); - delete pFrm; - } -} - ->>>>>>> other // #i7983# void SwDoc::PreDelPageDesc(SwPageDesc * pDel) { @@ -497,8 +471,7 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) } } -<<<<<<< local - for ( USHORT j = 0; j < aPageDescs.Count(); ++j ) + for ( sal_uInt16 j = 0; j < aPageDescs.Count(); ++j ) { if ( aPageDescs[j]->GetFollow() == pDel ) { @@ -534,22 +507,6 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() ); } } - - if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer) - { - //Wenn jetzt noch irgendwelche Seiten auf die FrmFmt'e (Master und Left) - //Zeigen (z.B. irgendwelche Fussnotenseiten), so muessen die Seiten - //vernichtet werden. - - // Wenn wir auf Endnotenseiten stossen, schmeissen wir alle Fussnoten weg, - // anders kann die Reihenfolge der Seiten (FollowsPageDescs usw.) - // nicht garantiert werden. - sal_Bool bFtnsRemoved = sal_False; - - ::lcl_RemoveFrms( pDel->GetMaster(), bFtnsRemoved ); - ::lcl_RemoveFrms( pDel->GetLeft(), bFtnsRemoved ); - } ->>>>>>> other } // #116530# @@ -694,13 +651,8 @@ void SwDoc::PrtDataChanged() if( GetDocShell() ) GetDocShell()->UpdateFontList(); -<<<<<<< local - BOOL bDraw = TRUE; - if ( pTmpRoot ) -======= sal_Bool bDraw = sal_True; - if ( GetRootFrm() ) ->>>>>>> other + if ( pTmpRoot ) { ViewShell *pSh = GetCurrentViewShell(); if( !pSh->GetViewOptions()->getBrowseMode() || @@ -709,13 +661,8 @@ void SwDoc::PrtDataChanged() if ( GetDocShell() ) pWait = new SwWait( *GetDocShell(), sal_True ); -<<<<<<< local pTmpRoot->StartAllAction(); - bEndAction = TRUE; -======= - GetRootFrm()->StartAllAction(); bEndAction = sal_True; ->>>>>>> other bDraw = sal_False; if( pDrawModel ) @@ -881,21 +828,12 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) GetCurrentLayout()->StartAllAction(); //swmod 080218 SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR ); -<<<<<<< local - for( USHORT i = 0; i < pNodes->Count(); ++i ) -======= - for( sal_uInt16 i = 0; i < aOLENodes.Count(); ++i ) ->>>>>>> other + for( sal_uInt16 i = 0; i < pNodes->Count(); ++i ) { ::SetProgressState( i, GetDocShell() ); -<<<<<<< local SwOLENode* pOLENd = (*pNodes)[i]; - pOLENd->SetOLESizeInvalid( FALSE ); -======= - SwOLENode* pOLENd = aOLENodes[i]; - pOLENd->SetOLESizeInvalid( sal_False ); ->>>>>>> other + pOLENd->SetOLESizeInvalid( sal_false ); //Kennen wir nicht, also muss das Objekt geladen werden. //Wenn es keine Benachrichtigung wuenscht diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 5c93ac5b8201..619a193134b1 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -654,12 +654,8 @@ void SwDoc::InitDrawModel() nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID(); } -<<<<<<< local - SdrPage* pMasterPage = pDrawModel->AllocPage( FALSE ); + SdrPage* pMasterPage = pDrawModel->AllocPage( sal_False ); pDrawModel->InsertPage( pMasterPage ); -======= - pDrawModel->InsertPage( pDrawModel->AllocPage( sal_False ) ); ->>>>>>> other RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" ); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 67d14f505fb9..89552c3b1ad9 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -2529,11 +2529,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) Point aPt; -<<<<<<< local - const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE ); -======= - const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False ); _SetGetExpFld* pNew = NULL; sal_Bool bIsInBody = sal_False; @@ -2599,11 +2595,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) Point aPt; -<<<<<<< local - const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE ); -======= - const SwCntntFrm* pFrm = pCNd->GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False ); if( !pFrm ) break; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index e26669f7b604..58af4176849a 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -73,14 +73,7 @@ extern sal_uInt16 GetHtmlMode( const SwDocShell* ); using namespace ::com::sun::star; -<<<<<<< local -USHORT SwDoc::GetFlyCount( FlyCntType eType ) const -======= -/*-----------------17.02.98 08:35------------------- - ---------------------------------------------------*/ sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const ->>>>>>> other { const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts(); sal_uInt16 nSize = rFmts.Count(); @@ -183,11 +176,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, { const SwPosition *pPos = rAnch.GetCntntAnchor(); const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode(); -<<<<<<< local - const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, FALSE ) : 0; -======= - const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, sal_False ) : 0; ->>>>>>> other + const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, sal_False ) : 0; if( pOld ) aRet = pOld->Frm().Pos(); } @@ -206,15 +195,9 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, case FLY_AT_PAGE: { -<<<<<<< local - USHORT nPgNum = rAnch.GetPageNum(); - const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); - for( USHORT i = 1; (i <= nPgNum) && pPage; ++i, -======= sal_uInt16 nPgNum = rAnch.GetPageNum(); - const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower(); + const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); for( sal_uInt16 i = 1; (i <= nPgNum) && pPage; ++i, ->>>>>>> other pPage = (const SwPageFrm*)pPage->GetNext() ) if( i == nPgNum ) { @@ -526,20 +509,8 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, } // <-- -<<<<<<< local -BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, - SfxItemSet* pSet, BOOL bKeepOrient ) -======= -/*************************************************************************** - * Methode : sal_Bool SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& ) - * Beschreibung: - * Erstellt : OK 14.04.94 15:40 - * Aenderung : JP 23.04.98 - ***************************************************************************/ - sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, SfxItemSet* pSet, sal_Bool bKeepOrient ) ->>>>>>> other { sal_Bool bChgAnchor = sal_False, bFrmSz = sal_False; @@ -744,11 +715,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // OD 20.06.2003 #108784# - consider that drawing objects // can be in header/footer. Thus, by left-top-corner pTxtFrm = aPos.nNode.GetNode(). -<<<<<<< local - GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE ); -======= - GetCntntNode()->GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, sal_False ); } const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt ); pNewAnchorFrm = pTmp->FindFlyFrm(); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index d0f60e5bb058..67999d21381c 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -2045,14 +2045,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr, continue; pDest = FindFmtByName( rDestArr, pSrc->GetName() ); -<<<<<<< local - pDest->SetAuto( FALSE ); -======= pDest->SetAuto( sal_False ); -// pDest->ResetAllAttr(); -// pDest->CopyAttrs( *pSrc, sal_True ); // kopiere Attribute -//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus! ->>>>>>> other pDest->DelDiffs( *pSrc ); // #i94285#: existing instance, before copying attributes @@ -2176,12 +2169,8 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader, void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, sal_Bool bCopyPoolIds ) { -<<<<<<< local - BOOL bNotifyLayout = FALSE; - SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 -======= sal_Bool bNotifyLayout = sal_False; ->>>>>>> other + SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 rDstDesc.SetLandscape( rSrcDesc.GetLandscape() ); rDstDesc.SetNumType( rSrcDesc.GetNumType() ); diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 2d8d911cbc9c..e268f283df2b 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -303,12 +303,8 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) //pTmpRoot->UpdateFtnNums(); std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 080304 if ( bFtnDesc ) -<<<<<<< local //pTmpRoot->CheckFtnPageDescs( FALSE ); - std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), FALSE));//swmod 080304 -======= - GetRootFrm()->CheckFtnPageDescs( sal_False ); ->>>>>>> other + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), sal_False));//swmod 080304 if ( bExtra ) { //Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns @@ -375,15 +371,11 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) if ( pTmpRoot ) { if ( bFtnDesc ) -<<<<<<< local //pTmpRoot->CheckFtnPageDescs( TRUE ); { std::set aAllLayouts = GetAllLayouts(); - std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), TRUE));//swmod 080304 + std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), sal_True));//swmod 080304 } -======= - GetRootFrm()->CheckFtnPageDescs( sal_True ); ->>>>>>> other if ( bExtra ) { //Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 65dd1c51a797..2a65f13d10d0 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1935,12 +1935,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) if( pTmpRoot->IsNeedGrammarCheck() ) { -<<<<<<< local - BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell(); -======= sal_Bool bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell(); - ->>>>>>> other sal_Bool bIsAutoGrammar = sal_False; SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii( UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 9ff8e90f76b6..98ad5724f10d 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -313,11 +313,6 @@ SwDoc::SwDoc() mbUpdateExpFld = mbNewDoc = mbCopyIsMove = -<<<<<<< local - mbNoDrawUndoObj = -======= - mbBrowseMode = ->>>>>>> other mbInReading = mbInXMLImport = mbUpdateTOX = diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 93cef43b956c..72e1010da86c 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1353,23 +1353,6 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut ) { for( sal_uInt16 n = GetNumRuleTbl().Count(); n; ) { -<<<<<<< local -======= - // --> OD 2008-02-19 #refactorlists# -// SwNumRuleInfo aUpd( GetNumRuleTbl()[ --n ]->GetName() ); -// aUpd.MakeList( *this ); - -// for( sal_uLong nFirst = 0, nLast = aUpd.GetList().Count(); -// nFirst < nLast; ++nFirst ) -// { -// SwTxtNode* pTNd = aUpd.GetList().GetObject( nFirst ); -// SwClientIter aIter( *pTNd ); -// for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) ); -// pFrm; pFrm = (SwFrm*)aIter.Next() ) -// if( ((SwTxtFrm*)pFrm)->HasAnimation() ) -// ((SwTxtFrm*)pFrm)->StopAnimation( pOut ); -// } ->>>>>>> other SwNumRule::tTxtNodeList aTxtNodeList; GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList ); for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin(); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 999d797f94fe..ce17a146d40f 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -272,11 +272,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, if( pTOXMark != &rCurTOXMark && 0 != ( pMark = pTOXMark->GetTxtTOXMark()) && 0 != ( pTOXSrc = pMark->GetpTxtNd() ) && -<<<<<<< local - 0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE )) && -======= - 0 != ( pCFrm = pTOXSrc->GetFrm( &aPt, 0, sal_False )) && ->>>>>>> other + 0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, sal_False )) && ( bInReadOnly || !pCFrm->IsProtected() )) { CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() ); @@ -491,12 +487,7 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const return pFmt->GetAttrSet(); } -<<<<<<< local -const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate ) -======= - --------------------------------------------------*/ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate ) ->>>>>>> other { SwTOXBase** prBase = 0; switch(eTyp) @@ -644,12 +635,7 @@ sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const return nCnt; } -<<<<<<< local -const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const -======= - --------------------------------------------------------------------*/ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const ->>>>>>> other { const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData(); sal_uInt16 nCnt = 0; @@ -721,14 +707,7 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, return aName += String::CreateFromInt32( ++nNum ); } -<<<<<<< local -BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) -======= -/*-------------------------------------------------------------------- - - --------------------------------------------------------------------*/ sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) ->>>>>>> other { ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); @@ -1295,15 +1274,9 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode ) ::SetProgressState( 0, pDoc->GetDocShell() ); SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode(); if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() && -<<<<<<< local - //USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei - USHORT( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei - pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && -======= //sal_uInt16(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei - pTxtNd->GetFrm() && ->>>>>>> other + pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && !pTxtNd->HasHiddenParaField() && !pTxtNd->HasHiddenCharAttribute( true ) && ( !IsFromChapter() || @@ -1752,11 +1725,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, long nRightMargin; if( pPageDesc ) { -<<<<<<< local - const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, TRUE ); -======= - const SwFrm* pFrm = pTOXNd->GetFrm( 0, 0, sal_True ); ->>>>>>> other + const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, sal_True ); if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) || pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() ) // dann muss man ueber den PageDesc gehen diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 030ab6bc311c..19638c159bc1 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -357,15 +357,9 @@ sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const { SwIterator aIter( *this ); const SwNodes& rNds = GetDoc()->GetNodes(); -<<<<<<< local for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() ) if( &(pNode->GetNodes()) == &rNds ) - return TRUE; -======= - for( SwClient* pC = aIter.First(TYPE(SwCntntNode)); pC; pC = aIter.Next() ) - if( &((SwCntntNode*)pC)->GetNodes() == &rNds ) return sal_True; ->>>>>>> other return sal_False; } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 8538ff0991ea..c4e89fc12576 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -414,16 +414,9 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrm( sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const { -<<<<<<< local - USHORT nBrowseWidth = 0; + sal_uInt16 nBrowseWidth = 0; SwTabFrm* pFrm = SwIterator::FirstElement( *pSwTable->GetFrmFmt() ); if( pFrm ) -======= - sal_uInt16 nBrowseWidth = 0; - SwClientIter aIter( *(SwModify*)pSwTable->GetFrmFmt() ); - SwClient* pCli = aIter.First( TYPE( SwTabFrm )); - if( pCli ) ->>>>>>> other { nBrowseWidth = GetBrowseWidthByTabFrm( *pFrm ); } @@ -1801,11 +1794,7 @@ void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc ) SetWidths( sal_True, nAbsAvail ); if ( pRoot && pRoot->IsCallbackActionEnabled() ) -<<<<<<< local - pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225 -======= - pRoot->EndAllAction( sal_True ); //True per VirDev (Browsen ruhiger) ->>>>>>> other + pRoot->EndAllAction( sal_True ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225 } IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG ) diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index bf632eed0c02..73f6571e5ad9 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -333,13 +333,8 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt) ---------------------------------------------------------------------------*/ sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const { -<<<<<<< local - BOOL bRet = SvxNumberFormat::operator==(rNumFmt) && - GetRegisteredIn() == rNumFmt.GetRegisteredIn(); -======= sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) && - pRegisteredIn == rNumFmt.pRegisteredIn; ->>>>>>> other + GetRegisteredIn() == rNumFmt.GetRegisteredIn(); return bRet; } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index b5ca8e4f8a11..a71c0e170834 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -623,13 +623,8 @@ sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, } //Lines fuer das Layout-Update herausuchen. -<<<<<<< local - const BOOL bLayout = !IsNewModel() && - 0 != SwIterator::FirstElement( *GetFrmFmt() ); -======= const sal_Bool bLayout = !IsNewModel() && - 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) ); ->>>>>>> other + 0 != SwIterator::FirstElement( *GetFrmFmt() ); if ( bLayout ) { @@ -750,11 +745,7 @@ sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt ) SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen //Lines fuer das Layout-Update herausuchen. -<<<<<<< local - const BOOL bLayout = 0 != SwIterator::FirstElement( *GetFrmFmt() ); -======= - const sal_Bool bLayout = 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) ); ->>>>>>> other + bool bLayout = 0 != SwIterator::FirstElement( *GetFrmFmt() ); if( bLayout ) { aFndBox.SetTableLines( *this ); diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 5f4ed2c63ce5..278f0d15c8d1 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -920,13 +920,8 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, // Hier bietet sich als Optimierung an, vorhandene Frames nicht zu // zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen. -<<<<<<< local - BOOL bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() && - GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 -======= sal_Bool bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() && - GetDoc()->GetRootFrm(); ->>>>>>> other + GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 SwNode2Layout *pNode2Layout = NULL; if( bInsFrm ) { @@ -1071,29 +1066,8 @@ SwFrm* SwClearDummies( SwFrm* pFrm ) SwSectionNode::~SwSectionNode() { -<<<<<<< local // mba: test if iteration works as clients will be removed in callback m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) ); - - SwDoc* pDoc = GetDoc(); -======= - { - SwClientIter aIter( *(m_pSection->GetFmt()) ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pSectFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pSectFrm, sal_True ); - pLast = aIter.GoStart(); - } - else - pLast = aIter++; - } - } ->>>>>>> other - SwSectionFmt* pFmt = m_pSection->GetFmt(); if( pFmt ) { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index fbd54bcee102..5896792ee7c3 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -30,10 +30,6 @@ #include "precompiled_sw.hxx" #include -<<<<<<< local -======= - ->>>>>>> other #include #include #include @@ -1151,13 +1147,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > bool const bUndo(GetIDocumentUndoRedo().DoesUndo()); if (bUndo) { -<<<<<<< local -======= -// GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE ); -// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt ); -// GetIDocumentUndoRedo().AppendUndo(pUndo); - ->>>>>>> other // das Splitten vom TextNode nicht in die Undohistory aufnehmen GetIDocumentUndoRedo().DoUndo(false); } @@ -1209,11 +1198,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); // die Tabelle bekommt USHRT_MAX als default SSize pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); -<<<<<<< local -======= -// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) -// pTableFmt->SetAttr( SwFmtLayoutSplit( sal_False )); ->>>>>>> other /* #106283# If the first node in the selection is a context node and if it has an item FRAMEDIR set (no default) propagate the item to the @@ -1236,17 +1220,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > SwTable * pNdTbl = &pTblNd->GetTable(); ASSERT( pNdTbl, "kein Tabellen-Node angelegt." ) -<<<<<<< local pNdTbl->RegisterToFormat( *pTableFmt ); -======= - pTableFmt->Add( pNdTbl ); // das Frame-Format setzen - -// const sal_uInt16 nRowsToRepeat = -// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? -// rInsTblOpts.mnRowsToRepeat : -// 0; -// pNdTbl->SetRowsToRepeat( nRowsToRepeat ); ->>>>>>> other sal_Bool bUseBoxFmt = sal_False; if( !pBoxFmt->GetDepends() ) @@ -1258,32 +1232,9 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector > delete pBoxFmt; } -<<<<<<< local - ULONG nIdx = pTblNd->GetIndex(); -======= - //Orientation am Fmt der Table setzen -// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) ); -// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen - - sal_uLong nIdx = pTblNd->GetIndex(); ->>>>>>> other aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 ); -<<<<<<< local -======= - { -// SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang -// rTmp.DeleteMark(); -// rTmp.GetPoint()->nNode = *pTblNd; -// SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode ); -// rTmp.GetPoint()->nContent.Assign( pCNd, 0 ); - } - -// if( pUndo ) -// GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE ); - ->>>>>>> other SetModified(); SetFieldsDirty( true, NULL, 0 ); return pNdTbl; @@ -2575,12 +2526,7 @@ void SwTableNode::DelFrms() SwTabFrm *pFrm = aIter.First(); while ( pFrm ) { -<<<<<<< local - BOOL bAgain = FALSE; -======= sal_Bool bAgain = sal_False; - if ( pLast->IsA( TYPE(SwFrm) ) ) ->>>>>>> other { if ( !pFrm->IsFollow() ) { @@ -2647,11 +2593,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, if( pShCrsr ) aPt = pShCrsr->GetPtPos(); -<<<<<<< local - const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); -======= - const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); do { pTmpFrm = pTmpFrm->GetUpper(); } while ( !pTmpFrm->IsCellFrm() ); @@ -2876,11 +2818,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly, if( pShCrsr ) aPt = pShCrsr->GetPtPos(); -<<<<<<< local - const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); -======= - const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); do { pTmpFrm = pTmpFrm->GetUpper(); } while ( !pTmpFrm->IsCellFrm() ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 559109ae3e0b..c7a911188c88 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -28,10 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -<<<<<<< local -======= - ->>>>>>> other #include "hintids.hxx" #include #include @@ -59,14 +55,10 @@ #include "swtblfmt.hxx" #include "docary.hxx" #include "ndindex.hxx" -<<<<<<< local #include "undobj.hxx" #include "switerator.hxx" -======= #include ->>>>>>> other - using namespace ::com::sun::star; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 7c62f31f7eef..88418c899080 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -443,20 +443,14 @@ sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const else pNd = GetCntntNode(); -<<<<<<< local -======= const SwFrm* pFrm; if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, sal_False ) ) ) { ->>>>>>> other if( !pSh ) // dann die Shell vom Doc besorgen: GetDoc()->GetEditShell( &pSh ); if( pSh ) - { - const SwFrm* pFrm; - if( pNd && 0 != ( pFrm = pNd->getLayoutFrm( pSh->GetLayout(), 0, 0, FALSE ) ) ) { if ( pFrm->IsInTab() ) pFrm = pFrm->FindTabFrm(); @@ -861,13 +855,8 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const const SwCntntNode* pCNd = GetCntntNode(); Point aPt( 0, 0 ); -<<<<<<< local - const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ), - * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ) : 0; -======= - const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, sal_False ), - * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, sal_False ) : 0; ->>>>>>> other + const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ), + * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ) : 0; const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0; if( pPgFrm && pMyFrm && pPgFrm->Frm().Top() > pMyFrm->Frm().Top() ) @@ -1161,28 +1150,15 @@ sal_Bool SwCntntNode::InvalidateNumRule() return 0 != pRule; } -<<<<<<< local SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot, - const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) const -======= - -SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint, - const SwPosition *pPos, - const sal_Bool bCalcFrm ) const ->>>>>>> other + const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm ) const { return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, pPoint, pPos, bCalcFrm ); } -<<<<<<< local - -SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint, - const BOOL bCalcFrm ) const -======= SwRect SwCntntNode::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint, const sal_Bool bCalcFrm ) const ->>>>>>> other { SwRect aRet; SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this, @@ -1400,64 +1376,7 @@ void SwCntntNode::DelFrms() if( !GetDepends() ) return; -<<<<<<< local SwCntntFrm::DelFrms(*this); -======= - SwClientIter aIter( *this ); - SwCntntFrm *pFrm; - - for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm; - pFrm = (SwCntntFrm*)aIter.Next() ) - { - // --> OD 2005-12-01 #i27138# - // notify accessibility paragraphs objects about changed - // CONTENT_FLOWS_FROM/_TO relation. - // Relation CONTENT_FLOWS_FROM for current next paragraph will change - // and relation CONTENT_FLOWS_TO for current previous paragraph will change. - if ( pFrm->IsTxtFrm() ) - { - ViewShell* pViewShell( pFrm->GetShell() ); - if ( pViewShell && pViewShell->GetLayout() && - pViewShell->GetLayout()->IsAnyShellAccessible() ) - { - pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast(pFrm->FindNextCnt( true )), - dynamic_cast(pFrm->FindPrevCnt( true )) ); - } - } - // <-- - if( pFrm->HasFollow() ) - pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() ); - if( pFrm->IsFollow() ) - { - SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster(); - pMaster->SetFollow( pFrm->GetFollow() ); - pFrm->_SetIsFollow( sal_False ); - } - pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt. - //Andernfalls kann es sein, dass ein Follow - //vor seinem Master zerstoert wird, der Master - //greift dann ueber den ungueltigen - //Follow-Pointer auf fremdes Memory zu. - //Die Kette darf hier zerknauscht werden, weil - //sowieso alle zerstoert werden. - if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() && - !pFrm->GetIndPrev() ) - { - SwFtnFrm *pFtn = pFrm->FindFtnFrm(); - ASSERT( pFtn, "You promised a FtnFrm?" ); - SwCntntFrm* pCFrm; - if( !pFtn->GetFollow() && !pFtn->GetMaster() && - 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) - { - ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); - ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); - } - } - pFrm->Cut(); - delete pFrm; - } ->>>>>>> other if( IsTxtNode() ) { ((SwTxtNode*)this)->SetWrong( NULL ); @@ -2066,11 +1985,7 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos, // --> OD 2007-01-10 #i72024# // No format of the frame, because this can cause recursive layout actions -<<<<<<< local - SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, FALSE ); -======= - SwFrm* pFrm = GetFrm( &aPt, &rPos, sal_False ); ->>>>>>> other + SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, sal_False ); // <-- if ( pFrm ) diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 70ceb1e0d4ab..7c4e648f6c19 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -77,7 +77,6 @@ public: * vor oder hinter den eingefuegt werden soll. * --------------------------------------------------*/ -<<<<<<< local SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx) { if( pIdx->GetIndex() >= rNodes.Count() - 1 ) @@ -143,12 +142,8 @@ SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx) } -SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) - : pUpperFrms( NULL ), nIndex( nIdx ), bInit( FALSE ) -======= SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bSearch ) : pUpperFrms( NULL ), nIndex( nIdx ), bInit( sal_False ) ->>>>>>> other { const SwNode* pNd; if( bSearch || rNode.IsSectionNode() ) @@ -166,13 +161,8 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS else { SwNodeIndex aTmp( rNode, -1 ); -<<<<<<< local pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp ); - bMaster = TRUE; -======= - pNd = rNode.GetNodes().GoNextWithFrm( &aTmp ); bMaster = sal_True; ->>>>>>> other if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() ) pNd = NULL; // Nicht ueber den Bereich hinausschiessen } @@ -218,13 +208,8 @@ SwFrm* SwNode2LayImpl::NextFrm() return sal_False; if( !bInit ) { -<<<<<<< local pRet = pIter->First(); - bInit = TRUE; -======= - pRet = (SwFrm*)pIter->First(TYPE(SwFrm)); bInit = sal_True; ->>>>>>> other } else pRet = pIter->Next(); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 69160d5603eb..e722400e8dca 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -29,10 +29,6 @@ #include "precompiled_sw.hxx" #include -<<<<<<< local -======= - ->>>>>>> other #include #include #include @@ -704,26 +700,9 @@ SwSectionFmt::~SwSectionFmt() rSect.SetHidden(false); } } -<<<<<<< local - // mba: test iteration; objects are removed while iterating CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) ); -======= - SwClientIter aIter( *this ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pFrm, sal_True ); - pLast = aIter.GoStart(); - } - else - pLast = aIter++; - } ->>>>>>> other // hebe die Section doch mal auf SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() ); GetDoc()->GetNodes().SectionUp( &aRg ); @@ -737,18 +716,7 @@ SwSectionFmt::~SwSectionFmt() SwSection * SwSectionFmt::GetSection() const { -<<<<<<< local return SwIterator::FirstElement( *this ); -======= - if( GetDepends() ) - { - SwClientIter aIter( *(SwSectionFmt*)this ); - return (SwSectionPtr)aIter.First( TYPE(SwSection) ); - } - - ASSERT( sal_False, "keine Section als Client." ) - return 0; ->>>>>>> other } extern void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ); @@ -770,41 +738,12 @@ void SwSectionFmt::DelFrms() SwSectionFmt *pLast = aIter.First(); while ( pLast ) { -<<<<<<< local pLast->DelFrms(); pLast = aIter.Next(); -======= - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pFrm, sal_False ); - pLast = aIter.GoStart(); - } - else - { - pLast = aIter++; - } ->>>>>>> other } -<<<<<<< local - ULONG nEnde = pSectNd->EndOfSectionIndex(); - ULONG nStart = pSectNd->GetIndex()+1; -======= - // Then delete frames of the nested instances - pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwSectionFmt) ) ) - { - ((SwSectionFmt*)pLast)->DelFrms(); - } - pLast = aIter++; - } - // <-- sal_uLong nEnde = pSectNd->EndOfSectionIndex(); sal_uLong nStart = pSectNd->GetIndex()+1; ->>>>>>> other lcl_DeleteFtn( pSectNd, nStart, nEnde ); } if( pIdx ) @@ -1036,11 +975,7 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr, const SwNodeIndex* pIdx; for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() ) if( bAllSections || -<<<<<<< local - ( 0 != ( pIdx = pLast->GetCntnt(FALSE). -======= - ( 0 != ( pIdx = ((SwSectionFmt*)pLast)->GetCntnt(sal_False). ->>>>>>> other + ( 0 != ( pIdx = pLast->GetCntnt(sal_False). GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() )) { const SwSection* Dummy = pLast->GetSection(); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 5ca378199a64..d34f60952e2f 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -218,13 +218,8 @@ void SwBaseLink::DataChanged( const String& rMimeType, if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) ) { SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); -<<<<<<< local pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint ); - bUpdate = FALSE; -======= - pCntntNode->Modify( &aMsgHint, &aMsgHint ); bUpdate = sal_False; ->>>>>>> other } } @@ -443,23 +438,7 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat ) else bRes = Update(); -<<<<<<< local - bSwapIn = FALSE; -======= bSwapIn = sal_False; - - // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293 -// if ( pTBIS && pTBIS->isTouched() ) -// { -// // --> OD 2005-04-11 #i46300# - determine correct URL for the graphic -// String sGrfNm; -// GetLinkManager()->GetDisplayNames( this, 0, &sGrfNm, 0, 0 ); -// (m_pReReadThread = new ReReadThread( -// this, sGrfNm, bWaitForData, bNativFormat))->create(); -// // <-- -// } - // <-- ->>>>>>> other return bRes; } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 588deed2e69a..e501eb970121 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -546,91 +546,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster ) /************************************************************************* |* -<<<<<<< local -======= -|* SwFlyDrawContact::CreateNewRef() -|* -|* Ersterstellung MA 14. Dec. 94 -|* Letzte Aenderung MA 24. Apr. 95 -|* -|*************************************************************************/ - -SwVirtFlyDrawObj *SwFlyDrawContact::CreateNewRef( SwFlyFrm *pFly ) -{ - SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *GetMaster(), pFly ); - pDrawObj->SetModel( GetMaster()->GetModel() ); - pDrawObj->SetUserCall( this ); - - //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu - //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden - //die Master aus der Liste entfernt und fuehren von da an ein - //Schattendasein. - SdrPage* pPg( 0L ); - if ( 0 != ( pPg = GetMaster()->GetPage() ) ) - { - const sal_uInt32 nOrdNum = GetMaster()->GetOrdNum(); - pPg->ReplaceObject( pDrawObj, nOrdNum ); - } - // --> OD 2004-08-16 #i27030# - insert new instance - // into drawing page with correct order number - else - { - GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )-> - InsertObject( pDrawObj, _GetOrdNumForNewRef( pFly ) ); - } - // <-- - // --> OD 2004-12-13 #i38889# - assure, that new instance - // is in a visible layer. - MoveObjToVisibleLayer( pDrawObj ); - // <-- - return pDrawObj; -} - -/** method to determine new order number for new instance of - - OD 2004-08-16 #i27030# - Used in method - - @author OD -*/ -sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm ) -{ - sal_uInt32 nOrdNum( 0L ); - - // search for another Writer fly frame registered at same frame format - SwClientIter aIter( *GetFmt() ); - const SwFlyFrm* pFlyFrm( 0L ); - for ( pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) ); - pFlyFrm; - pFlyFrm = (SwFlyFrm*)aIter.Next() ) - { - if ( pFlyFrm != _pFlyFrm ) - { - break; - } - } - - if ( pFlyFrm ) - { - // another Writer fly frame found. Take its order number - nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum(); - } - else - { - // no other Writer fly frame found. Take order number of 'master' object - // --> OD 2004-11-11 #i35748# - use method instead - // of method to avoid a recalculation of the order number, - // which isn't intended. - nOrdNum = GetMaster()->GetOrdNumDirect(); - // <-- - } - - return nOrdNum; -} - -/************************************************************************* -|* ->>>>>>> other |* SwFlyDrawContact::Modify() |* |* Ersterstellung OK 08.11.94 10:21 @@ -2002,15 +1917,11 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) { case FLY_AT_PAGE: { -<<<<<<< local - USHORT nPgNum = pAnch->GetPageNum(); + sal_uInt16 nPgNum = pAnch->GetPageNum(); ViewShell *pShell = pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell(); if( !pShell ) break; SwRootFrm* pRoot = pShell->GetLayout(); -======= - sal_uInt16 nPgNum = pAnch->GetPageNum(); ->>>>>>> other SwPageFrm *pPage = static_cast(pRoot->Lower()); for ( sal_uInt16 i = 1; i < nPgNum && pPage; ++i ) diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 9bcc18ee8c44..db6c04ff54bd 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -1084,16 +1084,10 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView ) void SwDrawView::DeleteMarked() { SwDoc* pDoc = Imp().GetShell()->GetDoc(); -<<<<<<< local SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317 if ( pTmpRoot ) pTmpRoot->StartAllAction(); pDoc->StartUndo(UNDO_EMPTY, NULL); -======= - if ( pDoc->GetRootFrm() ) - pDoc->GetRootFrm()->StartAllAction(); - pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); ->>>>>>> other // OD 18.06.2003 #108784# - replace marked -objects by its // reference objects. { @@ -1112,14 +1106,8 @@ void SwDrawView::DeleteMarked() FmFormView::DeleteMarked(); ::FrameNotify( Imp().GetShell(), FLY_DRAG_END ); } -<<<<<<< local pDoc->EndUndo(UNDO_EMPTY, NULL); if( pTmpRoot ) pTmpRoot->EndAllAction(); //swmod 080218 -======= - pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); - if( pDoc->GetRootFrm() ) - pDoc->GetRootFrm()->EndAllAction(); ->>>>>>> other } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 29979805948a..3ed48bdf387f 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -201,12 +201,7 @@ void SwEditShell::FieldToText( SwFieldType* pType ) Push(); SwPaM* pPaM = GetCrsr(); -<<<<<<< local SwFieldHint aHint( pPaM ); -======= - sal_Bool bDDEFld = RES_DDEFLD == pType->Which(); - // Modify-Object gefunden, trage alle Felder ins Array ein ->>>>>>> other SwClientIter aIter( *pType ); for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ ) { @@ -557,13 +552,8 @@ sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const while(pFld) { if(pFld->IsFldInDoc()) -<<<<<<< local - return TRUE; - pFld = aIter.Next(); -======= return sal_True; - pFld = (SwFmtFld*)aIter.Next(); ->>>>>>> other + pFld = aIter.Next(); } } break; diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx index 53ae433308cc..ae3aed3f1ea6 100644 --- a/sw/source/core/edit/edfldexp.cxx +++ b/sw/source/core/edit/edfldexp.cxx @@ -45,14 +45,7 @@ using namespace com::sun::star; using ::rtl::OUString; -<<<<<<< local -BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const -======= -/* -----------------28.11.2002 17:53----------------- - * - * --------------------------------------------------*/ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const ->>>>>>> other { const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes(); const sal_uInt16 nSize = pFldTypes->Count(); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 3dc20356dee7..b90362cc906f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -437,13 +437,8 @@ void SwEditShell::ClearAutomaticContour() if( pNd->HasAutomaticContour() ) { StartAllAction(); -<<<<<<< local - pNd->SetContour( NULL, FALSE ); - SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); -======= pNd->SetContour( NULL, sal_False ); - SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper(); ->>>>>>> other + SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); GetDoc()->SetModified(); @@ -484,13 +479,8 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const SwNode& rNd = aIdx.GetNode(); if( rNd.IsOLENode() && rName == ((SwOLENode&)rNd).GetChartTblName() && -<<<<<<< local ((SwOLENode&)rNd).getLayoutFrm( GetLayout() ) ) - return TRUE; -======= - ((SwOLENode&)rNd).GetFrm() ) return sal_True; ->>>>>>> other aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 3e7e240ff9b0..10dcba3c1a3c 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1095,11 +1095,7 @@ uno::Reference< XSpellAlternatives > SwCrsrMoveState aState; aState.bRealWidth = sal_True; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); -<<<<<<< local - SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE); -======= - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False); ->>>>>>> other + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; @@ -1243,11 +1239,7 @@ bool SwEditShell::GetGrammarCorrection( SwCrsrMoveState aState; aState.bRealWidth = sal_True; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); -<<<<<<< local - SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE); -======= - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False); ->>>>>>> other + SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd; diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index f30db42a4460..9ae0d641a3c2 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -238,9 +238,8 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell, if( pShell->ISA( SwFEShell ) ) { SwFEShell* pFEShell = static_cast( pShell ); -<<<<<<< local bool bFirst = true; - for( USHORT i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) + for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) { SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj(); if( pObj ) @@ -249,12 +248,6 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell, bFirst = false; } } -======= - for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) - pFEShell->SelectObj( Point(), - (i==0) ? 0 : SW_ADD_SELECT, - pSdrMarkList->GetMark( i )->GetMarkedSdrObj() ); ->>>>>>> other // the old implementation would always unselect // objects, even if no new ones were selected. If this diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index d12f65a38d16..2275fddaf6ad 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -191,12 +191,7 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents) return nRet; } -<<<<<<< local -BOOL SwAuthorityFieldType::AddField(long nHandle) -======= - --------------------------------------------------*/ sal_Bool SwAuthorityFieldType::AddField(long nHandle) ->>>>>>> other { sal_Bool bRet = sal_False; for( sal_uInt16 j = 0; j < m_pDataArr->Count(); j++ ) @@ -302,14 +297,7 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) return nRet; } -<<<<<<< local -long SwAuthorityFieldType::GetHandle(USHORT nPos) -======= -/*-- 11.10.99 08:49:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos) ->>>>>>> other { long nRet = 0; if( nPos < m_pDataArr->Count() ) @@ -320,12 +308,7 @@ long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos) return nRet; } -<<<<<<< local -USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) -======= - --------------------------------------------------*/ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) ->>>>>>> other { //find the field in a sorted array of handles, #ifdef DBG_UTIL @@ -421,12 +404,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) return nRet; } -<<<<<<< local -BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const -======= - ---------------------------------------------------------------------------*/ sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -481,12 +459,7 @@ sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) c return sal_True; } -<<<<<<< local -BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; String sTmp; @@ -566,22 +539,12 @@ void SwAuthorityFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem *p NotifyClients( pOld, pNew ); } -<<<<<<< local -USHORT SwAuthorityFieldType::GetSortKeyCount() const -======= - --------------------------------------------------*/ sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const ->>>>>>> other { return m_pSortKeyArr->Count(); } -<<<<<<< local -const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const -======= - --------------------------------------------------*/ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const ->>>>>>> other { SwTOXSortKey* pRet = 0; if(m_pSortKeyArr->Count() > nIdx) @@ -590,12 +553,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const return pRet; } -<<<<<<< local -void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[]) -======= - --------------------------------------------------*/ void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[]) ->>>>>>> other { m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count()); sal_uInt16 nArrIdx = 0; @@ -713,12 +671,7 @@ const char* aFieldNames[] = "ISBN" }; -<<<<<<< local -BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const -======= - ---------------------------------------------------------------------------*/ sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const ->>>>>>> other { if(!GetTyp()) return sal_False; diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index efca89a4609d..069d4f2a798c 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -720,36 +720,13 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const return pRet; } -/* */ - const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox ) { -<<<<<<< local -======= -/* - - // oder besser ueber die Box den Frame suchen - - SwClientIter aIter( *pBox->GetFrmFmt() ); - sal_uLong nMinPos = ULONG_MAX; - const SwFrm* pFnd = 0; - for( SwFrm* pF = (SwFrm*)aIter.First( TYPE( SwCellFrm )); pF; - pF = (SwFrm*)aIter.Next() ) - { - if( pF->Frm().Y() < - } -*/ - ->>>>>>> other SwNodeIndex aIdx( *rBox.GetSttNd() ); SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx ); ASSERT( pCNd, "Box hat keinen TextNode" ); Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !! -<<<<<<< local - return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, FALSE ); -======= - return pCNd->GetFrm( &aPt, NULL, sal_False ); ->>>>>>> other + return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, sal_False ); } long lcl_GetLongBoxNum( String& rStr ) diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index faddd9a1b8b4..c06ef6cf9984 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -123,14 +123,7 @@ void SwDBFieldType::ReleaseRef() } } -<<<<<<< local -BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/* -----------------24.02.99 14:51------------------- - * - * --------------------------------------------------*/ sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -151,15 +144,8 @@ sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const } return sal_True; } -<<<<<<< local -BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= -/* -----------------24.02.99 14:51------------------- - * - * --------------------------------------------------*/ sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -421,12 +407,7 @@ void SwDBField::SetSubType(sal_uInt16 nType) } -<<<<<<< local -BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -458,12 +439,7 @@ sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const } -<<<<<<< local -BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -566,14 +542,7 @@ String SwDBNameInfField::GetFieldName() const return lcl_DBTrennConv(sStr); } -<<<<<<< local -BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------06.03.98 16:55------------------- - ---------------------------------------------------*/ sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -598,12 +567,7 @@ sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con return sal_True; } -<<<<<<< local -BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -635,22 +599,12 @@ sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return sal_True; } -<<<<<<< local -USHORT SwDBNameInfField::GetSubType() const -======= - --------------------------------------------------*/ sal_uInt16 SwDBNameInfField::GetSubType() const ->>>>>>> other { return nSubType; } -<<<<<<< local -void SwDBNameInfField::SetSubType(USHORT nType) -======= - --------------------------------------------------*/ void SwDBNameInfField::SetSubType(sal_uInt16 nType) ->>>>>>> other { nSubType = nType; } @@ -725,12 +679,7 @@ void SwDBNextSetField::SetPar1(const String& rStr) aCond = rStr; } -<<<<<<< local -BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) @@ -744,12 +693,7 @@ sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con return bRet; } -<<<<<<< local -BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) @@ -852,12 +796,7 @@ void SwDBNumSetField::SetPar2(const String& rStr) aPar2 = rStr; } -<<<<<<< local -BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) @@ -874,12 +813,7 @@ sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons return bRet; } -<<<<<<< local -BOOL SwDBNumSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) @@ -959,22 +893,12 @@ SwField* SwDBNameField::Copy() const } -<<<<<<< local -BOOL SwDBNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwDBNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { return SwDBNameInfField::QueryValue(rAny, nWhichId ); } -<<<<<<< local -BOOL SwDBNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { return SwDBNameInfField::PutValue(rAny, nWhichId ); } @@ -1014,12 +938,7 @@ String SwDBSetNumberField::Expand() const if(0 !=(GetSubType() & nsSwExtendedSubType::SUB_INVISIBLE) || nNumber == 0) return aEmptyStr; else -<<<<<<< local - return FormatNumber((USHORT)nNumber, GetFormat()); -======= return FormatNumber((sal_uInt16)nNumber, GetFormat()); - //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat())); ->>>>>>> other } //------------------------------------------------------------------------------ @@ -1048,12 +967,7 @@ SwField* SwDBSetNumberField::Copy() const return pTmp; } -<<<<<<< local -BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) @@ -1070,12 +984,7 @@ sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) c return bRet; } -<<<<<<< local -BOOL SwDBSetNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; switch( nWhichId ) diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index af709c5e9450..1c40298fba63 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -137,13 +137,8 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType, else if( pSh ) pSh->StartAction(); } -<<<<<<< local pLast->ModifyNotification( 0, &aUpdateDDE ); - bCallModify = TRUE; -======= - pLast->Modify( 0, &aUpdateDDE ); bCallModify = sal_True; ->>>>>>> other } } while( 0 != ( pLast = aIter++ )); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 0f84d40c5c1c..a21933e95404 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -247,14 +247,7 @@ sal_uInt16 SwPageNumberField::GetSubType() const return nSubType; } -<<<<<<< local -BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 10:25------------------- - ---------------------------------------------------*/ sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -285,12 +278,7 @@ sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co return sal_True; } -<<<<<<< local -BOOL SwPageNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; sal_Int16 nSet = 0; @@ -388,14 +376,7 @@ SwField* SwAuthorField::Copy() const return pTmp; } -<<<<<<< local -BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 11:15------------------- - ---------------------------------------------------*/ sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { sal_Bool bVal; switch( nWhichId ) @@ -420,12 +401,7 @@ sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwAuthorField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -541,14 +517,7 @@ SwField* SwFileNameField::Copy() const return pTmp; } -<<<<<<< local -BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 08:59------------------- - ---------------------------------------------------*/ sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -588,12 +557,7 @@ sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons return sal_True; } -<<<<<<< local -BOOL SwFileNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -724,14 +688,7 @@ SwField* SwTemplNameField::Copy() const return pTmp; } -<<<<<<< local -BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 08:59------------------- - ---------------------------------------------------*/ sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch ( nWhichId ) { @@ -757,12 +714,7 @@ sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con return sal_True; } -<<<<<<< local -BOOL SwTemplNameField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch ( nWhichId ) { @@ -886,14 +838,7 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm ) pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() ); } -<<<<<<< local -BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 11:38------------------- - ---------------------------------------------------*/ sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch ( nWhichId ) { @@ -906,12 +851,7 @@ sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwDocStatField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_False; switch ( nWhichId ) @@ -1770,12 +1710,7 @@ SwField* SwHiddenParaField::Copy() const return pFld; } -<<<<<<< local -BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch ( nWhichId ) { @@ -1795,12 +1730,7 @@ sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co return sal_True; } -<<<<<<< local -BOOL SwHiddenParaField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch ( nWhichId ) { @@ -1940,14 +1870,7 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const return (mpText) ? mpText->Count() : 1; } -<<<<<<< local -BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 13:42------------------- - ---------------------------------------------------*/ sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -2007,15 +1930,7 @@ sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwPostItField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= - -/*-----------------05.03.98 13:42------------------- - ---------------------------------------------------*/ sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -2156,14 +2071,7 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub) nType = nSub; } -<<<<<<< local -BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 14:14------------------- - ---------------------------------------------------*/ sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -2189,12 +2097,7 @@ sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwExtUserField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -2283,14 +2186,7 @@ void SwRefPageSetField::SetPar2(const String& rStr) SetOffset( (short) rStr.ToInt32() ); } -<<<<<<< local -BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 14:52------------------- - ---------------------------------------------------*/ sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -2306,12 +2202,7 @@ sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co return sal_True; } -<<<<<<< local -BOOL SwRefPageSetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -2558,12 +2449,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, } } -<<<<<<< local -BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -2579,12 +2465,7 @@ sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co return sal_True; } -<<<<<<< local -BOOL SwRefPageGetField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -2699,14 +2580,7 @@ void SwJumpEditField::SetPar2(const String& rStr) sHelp = rStr; } -<<<<<<< local -BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------05.03.98 15:00------------------- - ---------------------------------------------------*/ sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -2738,12 +2612,7 @@ sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons return sal_True; } -<<<<<<< local -BOOL SwJumpEditField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 425566999b5e..15e72ee1d7fc 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -426,14 +426,7 @@ void SwGetExpField::SetLanguage(sal_uInt16 nLng) SwValueField::SetLanguage(nLng); } -<<<<<<< local -BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------07.03.98 16:08------------------- - ---------------------------------------------------*/ sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -470,12 +463,7 @@ sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Int32 nTmp = 0; String sTmp; @@ -515,15 +503,7 @@ sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return sal_True; } -<<<<<<< local -SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, USHORT nTyp ) -======= -/*-----------------JP: 17.06.93 ------------------- - Set-Expression-Type - --------------------------------------------------*/ - SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, sal_uInt16 nTyp ) ->>>>>>> other : SwValueFieldType( pDc, RES_SETEXPFLD ), sName( rName ), pOutlChgNd( 0 ), @@ -666,14 +646,7 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd ) } } -<<<<<<< local -BOOL SwSetExpFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/* -----------------24.03.99 09:44------------------- - * - * --------------------------------------------------*/ sal_Bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -1073,14 +1046,7 @@ String SwInputField::Expand() const return sRet; } -<<<<<<< local -BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------06.03.98 11:12------------------- - ---------------------------------------------------*/ sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -1102,12 +1068,7 @@ sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwInputField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { switch( nWhichId ) { @@ -1191,12 +1152,7 @@ void SwInputField::SetSubType(sal_uInt16 nSub) nSubType = nSub; } -<<<<<<< local -BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= ---------------------------------------------------*/ sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -1261,12 +1217,7 @@ sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Int32 nTmp32 = 0; sal_Int16 nTmp16 = 0; diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index d83a38c777e6..ddcc754eab23 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -104,13 +104,8 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr ) sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, const SwTxtNode& rBehindNd, sal_uInt16 nSttPos ) { -<<<<<<< local - const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE), - *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE); -======= - const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.GetFrm(0,0,sal_False), - *pFrm = (SwTxtFrm*)rBehindNd.GetFrm(0,0,sal_False); ->>>>>>> other + const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False), + *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False); while( pFrm && !pFrm->IsInside( nSttPos ) ) pFrm = (SwTxtFrm*)pFrm->GetFollow(); @@ -396,11 +391,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_PAGE: case REF_PAGE_PGDESC: { -<<<<<<< local - const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,FALSE), -======= - const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->GetFrm(0,0,sal_False), ->>>>>>> other + const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,sal_False), *pSave = pFrm; while( pFrm && !pFrm->IsInside( nStt ) ) pFrm = (SwTxtFrm*)pFrm->GetFollow(); @@ -585,14 +576,7 @@ String SwGetRefField::GetPar2() const return Expand(); } -<<<<<<< local -BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------06.03.98 13:34------------------- - ---------------------------------------------------*/ sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { switch( nWhichId ) { @@ -664,12 +648,7 @@ sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return sal_True; } -<<<<<<< local -BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { String sTmp; switch( nWhichId ) diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index 0f2b22dbdee8..082b0b9f2a2d 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -181,14 +181,7 @@ void SwTblField::SetPar2(const String& rStr) } -<<<<<<< local -BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const -======= -/*-----------------04.03.98 10:33------------------- - ---------------------------------------------------*/ sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const ->>>>>>> other { sal_Bool bRet = sal_True; switch ( nWhichId ) @@ -220,12 +213,7 @@ sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return bRet; } -<<<<<<< local -BOOL SwTblField::PutValue( const uno::Any& rAny, USHORT nWhichId ) -======= ---------------------------------------------------*/ sal_Bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) ->>>>>>> other { sal_Bool bRet = sal_True; String sTmp; diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index d7087ed03dd2..ed851204d1b5 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -268,11 +268,7 @@ sal_Bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFl { sal_Bool bRet = sal_True; rAnchor.SetAnchor( &rPos ); -<<<<<<< local - SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, FALSE ); -======= - SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, sal_False ); ->>>>>>> other + SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, sal_False ); SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm(); if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) ) { diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 30737bb8209f..9b3d36fb6a7e 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -240,23 +240,14 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const FOREACHPAM_START(this) if( 0 != (pCNd = PCURCRSR->GetCntntNode() ) && -<<<<<<< local - 0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) ) -======= - 0 != ( pPtFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) ) ->>>>>>> other + 0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, sal_False )) ) pPtFrm = pPtFrm->FindPageFrm(); else pPtFrm = 0; if( PCURCRSR->HasMark() && -<<<<<<< local - 0 != (pCNd = PCURCRSR->GetCntntNode( FALSE ) ) && - 0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) ) -======= 0 != (pCNd = PCURCRSR->GetCntntNode( sal_False ) ) && - 0 != ( pMkFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) ) ->>>>>>> other + 0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, sal_False )) ) pMkFrm = pMkFrm->FindPageFrm(); else pMkFrm = pPtFrm; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2e423dc11069..6437b3250046 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -492,11 +492,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() ); Point aTmpPnt( rAbsPos ); GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); -<<<<<<< local - pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,FALSE ); -======= - pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm(0,&aPos,sal_False ); ->>>>>>> other + pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,sal_False ); } const SwFrm *pNewAnch; if( pTxtFrm ) diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 1138859bcc47..2ac1f14f24b2 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -79,13 +79,8 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject > if ( pNd->IsOLENode() && ((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj ) { -<<<<<<< local - bExist = TRUE; - SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() ); -======= bExist = sal_True; - SwFrm *pFrm = ((SwOLENode*)pNd)->GetFrm(); ->>>>>>> other + SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() ); if ( pFrm ) pFly = pFrm->FindFlyFrm(); break; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 88a9983af88f..82365e2500df 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1687,11 +1687,7 @@ sal_Bool SwFEShell::ImpEndCreate() // die naechste nicht READONLY Position suchen? bAtPage = true; -<<<<<<< local - pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, FALSE ); -======= - pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, sal_False ); ->>>>>>> other + pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, sal_False ); if( !bAtPage ) { @@ -2831,19 +2827,9 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const return pSct->Frm().Width(); return 0; } -<<<<<<< local -======= -/* -----------------------------2002/06/24 15:07------------------------------ ->>>>>>> other -<<<<<<< local -void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, - USHORT nSlotId) -======= - ---------------------------------------------------------------------------*/ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, sal_uInt16 nSlotId) ->>>>>>> other { SdrView* pDrawView = GetDrawView(); SdrModel* pDrawModel = pDrawView->GetModel(); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 26dc11c4b4f1..c193d4f239b8 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -1167,11 +1167,7 @@ sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos ) const SwCntntFrm *pFrm; if( 0 != ( pNd = rPos.nNode.GetNode().GetCntntNode() )) -<<<<<<< local - pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, FALSE ); -======= - pFrm = pNd->GetFrm( &aTmpPt, &rPos, sal_False ); ->>>>>>> other + pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, sal_False ); else pFrm = 0; diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 68105ee81b26..5746b07dba97 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -429,13 +429,8 @@ void SwFEShell::SetNewPageOffset( sal_uInt16 nOffset ) void SwFEShell::SetPageOffset( sal_uInt16 nOffset ) { -<<<<<<< local - const SwPageFrm *pPage = GetCurrFrm( FALSE )->FindPageFrm(); - const SwRootFrm* pDocLayout = GetLayout(); -======= const SwPageFrm *pPage = GetCurrFrm( sal_False )->FindPageFrm(); - const SwRootFrm* pLayout = GetLayout(); ->>>>>>> other + const SwRootFrm* pDocLayout = GetLayout(); while ( pPage ) { const SwFrm *pFlow = pPage->FindFirstBodyCntnt(); @@ -446,11 +441,7 @@ void SwFEShell::SetPageOffset( sal_uInt16 nOffset ) const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc(); if ( rPgDesc.GetNumOffset() ) { -<<<<<<< local - pDocLayout->SetVirtPageNum( TRUE ); -======= - pLayout->SetVirtPageNum( sal_True ); ->>>>>>> other + pDocLayout->SetVirtPageNum( sal_True ); lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this ); break; } diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index a1e38d87f194..e5f7186b7c3c 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -291,13 +291,8 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes, } const SwCntntNode *pCntNd = rCrsr.GetCntntNode(); const SwLayoutFrm *pStart = pCntNd ? -<<<<<<< local pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper() : 0; - pCntNd = rCrsr.GetCntntNode(FALSE); -======= - pCntNd->GetFrm( &aPtPos )->GetUpper() : 0; pCntNd = rCrsr.GetCntntNode(sal_False); ->>>>>>> other const SwLayoutFrm *pEnd = pCntNd ? pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper() : 0; if( pStart && pEnd ) @@ -508,13 +503,8 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd, // OD 07.11.2003 #i22135# - Also the content of the table could be // invisible - e.g. in a hidden section // Robust: check, if content was found (e.g. empty table cells) -<<<<<<< local if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL ) - return FALSE; -======= - if ( !pCNd || pCNd->GetFrm() == NULL ) return sal_False; ->>>>>>> other const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0; ASSERT( pStart, "ohne Frame geht gar nichts" ); @@ -787,11 +777,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->getLayoutFrm( rShell.GetLayout(), &pCrsr->GetPtPos() )->GetUpper(), -<<<<<<< local - *pEnd = pCrsr->GetCntntNode(FALSE)->getLayoutFrm( rShell.GetLayout(), -======= - *pEnd = pCrsr->GetCntntNode(sal_False)->GetFrm( ->>>>>>> other + *pEnd = pCrsr->GetCntntNode(sal_False)->getLayoutFrm( rShell.GetLayout(), &pCrsr->GetMkPos() )->GetUpper(); const SwLayoutFrm* pSttCell = pStart; @@ -1029,18 +1015,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, // das die 1. Headline mit drin ist. // Point aPt( rShell.GetCharRect().Pos() ); Point aPt( 0, 0 ); -<<<<<<< local const SwCntntNode* pCntNd = rPam.GetCntntNode(); const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); - pCntNd = rPam.GetCntntNode(FALSE); - const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), -======= - const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm( - &aPt )->GetUpper(), - *pEnd = rPam.GetCntntNode(sal_False)->GetFrm( ->>>>>>> other + pCntNd = rPam.GetCntntNode(sal_False); + const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); SwSelUnions aUnions; @@ -1554,17 +1534,11 @@ sal_uInt16 CheckMergeSel( const SwPaM& rPam ) // richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert, // das die 1. Headline mit drin ist. Point aPt; -<<<<<<< local const SwCntntNode* pCntNd = rPam.GetCntntNode(); const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); - pCntNd = rPam.GetCntntNode(FALSE); - const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), -======= - const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm( - &aPt )->GetUpper(), - *pEnd = rPam.GetCntntNode(sal_False)->GetFrm( ->>>>>>> other + pCntNd = rPam.GetCntntNode(sal_False); + const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPt )->GetUpper(); GetTblSel( pStart, pEnd, aBoxes, 0 ); return CheckMergeSel( aBoxes ); @@ -2094,18 +2068,12 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv, aPtPos = pShCrsr->GetPtPos(); aMkPos = pShCrsr->GetMkPos(); } -<<<<<<< local const SwCntntNode* pCntNd = rCrsr.GetCntntNode(); const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper(); - pCntNd = rCrsr.GetCntntNode(FALSE); - const SwLayoutFrm *pEnd = rCrsr.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), -======= - const SwLayoutFrm *pStart = rCrsr.GetCntntNode()->GetFrm( - &aPtPos )->GetUpper(), - *pEnd = rCrsr.GetCntntNode(sal_False)->GetFrm( ->>>>>>> other + pCntNd = rCrsr.GetCntntNode(sal_False); + const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper(); SWRECTFN( pStart->GetUpper() ) @@ -2492,15 +2460,9 @@ void _FndBox::MakeFrms( SwTable &rTable ) i >= 0 && !pSibling; --i ) { SwTableLine *pLine = pLineBehind ? pLineBehind : -<<<<<<< local - rTable.GetTabLines()[static_cast(i)]; + rTable.GetTabLines()[static_cast(i)]; SwIterator aIter( *pLine->GetFrmFmt() ); pSibling = aIter.First(); -======= - rTable.GetTabLines()[static_cast(i)]; - SwClientIter aIter( *pLine->GetFrmFmt() ); - pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) ); ->>>>>>> other while ( pSibling && ( pSibling->GetTabLine() != pLine || !lcl_IsLineOfTblFrm( *pTable, *pSibling ) || diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx index 84423605b5d0..849603e2b534 100644 --- a/sw/source/core/inc/UndoAttribute.hxx +++ b/sw/source/core/inc/UndoAttribute.hxx @@ -192,7 +192,7 @@ class SwUndoFmtAttrHelper : public SwClient public: SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true ); - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); + virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); } // release the undo object (so it is not deleted here), and return it diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index 41e89dcdd518..c5907426bf40 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -177,7 +177,7 @@ class SwUndoSetFlyFmt : public SwUndo, public SwClient sal_Bool bAnchorChgd; void PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ); - void Modify( SfxPoolItem*, SfxPoolItem* ); + void Modify( const SfxPoolItem*, const SfxPoolItem* ); void GetAnchor( SwFmtAnchor& rAnhor, sal_uLong nNode, xub_StrLen nCntnt ); public: diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx index 317e70aa22c1..7554271a63c3 100644 --- a/sw/source/core/inc/cellfrm.hxx +++ b/sw/source/core/inc/cellfrm.hxx @@ -47,17 +47,10 @@ public: SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true ); ~SwCellFrm(); -<<<<<<< local - virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; - virtual void CheckDirection( BOOL bVert ); -======= virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( sal_Bool bVert ); ->>>>>>> other // --> OD 2010-02-17 #i103961# virtual void Cut(); diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index 88c8f68c17f5..46bd79377bbb 100644 --- a/sw/source/core/inc/cntfrm.hxx +++ b/sw/source/core/inc/cntfrm.hxx @@ -53,11 +53,7 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm // <-- virtual void MakeAll(); -<<<<<<< local - void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, -======= - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &, ->>>>>>> other + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool& ); @@ -68,15 +64,9 @@ protected: sal_Bool MakePrtArea( const SwBorderAttrs & ); -<<<<<<< local virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); - virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); - virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); -======= - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); ->>>>>>> other SwCntntFrm( SwCntntNode * const, SwFrm* ); diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index bd57549a41c5..db16dd447c27 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -60,23 +60,14 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove = class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject { //darf Locken. Definiert in frmtool.cxx -<<<<<<< local friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * ); -======= - friend void AppendObjs ( const SwSpzFrmFmts *, sal_uLong, SwFrm *, SwPageFrm * ); - friend void AppendAllObjs( const SwSpzFrmFmts * ); ->>>>>>> other friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld, const SwRect* pOldPrt ); void InitDrawObj( sal_Bool bNotify ); //Wird von den CToren gerufen. void FinitDrawObj(); //Wird vom CTor gerufen. -<<<<<<< local - void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, -======= - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &, ->>>>>>> other + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); using SwLayoutFrm::CalcRel; diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 62ed01cce55d..99d7f0ce2bbc 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -344,11 +344,7 @@ class SwFrm: public SwClient, public SfxBroadcaster SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false ); -<<<<<<< local - void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, BYTE & ); -======= - void _UpdateAttrFrm( SfxPoolItem*, SfxPoolItem*, sal_uInt8 & ); ->>>>>>> other + void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 & ); SwFrm* _GetIndNext(); void SetDirFlags( sal_Bool bVert ); @@ -404,14 +400,10 @@ protected: void ColLock() { bColLocked = sal_True; } void ColUnlock() { bColLocked = sal_False; } -<<<<<<< local // Only used by SwRootFrm Ctor to get 'this' into mpRoot... void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; } - SwPageFrm *InsertPage( SwPageFrm *pSibling, BOOL bFtn ); -======= SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn ); ->>>>>>> other void PrepareMake(); void OptPrepareMake(); void MakePos(); @@ -653,12 +645,7 @@ public: // <-- inline SwFrm *FindPrev(); inline const SwPageFrm *FindPageFrm() const; -<<<<<<< local - inline const SwFtnBossFrm *FindFtnBossFrm( BOOL bFtn = FALSE ) const; -======= - inline const SwRootFrm *FindRootFrm() const; inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const; ->>>>>>> other inline const SwFrm *FindColFrm() const; inline const SwFrm *FindFooterOrHeader() const; inline const SwTabFrm *FindTabFrm() const; @@ -923,13 +910,9 @@ public: bool IsInCoveredCell() const; // FME 2007-08-30 #i81146# new loop control -<<<<<<< local - void ValidateThisAndAllLowers( const USHORT nStage ); bool KnowsFormat( const SwFmt& rFmt ) const; void RegisterToFormat( SwFmt& rFmt ); -======= void ValidateThisAndAllLowers( const sal_uInt16 nStage ); ->>>>>>> other }; inline sal_Bool SwFrm::IsInDocBody() const diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index d5157954b9bb..c264e8439092 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -139,11 +139,7 @@ const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ); // JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm // gerufen -<<<<<<< local -SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, USHORT const nFrmType, const Point* = 0, -======= -SwFrm* GetFrmOfModify( SwModify const&, sal_uInt16 const nFrmType, const Point* = 0, ->>>>>>> other +SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, sal_uInt16 const nFrmType, const Point* = 0, const SwPosition *pPos = 0, const sal_Bool bCalcFrm = sal_False ); diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx index 0158f04e7dc5..f4a098f9cb1a 100644 --- a/sw/source/core/inc/hffrm.hxx +++ b/sw/source/core/inc/hffrm.hxx @@ -39,11 +39,7 @@ protected: void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs); inline sal_Bool GetEatSpacing() const; // in hffrm.cxx public: -<<<<<<< local - SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, USHORT aType); -======= - SwHeadFootFrm(SwFrmFmt * pFrm, sal_uInt16 aType); ->>>>>>> other + SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, sal_uInt16 aType); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); virtual SwTwips GrowFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 0672251a8323..c5d63d0895ec 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -92,11 +92,7 @@ class SwPageFrm: public SwFtnBossFrm static const sal_Int8 mnBorderPxWidth; static const sal_Int8 mnShadowPxWidth; -<<<<<<< local - void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, -======= - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &, ->>>>>>> other + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); // Anpassen der max. Fussnotenhoehen in den einzelnen Spalten diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index d7c5b7cccb66..77314ff7f956 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -45,11 +45,7 @@ class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm { SwSection* pSection; -<<<<<<< local - void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, -======= - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &, ->>>>>>> other + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); void _Cut( sal_Bool bRemove ); // Is there a FtnContainer? @@ -67,13 +63,8 @@ protected: virtual void SwClientNotify( const SwModify&, const SfxHint& ); public: -<<<<<<< local SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt! - SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows -======= - SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt! SwSectionFrm( SwSectionFrm &, sal_Bool bMaster );//_Nur_ zum Erzeugen von Master/Follows ->>>>>>> other ~SwSectionFrm(); void Init(); diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index 4b839e9da0fe..786383deeecf 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -102,11 +102,7 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep ); bool Join(); -<<<<<<< local - void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &, -======= - void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &, ->>>>>>> other + void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &, SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 ); virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat ); @@ -114,13 +110,10 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm protected: virtual void MakeAll(); virtual void Format( const SwBorderAttrs *pAttrs = 0 ); - //Aendert nur die Framesize, nicht die PrtArea-SSize -<<<<<<< local - virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ); virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ); -======= + //Aendert nur die Framesize, nicht die PrtArea-SSize virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); ->>>>>>> other + public: SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das //Regist Flys rufen! @@ -136,12 +129,7 @@ public: inline SwTabFrm *GetFollow(); SwTabFrm* FindMaster( bool bFirstMaster = false ) const; -<<<<<<< local - virtual BOOL GetInfo( SfxPoolItem &rHnt ) const; -======= - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); virtual sal_Bool GetInfo( SfxPoolItem &rHnt ) const; ->>>>>>> other virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( sal_Bool bVert ); diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 0e2aaa1c0081..ec8a69f5bc88 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -249,11 +249,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew, // SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen // und im normalen Textfluss unterbringen. if( IsPageBodyFrm() ) -<<<<<<< local - pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE ); //swmod 080218 -======= - pDoc->GetRootFrm()->RemoveFtns( (SwPageFrm*)GetUpper(), sal_True, sal_False ); ->>>>>>> other + pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), sal_True, sal_False ); //swmod 080218 pSave = ::SaveCntnt( this ); //Wenn Spalten existieren, jetzt aber eine Spaltenanzahl von diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 65e0bd6734a8..918363dfc648 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1157,14 +1157,9 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const // und fuer diesen ggf. Umbrechen. //!!!!!!!!!!!Hack!!!!!!!!!!! -<<<<<<< local const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - return FALSE; -======= - if ( rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) return sal_False; ->>>>>>> other SwFrm *pPre = rThis.FindPrev(); @@ -2667,13 +2662,8 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat ) SwPageFrm *pNewPage = rThis.FindPageFrm(); if( pNewPage != pOldPage ) { -<<<<<<< local - rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, FALSE ); - ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); -======= rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, sal_False ); - ViewShell *pSh = rThis.GetShell(); ->>>>>>> other + ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); if ( pSh && !pSh->Imp()->IsUpdateExpFlds() ) pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher eledigt! diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index fe79266ac084..b6c977d249b4 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -378,7 +378,6 @@ void SwFlyFrm::DeleteCnt() |* Letzte Aenderung MA 30. Nov. 95 |* |*************************************************************************/ -<<<<<<< local sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact ) { @@ -446,10 +445,7 @@ SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact ) -void SwFlyFrm::InitDrawObj( BOOL bNotify ) -======= void SwFlyFrm::InitDrawObj( sal_Bool bNotify ) ->>>>>>> other { //ContactObject aus dem Format suchen. Wenn bereits eines existiert, so //braucht nur eine neue Ref erzeugt werden, anderfalls ist es jetzt an @@ -865,24 +861,13 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) // <-- } -<<<<<<< local void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, - BYTE &rInvFlags, -======= -void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, sal_uInt8 &rInvFlags, ->>>>>>> other SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { -<<<<<<< local - BOOL bClear = TRUE; - const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - ViewShell *pSh = getRootFrm()->GetCurrShell(); -======= sal_Bool bClear = sal_True; const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - ViewShell *pSh = GetShell(); ->>>>>>> other + ViewShell *pSh = getRootFrm()->GetCurrShell(); switch( nWhich ) { case RES_VERT_ORIENT: diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index e6f73c81c381..3d7391a3cf4e 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -195,11 +195,7 @@ void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) if ( !pCntnt ) { SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode(); -<<<<<<< local - pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, FALSE ); -======= - pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, sal_False ); ->>>>>>> other + pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, sal_False ); ASSERT( pCntnt, "Neuen Anker nicht gefunden" ); } //Flys haengen niemals an einem Follow sondern immer am diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 38f91d0e509f..8a9ef192e902 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -599,13 +599,8 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) if ( FLY_AT_PAGE == pAnch->GetAnchorId() ) { -<<<<<<< local - USHORT nPgNum = pAnch->GetPageNum(); - SwRootFrm *pRoot = getRootFrm(); -======= sal_uInt16 nPgNum = pAnch->GetPageNum(); - SwRootFrm *pRoot = FindRootFrm(); ->>>>>>> other + SwRootFrm *pRoot = getRootFrm(); SwPageFrm *pTmpPage = (SwPageFrm*)pRoot->Lower(); for ( sal_uInt16 i = 1; (i <= nPgNum) && pTmpPage; ++i, pTmpPage = (SwPageFrm*)pTmpPage->GetNext() ) @@ -627,11 +622,7 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode ); SwCntntFrm *pCntnt = GetFmt()->GetDoc()->GetNodes().GoNext( &aIdx )-> -<<<<<<< local - GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, FALSE ); -======= - GetCntntNode()->GetFrm( 0, 0, sal_False ); ->>>>>>> other + GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, sal_False ); if( pCntnt ) { SwFlyFrm *pTmp = pCntnt->FindFlyFrm(); @@ -773,13 +764,8 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove ) { -<<<<<<< local - const UINT32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum(); - getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum ); -======= const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum(); - FindRootFrm()->GetDrawPage()->RemoveObject( nOrdNum ); ->>>>>>> other + getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum ); pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum ); if ( GetUpper() ) diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index 655b5c4cba12..83712d597a51 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -47,7 +47,7 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, sal_uInt16 nArrPos ) : pFrmFmt( pFmt ), pNdIdx( (SwNodeIndex*) &rIdx ) { - sal_Bool bFnd = sal_False; + bool bFnd = false; const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); if (FLY_AT_PAGE == rAnchor.GetAnchorId()) { @@ -58,36 +58,24 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, if( RES_FLYFRMFMT == pFmt->Which() ) { // Schauen, ob es ein SdrObject dafuer gibt -<<<<<<< local SwFlyFrm* pFly = SwIterator::FirstElement(*pFmt); if( pFly ) { nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum(); - bFnd = TRUE; -======= - if( aIter.First( TYPE( SwFlyFrm) ) ) - nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(), - bFnd = sal_True; ->>>>>>> other - } + bFnd = true; + } } else if( RES_DRAWFRMFMT == pFmt->Which() ) { // Schauen, ob es ein SdrObject dafuer gibt -<<<<<<< local SwDrawContact* pContact = SwIterator::FirstElement(*pFmt); if( pContact ) { nOrdNum = pContact->GetMaster()->GetOrdNum(); - bFnd = TRUE; -======= - if( aIter.First( TYPE(SwDrawContact) ) ) - nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(), - bFnd = sal_True; ->>>>>>> other + bFnd = true; + } } } - } if( !bFnd ) { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index cf3847aa613c..18f88b99485c 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1122,11 +1122,7 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex, } } -<<<<<<< local bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib ) -======= -sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt ) ->>>>>>> other { SwIterator aIter( *pFmt ); if ( RES_FLYFRMFMT == pFmt->Which() ) @@ -1145,11 +1141,7 @@ sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt ) if ( pContact ) return pContact->GetAnchorFrm() != 0; } -<<<<<<< local return false; -======= - return sal_False; ->>>>>>> other } /** helper method to determine, if a , which has an object connected, @@ -1201,11 +1193,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib ) //will ich hier nicht. bRemove = sal_True; } -<<<<<<< local - else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) || -======= - else if ( sal_False == (bRemove = ::lcl_ObjConnected( pFmt )) || ->>>>>>> other + else if ( sal_False == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) || ::lcl_InHeaderOrFooter( *pFmt ) ) { // OD 23.06.2003 #108784# - correction: for objects in header @@ -1251,23 +1239,12 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, SwFrm *pPrv ) { pDoc->BlockIdling(); -<<<<<<< local SwRootFrm* pLayout = pLay->getRootFrm(); - const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : FALSE; + const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False; if( bOldCallbackActionEnabled ) - pLayout->SetCallbackActionEnabled( FALSE ); -======= - SwRootFrm* pLayout = pDoc->GetRootFrm(); - const sal_Bool bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False; - if(pLayout) pLayout->SetCallbackActionEnabled( sal_False ); ->>>>>>> other -<<<<<<< local - //Bei der Erzeugung des Layouts wird bPages mit TRUE uebergeben. Dann -======= //Bei der Erzeugung des Layouts wird bPages mit sal_True uebergeben. Dann ->>>>>>> other //werden schon mal alle x Absaetze neue Seiten angelegt. Bei umbruechen //und/oder Pagedescriptorwechseln werden gleich die entsprechenden Seiten //angelegt. @@ -1636,13 +1613,8 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, if ( bPages ) //Jetzt noch die Flys verbinden lassen. { if ( !bDontCreateObjects ) -<<<<<<< local AppendAllObjs( pTbl, pLayout ); - bObjsDirect = TRUE; -======= - AppendAllObjs( pTbl ); bObjsDirect = sal_True; ->>>>>>> other } if( pPageMaker ) @@ -1870,13 +1842,8 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, // und damit ruhig zerstoert werden. if( !pSct->ContainsCntnt() ) { -<<<<<<< local - pSct->DelEmpty( TRUE ); - pUpper->getRootFrm()->RemoveFromList( pSct ); -======= pSct->DelEmpty( sal_True ); - pDoc->GetRootFrm()->RemoveFromList( pSct ); ->>>>>>> other + pUpper->getRootFrm()->RemoveFromList( pSct ); delete pSct; } } @@ -3380,8 +3347,6 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ) return pPage; } -<<<<<<< local - #include class SwFrmHolder : private SfxListener { @@ -3420,12 +3385,8 @@ void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } -SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType, - const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) -======= -SwFrm* GetFrmOfModify( SwModify const& rMod, sal_uInt16 const nFrmType, +SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt16 const nFrmType, const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm ) ->>>>>>> other { SwFrm *pMinFrm = 0, *pTmpFrm; SwFrmHolder aHolder; diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 68ac053fa793..9f70bf9b05b4 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -270,7 +270,6 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) if ( !bValidSize ) { -<<<<<<< local bool bGrow = pPage->IsFtnPage(); if( bGrow ) { @@ -279,11 +278,7 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) bGrow = false; } if( bGrow ) - Grow( LONG_MAX, FALSE ); -======= - if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) Grow( LONG_MAX, sal_False ); ->>>>>>> other else { //Die Groesse in der VarSize wird durch den Inhalt plus den @@ -726,13 +721,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) |* |* Beschreibung Liefert das naechste LayoutBlatt in den das |* Frame gemoved werden kann. -<<<<<<< local -|* Neue Seiten werden nur dann erzeugt, wenn der Parameter TRUE ist. -======= |* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist. -|* Ersterstellung MA 16. Nov. 92 -|* Letzte Aenderung AMA 09. Nov. 98 ->>>>>>> other |* |*************************************************************************/ @@ -1340,17 +1329,10 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck ) SwCntntNode *pNd = aIdx.GetNode().GetCntntNode(); if ( !pNd ) pNd = pCheck->GetFmt()->GetDoc()-> -<<<<<<< local - GetNodes().GoNextSection( &aIdx, TRUE, FALSE ); + GetNodes().GoNextSection( &aIdx, sal_True, sal_False ); SwIterator aIter( *pNd ); SwFrm* pFrm = aIter.First(); while( pFrm ) -======= - GetNodes().GoNextSection( &aIdx, sal_True, sal_False ); - SwClientIter aIter( *pNd ); - SwClient* pLast = aIter.GoStart(); - while( pLast ) ->>>>>>> other { if( pFrm->getRootFrm() == pCheck->getRootFrm() ) { @@ -2788,14 +2770,9 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine ) else nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine ); -<<<<<<< local const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - nMaxFtnHeight += pBody->Grow( LONG_MAX, TRUE ); -======= - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) nMaxFtnHeight += pBody->Grow( LONG_MAX, sal_True ); ->>>>>>> other if ( IsInSct() ) nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, sal_True ); @@ -3244,11 +3221,7 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr() ASSERT( pAttr, "invalid Attribute" ); SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode(); SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() )); -<<<<<<< local - SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, FALSE ); -======= - SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, sal_False ); ->>>>>>> other + SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, sal_False ); return pCFrm; } diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 3b52ea360ead..519ca072ed59 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -119,13 +119,8 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm, } } -<<<<<<< local -SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, USHORT nTypeIn) +SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, sal_uInt16 nTypeIn) : SwLayoutFrm( pFmt, pSib ) -======= -SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, sal_uInt16 nTypeIn) - : SwLayoutFrm(pFmt) ->>>>>>> other { nType = nTypeIn; SetDerivedVert( sal_False ); @@ -717,12 +712,8 @@ void SwPageFrm::PrepareHeader() const SwFmtHeader &rH = ((SwFrmFmt*)GetRegisteredIn())->GetHeader(); -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); -======= - const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other + const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); if ( bOn && rH.IsActive() ) { //Header einsetzen, vorher entfernen falls vorhanden. @@ -772,12 +763,8 @@ void SwPageFrm::PrepareFooter() while ( pLay->GetNext() ) pLay = (SwLayoutFrm*)pLay->GetNext(); -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); -======= - const sal_Bool bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other + const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode()); if ( bOn && rF.IsActive() ) { //Footer einsetzen, vorher entfernen falls vorhanden. diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index c5606aa40878..0597876fd07f 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -437,14 +437,9 @@ sal_Bool SwLayAction::RemoveEmptyBrowserPages() { //Beim umschalten vom normalen in den Browsermodus bleiben u.U. einige //unangenehm lange stehen. Diese beseiten wir mal schnell. -<<<<<<< local - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const ViewShell *pSh = pRoot->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) -======= - sal_Bool bRet = sal_False; - if ( pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) ->>>>>>> other { SwPageFrm *pPage = (SwPageFrm*)pRoot->Lower(); do @@ -1196,14 +1191,9 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage, sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) { -<<<<<<< local - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const ViewShell *pSh = pRoot->GetCurrShell(); const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); -======= - sal_Bool bRet = sal_False; - const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other //Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst //gibts nix als Aerger. @@ -1456,17 +1446,10 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) { const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); //Einschraenkungen wegen Kopf-/Fusszeilen -<<<<<<< local if( pSh && pSh->GetViewOptions()->getBrowseMode() && !( pLay->IsCompletePaint() && pLay->FindPageFrm()->FindFtnCont() ) ) - bNoPaint = TRUE; -======= - if ( !( pLay->IsCompletePaint() && - pLay->FindPageFrm()->FindFtnCont() ) ) - { bNoPaint = sal_True; ->>>>>>> other - } + } if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) ) { @@ -1860,12 +1843,8 @@ sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect ) sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage ) { const SwCntntFrm *pCntnt = pPage->ContainsCntnt(); -<<<<<<< local const ViewShell *pSh = pRoot->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); -======= - const sal_Bool bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); while ( pCntnt && pPage->IsAnLower( pCntnt ) ) { diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 45d524b5a822..20bc750c84d3 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -444,14 +444,9 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : nAccessibleShells( 0 ) { nType = FRMC_ROOT; -<<<<<<< local - bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = TRUE; - bCheckSuperfluous = bBrowseWidthValid = FALSE; - setRootFrm( this ); -======= bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True; bCheckSuperfluous = bBrowseWidthValid = sal_False; ->>>>>>> other + setRootFrm( this ); InitCurrShells( this ); @@ -460,13 +455,8 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess(); const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess(); pTimerAccess->StopIdling(); -<<<<<<< local pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225 - bCallbackActionEnabled = FALSE; //vor Verlassen auf TRUE setzen! -======= - pLayoutAccess->SetRootFrm( this ); //Fuer das Erzeugen der Flys durch MakeFrms() bCallbackActionEnabled = sal_False; //vor Verlassen auf sal_True setzen! ->>>>>>> other SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel(); if ( pMd ) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 9d4ecc991a7f..ce2874366f72 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -575,13 +575,8 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -<<<<<<< local void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, - BYTE &rInvFlags, -======= -void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, sal_uInt8 &rInvFlags, ->>>>>>> other SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { sal_Bool bClear = sal_True; @@ -1367,13 +1362,8 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn ) { if ( bCheckPages ) { -<<<<<<< local - CheckPageDescs( pSibling, FALSE ); - ViewShell *pSh = getRootFrm()->GetCurrShell(); -======= CheckPageDescs( pSibling, sal_False ); - ViewShell *pSh = GetShell(); ->>>>>>> other + ViewShell *pSh = getRootFrm()->GetCurrShell(); SwViewImp *pImp = pSh ? pSh->Imp() : 0; if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() ) { @@ -1787,13 +1777,8 @@ void SwRootFrm::ImplCalcBrowseWidth() if ( !pFrm ) return; -<<<<<<< local - bBrowseWidthValid = TRUE; - ViewShell *pSh = getRootFrm()->GetCurrShell(); -======= bBrowseWidthValid = sal_True; - ViewShell *pSh = GetShell(); ->>>>>>> other + ViewShell *pSh = getRootFrm()->GetCurrShell(); nBrowseWidth = pSh ? MINLAY + 2 * pSh->GetOut()-> PixelToLogic( pSh->GetBrowseBorder() ).Width() diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 01b238178cf4..0614a2c7c654 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -289,13 +289,8 @@ void SwPageDesc::RegisterChange() void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { -<<<<<<< local - const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - NotifyClients( pOld, pNew ); -======= const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - SwModify::Modify( pOld, pNew ); ->>>>>>> other + NotifyClients( pOld, pNew ); if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich) || isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) ) @@ -322,11 +317,7 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd ) pMod = 0; Point aNullPt; -<<<<<<< local - return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, FALSE ) -======= - return pMod ? ::GetFrmOfModify( *pMod, nFrmType, &aNullPt, 0, sal_False ) ->>>>>>> other + return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, sal_False ) : 0; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 35207452f7c5..072e549f8341 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3086,24 +3086,14 @@ void SwRootFrm::HackPrepareLongTblPaint( int nMode ) case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" ); pLines = new SwLineRects; ASSERT( !pGlobalShell, "old GlobalShell lost" ); -<<<<<<< local pGlobalShell = GetCurrShell(); - bTableHack = TRUE; -======= - pGlobalShell = GetShell(); bTableHack = sal_True; ->>>>>>> other break; case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( sal_True ); break; case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() ); break; -<<<<<<< local - case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( FALSE ); break; - case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() ); -======= case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( sal_False ); break; - case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() ); ->>>>>>> other + case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() ); DELETEZ( pLines ); pGlobalShell = 0; bTableHack = sal_False; @@ -5728,12 +5718,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, { if ( bBack || bPageFrm || !bLowerMode ) { -<<<<<<< local - const BOOL bBrowse = pSh->GetViewOptions()->getBrowseMode(); -======= - const sal_Bool bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other - + const sal_Bool bBrowse = pSh->GetViewOptions()->getBrowseMode(); SwRect aRect; if ( (bPageFrm && bBrowse) || (IsTxtFrm() && Prt().SSize() == Frm().SSize()) ) diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index c8a19fd5694b..a5663b69660c 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -86,13 +86,8 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) : CalcEndAtEndFlag(); } -<<<<<<< local -SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, BOOL bMaster ) : - SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ), -======= SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) : - SwLayoutFrm( rSect.GetFmt() ), ->>>>>>> other + SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ), SwFlowFrm( (SwFrm&)*this ), pSection( rSect.GetSection() ) { @@ -1339,14 +1334,8 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr ) { if( !pSection ) // Durch DelEmpty { -<<<<<<< local ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" ); - bValidSize = bValidPos = bValidPrtArea = TRUE; -======= - ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), - "SectionFrm without Section" ); bValidSize = bValidPos = bValidPrtArea = sal_True; ->>>>>>> other return; } SWRECTFN( this ) @@ -1421,16 +1410,10 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr ) // OD 15.10.2002 #103517# - allow grow in online layout // Thus, set <..IsBrowseMode()> as parameter on calling // method <_CheckClipping(..)>. -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); _CheckClipping( pSh && pSh->GetViewOptions()->getBrowseMode(), bMaximize ); - bMaximize = ToMaximize( FALSE ); - bValidSize = TRUE; -======= - _CheckClipping( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), bMaximize ); bMaximize = ToMaximize( sal_False ); bValidSize = sal_True; ->>>>>>> other } //Breite der Spalten pruefen und ggf. einstellen. @@ -2494,7 +2477,6 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -<<<<<<< local void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) { const SfxSimpleHint* pSimpleHint = dynamic_cast(&rHint); @@ -2505,11 +2487,7 @@ void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) } void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, - BYTE &rInvFlags, -======= -void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, sal_uInt8 &rInvFlags, ->>>>>>> other SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { sal_Bool bClear = sal_True; diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 7ce2a0330308..639e52216b3b 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -265,13 +265,8 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo ASSERT( rTmpRow.IsRowFrm(), "No row frame to copy for FollowFlowLine" ) const SwRowFrm& rRow = (SwRowFrm&)rTmpRow; -<<<<<<< local - rTab.SetFollowFlowLine( TRUE ); - SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false ); -======= rTab.SetFollowFlowLine( sal_True ); - SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), false ); ->>>>>>> other + SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false ); pFollowFlowLine->SetRowSpanLine( bRowSpanLine ); SwFrm* pFirstRow = rTab.GetFollow()->GetFirstNonHeadlineRow(); pFollowFlowLine->InsertBefore( rTab.GetFollow(), pFirstRow ); @@ -3331,13 +3326,8 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -<<<<<<< local void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, - BYTE &rInvFlags, -======= -void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, sal_uInt8 &rInvFlags, ->>>>>>> other SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { sal_Bool bClear = sal_True; @@ -3359,13 +3349,8 @@ void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, const sal_uInt16 nNewRepeat = GetTable()->GetRowsToRepeat(); for ( sal_uInt16 nIdx = 0; nIdx < nNewRepeat; ++nIdx ) { -<<<<<<< local - bDontCreateObjects = TRUE; //frmtool - SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this ); -======= bDontCreateObjects = sal_True; //frmtool - SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ] ); ->>>>>>> other + SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this ); pHeadline->SetRepeatedHeadline( true ); bDontCreateObjects = sal_False; pHeadline->Paste( this, pLowerRow ); @@ -3637,14 +3622,9 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r nSpace = nTmpSpace; // <-- -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - nSpace += pNewUpper->Grow( LONG_MAX, TRUE ); -======= - if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) nSpace += pNewUpper->Grow( LONG_MAX, sal_True ); ->>>>>>> other } } else if( !bLockBackMove ) diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 9a2b8acc4d96..a0ae514af78b 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -892,13 +892,8 @@ sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const { ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" ); -<<<<<<< local - const SwFrm *pActFrm = GetFmt()->GetDoc()->GetNodes()[pActualCrsr->GetPoint()->nNode]-> - GetCntntNode()->getLayoutFrm( this, 0, -======= SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode(). GetCntntNode()->GetFrm( 0, ->>>>>>> other pActualCrsr->GetPoint(), sal_False ); return pActFrm->FindPageFrm()->GetPhyPageNum(); @@ -1883,13 +1878,8 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode(); const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(sal_False); -<<<<<<< local - const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, FALSE ) : 0; - const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, FALSE ) : 0; -======= - const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->GetFrm( &aPtPt, 0, sal_False ) : 0; - const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->GetFrm( &aMkPt, 0, sal_False ) : 0; ->>>>>>> other + const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, sal_False ) : 0; + const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, sal_False ) : 0; const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0; const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0; @@ -2056,21 +2046,11 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode ) //Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf //jedenfall. -<<<<<<< local - const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]-> - GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos ); -======= SwCntntFrm const* pStartFrm = pStartPos->nNode.GetNode(). - GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos ); ->>>>>>> other + GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos ); -<<<<<<< local - const SwCntntFrm *pEndFrm = rNds[ pEndPos->nNode ]-> - GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos ); -======= SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode(). - GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos ); ->>>>>>> other + GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos ); ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." ); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 50e9c4332932..9d9187c7e61c 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -128,12 +128,7 @@ void SwFrm::RegisterToFormat( SwFmt& rFmt ) rFmt.Add( this ); } -<<<<<<< local -void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse ) -======= - void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse ) ->>>>>>> other { if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) ) { @@ -297,13 +292,8 @@ void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -<<<<<<< local void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew, - BYTE &rInvFlags ) -======= -void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew, sal_uInt8 &rInvFlags ) ->>>>>>> other { sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; switch( nWhich ) @@ -1410,12 +1400,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) if ( !nDiff || !GetUpper()->IsFtnBossFrm() ) // nur innerhalb von Seiten/Spalten return 0L; -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); -======= - sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); //Der (Page)Body veraendert sich nur im BrowseMode, aber nicht wenn er //Spalten enthaelt. @@ -1912,14 +1898,9 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) nDist > (LONG_MAX - nFrmHeight ) ) nDist = LONG_MAX - nFrmHeight; -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); - const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body -======= - const sal_Bool bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body ->>>>>>> other if( !(GetUpper()->GetType() & nTmpType) && GetUpper()->HasFixSize() ) { if ( !bTst ) @@ -2217,13 +2198,8 @@ void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } -<<<<<<< local void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew, - BYTE &rInvFlags, -======= -void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew, sal_uInt8 &rInvFlags, ->>>>>>> other SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) { sal_Bool bClear = sal_True; @@ -2445,14 +2421,9 @@ SwTwips SwLayoutFrm::InnerHeight() const |*************************************************************************/ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) { -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); - const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body -======= - const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body ->>>>>>> other if( !(GetType() & nTmpType) && HasFixSize() ) return 0; @@ -2617,14 +2588,9 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) |*************************************************************************/ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) { -<<<<<<< local const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); - const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body -======= - const sal_Bool bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body ->>>>>>> other if( !(GetType() & nTmpType) && HasFixSize() ) return 0; @@ -3475,23 +3441,12 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, //3. Weiter mit 1. bis zur Stabilitaet. const SwFmtCol &rCol = rAttrs.GetAttrSet().GetCol(); -<<<<<<< local - const USHORT nNumCols = rCol.GetNumCols(); -======= const sal_uInt16 nNumCols = rCol.GetNumCols(); ->>>>>>> other - -<<<<<<< local - BOOL bEnd = FALSE; - BOOL bBackLock = FALSE; - ViewShell *pSh = getRootFrm()->GetCurrShell(); - SwViewImp *pImp = pSh ? pSh->Imp() : 0; -======= sal_Bool bEnd = sal_False; sal_Bool bBackLock = sal_False; - SwViewImp *pImp = GetShell() ? GetShell()->Imp() : 0; ->>>>>>> other + ViewShell *pSh = getRootFrm()->GetCurrShell(); + SwViewImp *pImp = pSh ? pSh->Imp() : 0; { // Zugrunde liegender Algorithmus // Es wird versucht, eine optimale Hoehe fuer die Spalten zu finden. diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 74197aee67df..e4fc3278d4e1 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2498,24 +2498,6 @@ sal_Bool SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex, rFmtIndex = 0; bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum ); -<<<<<<< local -======= - -/* -// wie bekommt man aus dem neuen String den neuen Wert? -// denn der Numberformater erkennt aus "123.--DM" kein Zahlenformat! - if( !bRet && rFmtIndex && !pNumFmtr->IsTextFormat( rFmtIndex ) && - SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_VALUE, - sal_False, &pItem )) - { - Color* pCol; - String sNewTxt; - pNumFmtr->GetOutputString( ((SwTblBoxValue*)pItem)->GetValue(), - rFmtIndex, sNewTxt, &pCol ); - bRet = aTxt == sNewTxt; - } -*/ ->>>>>>> other } else rIsEmptyTxtNd = sal_False; diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 4e89e2c53ed3..f88ac8403229 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -589,13 +589,8 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs ) // changing this method very likely requires changing of // "GetScalingOfSelectedText" -<<<<<<< local -void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax, - ULONG& rAbsMin, OutputDevice* pOut ) const//swmodtest 080307 -======= void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong& rAbsMin, OutputDevice* pOut ) const ->>>>>>> other { ViewShell* pSh = 0; GetDoc()->GetEditShell( &pSh ); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 366ede0c888e..1555fca79192 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -1243,13 +1243,8 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf ) } } -<<<<<<< local - USHORT nTop = ( nCount + 1 ) / 2; // the first character of the second line - ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell(); -======= sal_uInt16 nTop = ( nCount + 1 ) / 2; // the first character of the second line - ViewShell *pSh = rInf.GetTxtFrm()->GetShell(); ->>>>>>> other + ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell(); SwFont aTmpFont( *rInf.GetFont() ); SwFontSave aFontSave( rInf, &aTmpFont ); nProportion = 55; diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 152432de4d75..45830ec85d76 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -116,15 +116,8 @@ const PatternIni aPatternIni[] = {AUTH_FIELD_AUTHOR, AUTH_FIELD_TITLE, AUTH_FIELD_YEAR, USHRT_MAX, USHRT_MAX}, //AUTH_FIELD_CUSTOM5, {USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX} }; -<<<<<<< local -SwFormTokens lcl_GetAuthPattern(USHORT nTypeId) -======= -/* -----------------23.09.99 13:58------------------- - --------------------------------------------------*/ -// -> #i21237# SwFormTokens lcl_GetAuthPattern(sal_uInt16 nTypeId) ->>>>>>> other { SwFormTokens aRet; diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 38b143db6825..ea3b772d24d2 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -181,11 +181,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, { // dann die "Anker" (Body) Position holen. Point aPt; -<<<<<<< local - const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); -======= - const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, sal_False ); ->>>>>>> other + const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ); if( pFrm ) { SwPosition aPos( *pNd ); diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index ea961555bcf2..1135936b8d34 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -366,12 +366,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib ) if ( !m_pTxtNode ) return; -<<<<<<< local const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; - BOOL bFrmFnd = FALSE; -======= sal_Bool bFrmFnd = sal_False; ->>>>>>> other { SwIterator aIter( *m_pTxtNode ); for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 3bd6f8594c1c..e2888a208d51 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -836,13 +836,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) // true if pOut is the printer and the printer has been used for formatting const sal_Bool bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() && OUTDEV_PRINTER == rRefDev.GetOutDevType(); -<<<<<<< local - const BOOL bBrowse = ( pWin && - rInf.GetShell()->GetViewOptions()->getBrowseMode() && -======= const sal_Bool bBrowse = ( pWin && - pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) && ->>>>>>> other + rInf.GetShell()->GetViewOptions()->getBrowseMode() && !rInf.GetShell()->GetViewOptions()->IsPrtFormat() && !rInf.GetBullet() && ( rInf.GetSpace() || !rInf.GetKern() ) && diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 698be6cd1443..9baac7ad5e87 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -81,12 +81,7 @@ void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolIte } } - // erfrage vom Modify Informationen -<<<<<<< local -bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const -======= sal_Bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const ->>>>>>> other { if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode || &m_pTxtNode->GetNodes() != static_cast(rInfo).pNodes ) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 6d1d47543de8..d908fd24c18d 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -942,11 +942,7 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool ) aTmp.SetAnchor( &aPos ); // so the Layout does not get confused -<<<<<<< local - if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, FALSE ) ) -======= - if ( !pCNd || !pCNd->GetFrm( 0, 0, sal_False ) ) ->>>>>>> other + if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, sal_False ) ) { m_rFmt.DelFrms(); } diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 7a4abe803bde..0347168d9f8a 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -341,14 +341,8 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext) } else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { -<<<<<<< local - aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( rUndoIter.pAktPam )); + aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( &rContext.GetRepeatPaM() )); } -======= - aAnchor.SetPageNum( - pDoc->GetRootFrm()->GetCurrPage(& rContext.GetRepeatPaM()) ); - } ->>>>>>> other else { ASSERT( sal_False, "was fuer ein Anker ist es denn nun?" ); } diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index d7f994e54de4..5acb04c63d68 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -63,14 +63,7 @@ struct SwUndoGroupObjImpl { SwDrawFrmFmt* pFmt; SdrObject* pObj; -<<<<<<< local - ULONG nNodeIdx; -======= sal_uLong nNodeIdx; - - // OD 2004-04-15 #i26791# - keeping the anchor and the relative position - // of drawing objects no longer needed ->>>>>>> other }; @@ -392,12 +385,7 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext) { bDelFmt = sal_True; -<<<<<<< local - // remove from array - SwDoc* pDoc = &rIter.GetDoc(); -======= SwDoc *const pDoc = & rContext.GetDoc(); ->>>>>>> other SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts(); // remove from array @@ -569,14 +557,9 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext) { static_cast(rSave.pFmt)->PosAttrSet(); } -<<<<<<< local - } - rIter.pMarkList = pMarkLst; -======= // <-- } rContext.SetSelections(0, pMarkLst); ->>>>>>> other } void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext) diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 6029f6e7bfd0..f42c0ef0a7c2 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -139,13 +139,8 @@ public: sal_Bool bSaveFml = sal_True ); ~_SaveTable(); -<<<<<<< local - USHORT AddFmt( SwFrmFmt* pFmt, bool bIsLine ); - void NewFrmFmt( const SwTableLine* , const SwTableBox*, USHORT nFmtPos, -======= sal_uInt16 AddFmt( SwFrmFmt* pFmt, bool bIsLine ); - void NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine, sal_uInt16 nFmtPos, ->>>>>>> other + void NewFrmFmt( const SwTableLine* , const SwTableBox*, sal_uInt16 nFmtPos, SwFrmFmt* pOldFmt ); void RestoreAttr( SwTable& rTbl, sal_Bool bModifyBox = sal_False ); @@ -1133,13 +1128,8 @@ void _SaveTable::CreateNew( SwTable& rTbl, sal_Bool bCreateFrms, } -<<<<<<< local void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx, - USHORT nFmtPos, SwFrmFmt* pOldFmt ) -======= -void _SaveTable::NewFrmFmt( const SwClient* pLnBx, sal_Bool bIsLine, sal_uInt16 nFmtPos, SwFrmFmt* pOldFmt ) ->>>>>>> other { SwDoc* pDoc = pOldFmt->GetDoc(); @@ -1216,11 +1206,7 @@ _SaveLine::~_SaveLine() void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl ) { -<<<<<<< local rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() ); -======= - rSTbl.NewFrmFmt( &rLine, sal_True, nItemSet, rLine.GetFrmFmt() ); ->>>>>>> other _SaveBox* pBx = pBox; for( sal_uInt16 n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext ) @@ -1310,11 +1296,7 @@ _SaveBox::~_SaveBox() void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) { -<<<<<<< local rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() ); -======= - rSTbl.NewFrmFmt( &rBox, sal_False, nItemSet, rBox.GetFrmFmt() ); ->>>>>>> other if( ULONG_MAX == nSttNode ) // keine EndBox { diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 92b338a4d169..fe86698ab4ad 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1092,12 +1092,7 @@ OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException ) return C2U("SwXTextFrames"); } -<<<<<<< local -BOOL SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextFrames") == rServiceName; } @@ -1128,12 +1123,7 @@ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeExcept return C2U("SwXTextGraphicObjects"); } -<<<<<<< local -BOOL SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName; } @@ -1163,12 +1153,7 @@ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeExcep return C2U("SwXTextEmbeddedObjects"); } -<<<<<<< local -BOOL SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName; } @@ -1199,12 +1184,7 @@ OUString SwXTextSections::getImplementationName(void) throw( RuntimeException ) return C2U("SwXTextSections"); } -<<<<<<< local -BOOL SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextSections") == rServiceName; } @@ -1561,12 +1541,7 @@ OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException ) return C2U("SwXFootnotes"); } -<<<<<<< local -BOOL SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.Footnotes") == rServiceName; } @@ -1669,12 +1644,7 @@ OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException return C2U("SwXReferenceMarks"); } -<<<<<<< local -BOOL SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.ReferenceMarks") == rServiceName; } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f3fc03148bbe..449559b5272a 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -489,12 +489,7 @@ rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeExcept return C2U("SwXDrawPage"); } -<<<<<<< local -BOOL SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName; } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index b56eb7c0a535..bb2d1721d4b0 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -417,12 +417,7 @@ OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeExceptio return C2U("SwXFieldMaster"); } -<<<<<<< local -BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { sal_Bool bRet = sal_False; if(rServiceName.equalsAsciiL( @@ -969,8 +964,6 @@ void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) } } -<<<<<<< local -======= const Programmatic2UIName_Impl* lcl_GetFieldNameTable() { static sal_Bool bInitialized = sal_False; @@ -990,11 +983,7 @@ const Programmatic2UIName_Impl* lcl_GetFieldNameTable() } return &aFieldNames[0]; } - ---------------------------------------------------------------------------*/ -/* -----------------------------06.11.00 10:26-------------------------------- - ---------------------------------------------------------------------------*/ ->>>>>>> other OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc) { OUString sRet(rType.GetName()); @@ -2413,14 +2402,8 @@ OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeExc { return C2U("SwXTextFieldMasters"); } -<<<<<<< local -BOOL SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= -/* -----------------------------06.04.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextFieldMasters" )); @@ -2647,12 +2630,7 @@ OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeExcep return C2U("SwXTextFieldTypes"); } -<<<<<<< local -BOOL SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextFields" )); @@ -2745,12 +2723,7 @@ OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeExc return C2U("SwXFieldEnumeration"); } -<<<<<<< local -BOOL SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.FieldEnumeration" )); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 3466dc1cf20e..9681279c350f 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -157,22 +157,12 @@ BaseFrameProperties_Impl::~BaseFrameProperties_Impl() { } -<<<<<<< local -void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal) -======= - ---------------------------------------------------------------------------*/ void BaseFrameProperties_Impl::SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal) ->>>>>>> other { aAnyMap.SetValue( nWID, nMemberId, rVal ); } -<<<<<<< local -sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& rpAny) -======= - ---------------------------------------------------------------------------*/ sal_Bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny) ->>>>>>> other { return aAnyMap.FillValue( nWID, nMemberId, rpAny ); } @@ -742,12 +732,7 @@ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException ) return C2U("SwXFrame"); } -<<<<<<< local -BOOL SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")|| !rServiceName.compareToAscii("com.sun.star.text.TextContent") || diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index cc4a31c5af9b..a3f23ea6bfb4 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1247,31 +1247,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, case WID_INDEX_MARKS: { SwTOXMarks aMarks; -<<<<<<< local const SwTOXType* pType = pTOXBase->GetTOXType(); SwTOXMark::InsertTOXMarks( aMarks, *pType ); uno::Sequence< uno::Reference > aXMarks(aMarks.Count()); uno::Reference* pxMarks = aXMarks.getArray(); - for(USHORT i = 0; i < aMarks.Count(); i++) -======= - SwTOXType const*const pType = pTOXBase->GetTOXType(); - SwClientIter aIter(*pType); - SwTOXMark * pMark = - static_cast(aIter.First(TYPE(SwTOXMark))); - while( pMark ) - { - if(pMark->GetTxtTOXMark()) - { - aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count()); - } - pMark = static_cast(aIter.Next()); - } - uno::Sequence< uno::Reference > - aXMarks(aMarks.Count()); - uno::Reference* pxMarks = - aXMarks.getArray(); for(sal_uInt16 i = 0; i < aMarks.Count(); i++) ->>>>>>> other { SwTOXMark* pMark = aMarks.GetObject(i); pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark( diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index 9061d6b9af5d..666c80a17bc7 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -111,12 +111,7 @@ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException ) return C2U("SwXRedlines"); } -<<<<<<< local -BOOL SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/) -======= - -----------------------------------------------------------------------*/ sal_Bool SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/) ->>>>>>> other throw( uno::RuntimeException ) { DBG_ERROR("not implemented"); @@ -157,12 +152,7 @@ SwXRedlineEnumeration::~SwXRedlineEnumeration() { } -<<<<<<< local -BOOL SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException ) -======= - -----------------------------------------------------------------------*/ sal_Bool SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException ) ->>>>>>> other { if(!pDoc) throw uno::RuntimeException(); @@ -188,12 +178,7 @@ rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::Run return C2U("SwXRedlineEnumeration"); } -<<<<<<< local -BOOL SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException ) -======= - -----------------------------------------------------------------------*/ sal_Bool SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException ) ->>>>>>> other { return sal_False; } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 744336bf11c2..79f2b127dcac 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1241,17 +1241,8 @@ OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXCell"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:20-------------------------------- ->>>>>>> other - -<<<<<<< local -BOOL SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ + sal_Bool SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { String sServiceName(rServiceName); return sServiceName.EqualsAscii("com.sun.star.text.CellProperties"); @@ -1273,17 +1264,8 @@ OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeExcepti { return C2U("SwXTextTableRow"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:20-------------------------------- ->>>>>>> other -<<<<<<< local -BOOL SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextTableRow") == rServiceName; } @@ -1470,17 +1452,8 @@ OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeExce { return C2U("SwXTextTableCursor"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:21-------------------------------- ->>>>>>> other -<<<<<<< local -BOOL SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TextTableCursor") == rServiceName; } @@ -1918,15 +1891,8 @@ SwTableProperties_Impl::SwTableProperties_Impl() SwTableProperties_Impl::~SwTableProperties_Impl() { } -<<<<<<< local -void SwTableProperties_Impl::SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& rVal) -======= -/* -----------------22.06.98 09:51------------------- - * - * --------------------------------------------------*/ void SwTableProperties_Impl::SetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rVal) ->>>>>>> other { aAnyMap.SetValue( nWhichId, nMemberId, rVal ); } @@ -3621,17 +3587,8 @@ OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException { return C2U("SwXCellRange"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:21-------------------------------- ->>>>>>> other -<<<<<<< local -BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.text.CellRange" ) ) || @@ -4596,17 +4553,8 @@ OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException { return C2U("SwXTableRows"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:22-------------------------------- ->>>>>>> other -<<<<<<< local -BOOL SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TableRows") == rServiceName; } @@ -4822,17 +4770,8 @@ OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeExcepti { return C2U("SwXTableColumns"); } -<<<<<<< local -======= -/* -----------------------------19.04.00 15:23-------------------------------- ->>>>>>> other -<<<<<<< local -BOOL SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -======= - ---------------------------------------------------------------------------*/ sal_Bool SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) ->>>>>>> other { return C2U("com.sun.star.text.TableColumns") == rServiceName; } diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index ef99855c0472..994841e6787f 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -272,11 +272,7 @@ sal_Bool SwViewImp::IsDragPossible( const Point &rPoint ) SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj(); SwRect aRect; -<<<<<<< local - if( pO && ::CalcClipRect( pO, aRect, FALSE ) ) -======= - if( ::CalcClipRect( pO, aRect, sal_False ) ) ->>>>>>> other + if( pO && ::CalcClipRect( pO, aRect, sal_False ) ) { SwRect aTmp; ::CalcClipRect( pO, aTmp, sal_True ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index e24ff471ad78..f83d1e1e03e1 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1651,26 +1651,16 @@ void ViewShell::PaintDesktop( const SwRect &rRect ) //Kann z.B. waehrend des Idle'ns zwischenzeitlich auftreten. //Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten, //den diese werden spaeter beim VisPortChgd ausgespart. -<<<<<<< local - BOOL bBorderOnly = FALSE; - const SwRootFrm *pRoot = GetLayout();//swmod 080305 -======= sal_Bool bBorderOnly = sal_False; - const SwRootFrm *pRoot = GetDoc()->GetRootFrm(); ->>>>>>> other + const SwRootFrm *pRoot = GetLayout();//swmod 080305 if ( rRect.Top() > pRoot->Frm().Bottom() ) { const SwFrm *pPg = pRoot->Lower(); while ( pPg && pPg->GetNext() ) pPg = pPg->GetNext(); if ( !pPg || !pPg->Frm().IsOver( VisArea() ) ) -<<<<<<< local - bBorderOnly = TRUE; - } //swmod 071108//swmod 071225 -======= bBorderOnly = sal_True; } ->>>>>>> other const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode(); @@ -2312,29 +2302,18 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) // Wenn kein ReferenzDevice (Drucker) zum Formatieren benutzt wird, // sondern der Bildschirm, muss bei Zoomfaktoraenderung neu formatiert // werden. -<<<<<<< local if( pOpt->getBrowseMode() ) - bReformat = TRUE; -======= - if( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) bReformat = sal_True; ->>>>>>> other } -<<<<<<< local bool bBrowseModeChanged = false; if( pOpt->getBrowseMode() != rOpt.getBrowseMode() ) { bBrowseModeChanged = true; - bReformat = TRUE; + bReformat = sal_True; } else if( pOpt->getBrowseMode() && pOpt->IsPrtFormat() != rOpt.IsPrtFormat() ) - bReformat = TRUE; -======= - if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && - pOpt->IsPrtFormat() != rOpt.IsPrtFormat() ) bReformat = sal_True; ->>>>>>> other if ( HasDrawView() || rOpt.IsGridVisible() ) { @@ -2476,14 +2455,8 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet) { if( bSet != pOpt->IsPDFExport() ) { -<<<<<<< local if( bSet && pOpt->getBrowseMode() ) - pOpt->SetPrtFormat( TRUE ); -======= - if( bSet && - getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) pOpt->SetPrtFormat( sal_True ); ->>>>>>> other pOpt->SetPDFExport(bSet); } } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 031da20042d2..1aa1d91b2f94 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -32,10 +32,7 @@ #include #include #include -<<<<<<< local -======= #include ->>>>>>> other #include #include #include diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index f487e680f3f9..638d5ab80aa9 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -341,23 +341,13 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax ) { SET_CURR_SHELL( this ); -<<<<<<< local SwRootFrm* pMyLayout = GetLayout(); -======= - SwRootFrm* pLayout = GetLayout(); - // sal_uLong nStatMax = pLayout->GetPageNum(); ->>>>>>> other const SwFrm *pPage = pMyLayout->Lower(); SwLayAction aAction( pMyLayout, Imp() ); -<<<<<<< local pMyLayout->StartAllAction(); - for ( USHORT i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i ) -======= - pLayout->StartAllAction(); for ( sal_uInt16 i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i ) ->>>>>>> other { pPage->Calc(); SwRect aOldVis( VisArea() ); @@ -636,13 +626,8 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat if ( pSh->GetViewOptions()->getBrowseMode() && pSh->GetNext() == pSh ) { -<<<<<<< local - pSh->CheckBrowseView( FALSE ); - pSh->GetLayout()->Lower()->InvalidateSize(); -======= pSh->CheckBrowseView( sal_False ); - pDoc->GetRootFrm()->Lower()->InvalidateSize(); ->>>>>>> other + pSh->GetLayout()->Lower()->InvalidateSize(); } // --> FME 2005-02-10 #119474# diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index e46b0f3b106a..9dc59a4aca19 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -909,35 +909,6 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False ); return aPageRect.SVRect(); -<<<<<<< local -======= - - // Why does this have to be that complicated? I replaced this by the - // call of FindPageFrmRect(): - /* - //PageDesc besorgen, vom ersten Absatz oder den default. - const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc(); - const SwPageDesc* pDesc = rDesc.GetPageDesc(); - if( !pDesc ) - pDesc = &const_cast(pDoc)->GetPageDesc( 0 ); - - //Das Format wird evtl. von der virtuellen Seitennummer bestimmt. - const sal_uInt16 nPgNum = rDesc.GetNumOffset(); - const sal_Bool bOdd = nPgNum % 2 ? sal_True : sal_False; - const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt(); - if ( !pFmt ) //#40568# - pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt(); - - if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX ) - //Jetzt wird es aber Zeit fuer die Initialisierung - pDoc->getPrinter( true ); - - const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize(); - const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() ); - const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER ); - const Rectangle aRect( aPt, aSz ); - return aRect;*/ ->>>>>>> other } return SfxObjectShell::GetVisArea( nAspect ); } @@ -1017,12 +988,8 @@ void SwDocShell::GetState(SfxItemSet& rSet) { case SID_PRINTPREVIEW: { -<<<<<<< local - BOOL bDisable = IsInPlaceActive(); - // Disable "multiple layout" -======= sal_Bool bDisable = IsInPlaceActive(); ->>>>>>> other + // Disable "multiple layout" if ( !bDisable ) { SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 0d44efe7a250..9c867a90bf08 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1178,63 +1178,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); break; -<<<<<<< local -======= - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - sal_Bool bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static sal_uInt16 __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - ->>>>>>> other case SID_MAIL_PREPAREEXPORT: { //pWrtShell is not set in page preview @@ -1820,84 +1763,8 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -<<<<<<< local -ULONG SwDocShell::LoadStylesFromFile( const String& rURL, - SwgReaderOption& rOpt, BOOL bUnoCall ) -======= -/* -----------------------------14.12.99 16:52-------------------------------- - - ---------------------------------------------------------------------------*/ -void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) -{ - GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); - UpdateFontList(); - SwView* pTempView = _pView ? _pView : (SwView*)GetView(); - if( pTempView ) - { - SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings(); - rBind.Invalidate(FN_SHADOWCURSOR); - rBind.Invalidate(SID_BROWSER_MODE); - rBind.Invalidate(FN_PRINT_LAYOUT); - - if( !GetDoc()->getPrinter( false ) ) - { - pTempView->SetPrinter( GetDoc()->getPrinter( false ), - SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); - } - - // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in - // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) - GetDoc()->CheckDefaultPageFmt(); - // <-- - - // Currently there can be only one view (layout) if the document is viewed in Web layout - // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); - do { - if( pTmpFrm != pTempView->GetViewFrame() ) - { - pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); - } - else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False); - - } while ( pTmpFrm ); - - const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - - // set view columns before toggling: - if ( bSet ) - { - const sal_uInt16 nColumns = rViewOptions.GetViewLayoutColumns(); - const bool bBookMode = rViewOptions.IsViewLayoutBookMode(); - if ( 1 != nColumns || bBookMode ) - { - ((SwView*)GetView())->SetViewLayout( 1, false ); - } - } - - // Triggeres a formatting: - pTempView->GetWrtShell().CheckBrowseView( sal_True ); - pTempView->CheckVisArea(); - - if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) - { - const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); - - if ( SVX_ZOOM_PERCENT != eType) - { - ((SwView*)GetView())->SetZoom( eType ); - } - } - pTempView->InvalidateBorder(); - pTempView->SetNewWindowAllowed(!bSet); - } -} - sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, sal_Bool bUnoCall ) ->>>>>>> other { sal_uLong nErr = 0; diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 82df13bedcbf..91c174478915 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -216,20 +216,11 @@ SwViewOption::SwViewOption() : bIsPagePreview(sal_False), bSelectionInReadonly(sal_False), // --> FME 2004-06-29 #114856# Formular view -<<<<<<< local - mbFormView(FALSE), -======= bFormView(sal_False), ->>>>>>> other // <-- -<<<<<<< local - mbBookview(FALSE), - mbBrowseMode(FALSE), - mbViewLayoutBookMode(FALSE), -======= bBookview(sal_False), + mbBrowseMode(sal_False), mbViewLayoutBookMode(sal_False), ->>>>>>> other bShowPlaceHolderFields( sal_True ), nZoom( 100 ), diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 3e89baa7bf8d..e01be411c866 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1034,13 +1034,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) sal_uInt16 nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator ); sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos ); -<<<<<<< local - SwDDEFieldType aTyp( rData.sPar1, sCmd, (USHORT)nFormatId ); - SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType( aTyp ); -======= SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType( SwDDEFieldType( rData.sPar1, sCmd, (sal_uInt16)nFormatId )); ->>>>>>> other pFld = new SwDDEField( pTyp ); break; } diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 8ffc9d519e88..7abdbbb85d7b 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1251,30 +1251,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) SwViewOption aOpt( *pPrefs ); -<<<<<<< local - aOpt.SetPagePreview(TRUE); - aOpt.SetTab( FALSE ); - aOpt.SetBlank( FALSE ); - aOpt.SetHardBlank( FALSE ); - aOpt.SetParagraph( FALSE ); - aOpt.SetLineBreak( FALSE ); - aOpt.SetPageBreak( FALSE ); - aOpt.SetColumnBreak( FALSE ); - aOpt.SetSoftHyph( FALSE ); - aOpt.SetFldName( FALSE ); - aOpt.SetPostIts( FALSE ); - aOpt.SetShowHiddenChar( FALSE ); - aOpt.SetShowHiddenField( FALSE ); - aOpt.SetShowHiddenPara( FALSE ); - aOpt.SetViewHRuler( FALSE ); - aOpt.SetViewVRuler( FALSE ); - aOpt.SetGraphic( TRUE ); - aOpt.SetTable( TRUE ); - aOpt.SetSnap( FALSE ); - aOpt.SetGridVisible( FALSE ); - aOpt.setBrowseMode( FALSE ); - -======= aOpt.SetPagePreview(sal_True); aOpt.SetTab( sal_False ); aOpt.SetBlank( sal_False ); @@ -1295,7 +1271,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) aOpt.SetTable( sal_True ); aOpt.SetSnap( sal_False ); aOpt.SetGridVisible( sal_False ); ->>>>>>> other + GetViewShell()->ApplyViewOptions( aOpt ); GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions()); @@ -1303,16 +1279,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); -<<<<<<< local -======= - IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess(); - if( pIDSA->get(IDocumentSettingAccess::BROWSE_MODE)) - { - pIDSA->set(IDocumentSettingAccess::BROWSE_MODE, false); - pESh->CheckBrowseView( sal_True ); - } - ->>>>>>> other GetViewShell()->CalcLayout(); DocSzChgd( GetViewShell()->GetDocSize() ); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 4b7daf8b3d93..f2628d48dde8 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -306,13 +306,8 @@ void SwSrcView::Init() aEditWin.SetReadonly(sal_True); } -// StartListening(*GetViewFrame()); -<<<<<<< local SetNewWindowAllowed( sal_False ); - StartListening(*pDocShell,TRUE); -======= StartListening(*pDocShell,sal_True); ->>>>>>> other } /*-------------------------------------------------------------------- diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 43f9c490ea2c..c1ac5c30585c 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -848,15 +848,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); bOldShellWasPagePreView = sal_True; } -<<<<<<< local - else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) - bOldShellWasSrcView = TRUE; - } -======= - else if( pExistingSh && - pExistingSh->IsA( TYPE( SwSrcView ) ) ) + else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) bOldShellWasSrcView = sal_True; ->>>>>>> other RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" ); if(PTR_CAST( SwView, pExistingSh)) @@ -984,12 +977,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pWrtShell->DoUndo( 0 != SW_MOD()->GetUndoOptions().GetUndoCount() ); -<<<<<<< local - const BOOL bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); // Disable "multiple window" -======= - const sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other SetNewWindowAllowed(!bBrowse); // End of disabled multiple window diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index c20b5e26ff22..ab8853ab5637 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -196,7 +196,7 @@ aDocSz = rSz; //Wenn Text geloescht worden ist, kann es sein, dass die VisArea hinter //den sichtbaren Bereich verweist Rectangle aNewVisArea( aVisArea ); - sal_Bool bModified = false; + bool bModified = false; SwTwips lGreenOffset = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; SwTwips lTmp = aDocSz.Width() + lGreenOffset; @@ -205,11 +205,7 @@ aDocSz = rSz; lTmp = aNewVisArea.Right() - lTmp; aNewVisArea.Right() -= lTmp; aNewVisArea.Left() -= lTmp; -<<<<<<< local bModified = true; -======= - bModified = sal_True; ->>>>>>> other } lTmp = aDocSz.Height() + lGreenOffset; @@ -218,11 +214,7 @@ aDocSz = rSz; lTmp = aNewVisArea.Bottom() - lTmp; aNewVisArea.Bottom() -= lTmp; aNewVisArea.Top() -= lTmp; -<<<<<<< local bModified = true; -======= - bModified = sal_True; ->>>>>>> other } if ( bModified ) @@ -1129,17 +1121,10 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) bInOuterResizePixel = sal_True; // feststellen, ob Scrollbars angezeigt werden duerfen -<<<<<<< local - BOOL bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); - BOOL bShowH = FALSE, - bShowV = FALSE, - bAuto = FALSE, -======= - sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); + sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); sal_Bool bShowH = sal_False, bShowV = sal_False, bAuto = sal_False, ->>>>>>> other bHAuto = bBrowse; switch( GetScrollingMode() ) { @@ -1229,13 +1214,8 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) pDocSh->SetVisArea( pDocSh->SfxInPlaceObject::GetVisArea() );*/ if ( pWrtShell->GetViewOptions()->GetZoomType() != SVX_ZOOM_PERCENT && -<<<<<<< local !pWrtShell->GetViewOptions()->getBrowseMode() ) - _SetZoom( aEditSz, (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(), 100, TRUE ); -======= - !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) _SetZoom( aEditSz, (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(), 100, sal_True ); ->>>>>>> other pWrtShell->EndAction(); bRepeat = bScroll1 != pVScrollbar->IsVisible(sal_True); diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index 83774f5f0559..5f145e8ca21f 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -275,16 +275,9 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwWrtShell &rSh = GetWrtShell(); const sal_uInt16 nFrmType = rSh.IsObjSelected() ? FRMTYPE_DRAWOBJ : -<<<<<<< local - rSh.GetFrmType(0,TRUE); - const BOOL bFrmSelection = rSh.IsFrmSelected(); - const BOOL bBrowse = rSh.GetViewOptions()->getBrowseMode(); -======= rSh.GetFrmType(0,sal_True); - const sal_Bool bFrmSelection = rSh.IsFrmSelected(); - const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); - ->>>>>>> other + const sal_Bool bFrmSelection = rSh.IsFrmSelected(); + const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode(); const sal_uInt16 nSlot = rReq.GetSlot(); const sal_uInt16 nDescId = rSh.GetCurPageDesc(); @@ -920,12 +913,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) : rSh.GetFrmType( pPt, sal_True ); const sal_Bool bFrmSelection = rSh.IsFrmSelected(); - -<<<<<<< local - const BOOL bBrowse = rSh.GetViewOptions()->getBrowseMode(); -======= - const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE); ->>>>>>> other + const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode(); // PageOffset/Begrenzer const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, pPt ); const SwRect& rPagePrtRect = rSh.GetAnyCurRect( RECT_PAGE_PRT, pPt ); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 1a505b8af00a..c3840549e728 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2751,11 +2751,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( } // --> FME 2005-05-23 #122919# Force field update before PDF export: -<<<<<<< local - pViewShell->UpdateFlds(TRUE); -======= - pWrtShell->ViewShell::UpdateFlds(sal_True); ->>>>>>> other + pViewShell->ViewShell::UpdateFlds(sal_True); // <-- if( bStateChanged ) pRenderDocShell->EnableSetModified( sal_True ); -- cgit From 9bdf5d2d49574bb0f2bc1ed92704031ad5215ca5 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 9 Feb 2011 19:07:37 +0100 Subject: CWS swlayoutrefactoring: fixes for compilation on unxlngxi after resync --- sw/inc/calbck.hxx | 14 +++++++------- sw/inc/swcrsr.hxx | 4 ++-- sw/inc/viewopt.hxx | 12 ++++++------ sw/source/core/attr/calbck.cxx | 20 ++++++++++---------- sw/source/core/crsr/crsrsh.cxx | 8 ++++---- sw/source/core/doc/docdesc.cxx | 26 +------------------------- sw/source/core/doc/doclay.cxx | 2 +- sw/source/core/doc/number.cxx | 2 +- sw/source/core/docnode/node.cxx | 15 ++++++++------- sw/source/core/draw/dview.cxx | 4 ++-- sw/source/core/frmedt/fefly1.cxx | 2 +- sw/source/core/frmedt/fews.cxx | 4 ++-- sw/source/core/inc/UndoCore.hxx | 3 +++ sw/source/core/inc/flyfrm.hxx | 2 +- sw/source/core/inc/rootfrm.hxx | 2 +- sw/source/core/layout/flowfrm.cxx | 2 +- sw/source/core/layout/fly.cxx | 2 +- sw/source/core/layout/frmtool.cxx | 2 +- sw/source/core/layout/ftnfrm.cxx | 2 +- sw/source/core/layout/layact.cxx | 6 +++--- sw/source/core/layout/newfrm.cxx | 2 +- sw/source/core/layout/sectfrm.cxx | 4 ++-- sw/source/core/layout/ssfrm.cxx | 2 +- sw/source/core/layout/trvlfrm.cxx | 2 +- sw/source/core/layout/wsfrm.cxx | 12 ++++++------ sw/source/core/txtnode/txtatr2.cxx | 6 +++--- sw/source/core/unocore/unofield.cxx | 20 -------------------- sw/source/core/view/viewsh.cxx | 2 +- sw/source/ui/app/docsh2.cxx | 10 +++++----- sw/source/ui/config/viewopt.cxx | 10 ++++------ sw/source/ui/uiview/view.cxx | 37 ++++++++++--------------------------- sw/source/ui/uiview/view0.cxx | 2 +- 32 files changed, 92 insertions(+), 151 deletions(-) diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 94648f650470..f34ea4d9995e 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -133,11 +133,11 @@ class SW_DLLPUBLIC SwModify: public SwClient // friend class SwClientIter; SwClient* pRoot; // the start of the linked list of clients - BOOL bModifyLocked : 1; // don't broadcast changes now - BOOL bLockClientList : 1; // may be set when this instance notifies its clients - BOOL bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed - BOOL bInCache : 1; - BOOL bInSwFntCache : 1; + sal_Bool bModifyLocked : 1; // don't broadcast changes now + sal_Bool bLockClientList : 1; // may be set when this instance notifies its clients + sal_Bool bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed + sal_Bool bInCache : 1; + sal_Bool bInSwFntCache : 1; // mba: IMHO this method should be pure virtual virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); @@ -169,8 +169,8 @@ public: void LockModify() { bModifyLocked = sal_True; } void UnlockModify() { bModifyLocked = sal_False; } - void SetInCache( BOOL bNew ) { bInCache = bNew; } - void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; } + void SetInCache( sal_Bool bNew ) { bInCache = bNew; } + void SetInSwFntCache( sal_Bool bNew ) { bInSwFntCache = bNew; } void SetInDocDTOR() { bInDocDTOR = sal_True; } sal_Bool IsModifyLocked() const { return bModifyLocked; } sal_Bool IsInDocDTOR() const { return bInDocDTOR; } diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 01087cf0b3ef..925e6522a120 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -135,7 +135,7 @@ public: sal_Bool GoEndWord(); sal_Bool GoNextWord(); sal_Bool GoPrevWord(); - sal_Bool SelectWord( const Point* pPt = 0 ); + sal_Bool SelectWord( ViewShell* pViewShell, const Point* pPt = 0 ); // API versions of above functions (will be used with a different // WordType for the break iterator) @@ -146,7 +146,7 @@ public: sal_Bool GoEndWordWT( sal_Int16 nWordType ); sal_Bool GoNextWordWT( sal_Int16 nWordType ); sal_Bool GoPrevWordWT( sal_Int16 nWordType ); - sal_Bool SelectWordWT( sal_Int16 nWordType, const Point* pPt = 0 ); + sal_Bool SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt = 0 ); enum SentenceMoveType { diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 5638967197ce..c290f1ed9c99 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -158,9 +158,9 @@ protected: sal_Bool bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents) sal_Bool bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings sal_Bool bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents - sal_Bool bFormView : 1; + sal_Bool mbFormView : 1; sal_Bool mbBrowseMode : 1; //swmod 080130 - sal_Bool bBookview : 1; // view mode for page preview + sal_Bool mbBookView : 1; // view mode for page preview sal_Bool mbViewLayoutBookMode : 1; // book view mode for edit view sal_Bool bShowPlaceHolderFields : 1; //only used in printing! mutable bool bIdle; @@ -408,14 +408,14 @@ public: sal_Bool IsSelectionInReadonly() const {return bSelectionInReadonly;} void SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;} - sal_Bool IsFormView() const { return bFormView; } - void SetFormView( sal_Bool bSet ) { bFormView = bSet; } + sal_Bool IsFormView() const { return mbFormView; } + void SetFormView( sal_Bool bSet ) { mbFormView = bSet; } // <-- inline sal_Bool getBrowseMode() const { return mbBrowseMode; } inline void setBrowseMode(sal_Bool bSet) { mbBrowseMode = bSet; } - inline sal_Bool IsPagePrevBookview() const { return bBookview; } - inline void SetPagePrevBookview(sal_Bool bSet) { bBookview = bSet; } + inline sal_Bool IsPagePrevBookview() const { return mbBookView; } + inline void SetPagePrevBookview(sal_Bool bSet) { mbBookView = bSet; } sal_Bool IsAutoCompleteWords() const; diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 64eedaf6e419..68150f3f9e5d 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -102,21 +102,21 @@ sal_Bool SwClient::GetInfo( SfxPoolItem& ) const SwModify::SwModify() : SwClient(0), pRoot(0) { - bModifyLocked = FALSE; - bLockClientList = FALSE; - bInDocDTOR = FALSE; - bInCache = FALSE; - bInSwFntCache = FALSE; + bModifyLocked = sal_False; + bLockClientList = sal_False; + bInDocDTOR = sal_False; + bInCache = sal_False; + bInSwFntCache = sal_False; } SwModify::SwModify( SwModify *pToRegisterIn ) : SwClient(pToRegisterIn), pRoot( 0 ) { - bModifyLocked = FALSE; - bLockClientList = FALSE; - bInDocDTOR = FALSE; - bInCache = FALSE; - bInSwFntCache = FALSE; + bModifyLocked = sal_False; + bLockClientList = sal_False; + bInDocDTOR = sal_False; + bInCache = sal_False; + bInSwFntCache = sal_False; } /*************************************************************************/ diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 90eac5ef7d04..744767d598b0 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1264,7 +1264,7 @@ void SwCrsrShell::UpdateCrsrPos() Size aOldSz( GetDocSize() ); SwCntntNode *pCNode = pShellCrsr->GetCntntNode(); SwCntntFrm *pFrm = pCNode ? - pCNode->getLayoutFrm( GetLayout(), &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ) :0; + pCNode->getLayoutFrm( GetLayout(), &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False ) :0; if( !pFrm || (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) ) { SwCrsrMoveState aTmpState( MV_NONE ); @@ -1401,7 +1401,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) } SwCntntFrm *pTblFrm = pPos->nNode.GetNode().GetCntntNode()-> - getLayoutFrm( GetLayout(), &aTmpPt, pPos, FALSE ); + getLayoutFrm( GetLayout(), &aTmpPt, pPos, sal_False ); ASSERT( pTblFrm, "Tabelle Crsr nicht im Content ??" ); @@ -1642,7 +1642,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) { CalcLayout(); pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), - &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ); + &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False ); } while( !pFrm ); } else if ( Imp()->IsIdleAction() ) @@ -1828,7 +1828,7 @@ void SwCrsrShell::RefreshBlockCursor() ASSERT( pBlockCrsr, "Don't call me without a block cursor" ); SwShellCrsr &rBlock = pBlockCrsr->getShellCrsr(); Point aPt = rBlock.GetPtPos(); - SwCntntFrm* pFrm = rBlock.GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, rBlock.GetPoint(), FALSE ); + SwCntntFrm* pFrm = rBlock.GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, rBlock.GetPoint(), sal_False ); Point aMk; if( pBlockCrsr->getEndPoint() && pBlockCrsr->getStartPoint() ) { diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 9faf35b93e40..52228110afb5 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -483,30 +483,6 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel) } } } -======= - sal_Bool bFtnInf = sal_False; - if ( sal_True == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) || - pLast == pEndNoteInfo->GetPageDescDep() ) - { - aPageDescs[0]->Add( pLast ); - if ( GetRootFrm() ) - GetRootFrm()->CheckFtnPageDescs( !bFtnInf ); - } - } - - for ( sal_uInt16 j = 0; j < aPageDescs.Count(); ++j ) - { - if ( aPageDescs[j]->GetFollow() == pDel ) - { - aPageDescs[j]->SetFollow( 0 ); - //Clients des PageDesc sind die Attribute, denen sagen wir bescheid. - //die Attribute wiederum reichen die Meldung an die Absaetze weiter. - - //Layot benachrichtigen! - if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer) - GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() ); - } - } } // #116530# @@ -833,7 +809,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) ::SetProgressState( i, GetDocShell() ); SwOLENode* pOLENd = (*pNodes)[i]; - pOLENd->SetOLESizeInvalid( sal_false ); + pOLENd->SetOLESizeInvalid( sal_False ); //Kennen wir nicht, also muss das Objekt geladen werden. //Wenn es keine Benachrichtigung wuenscht diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 2a65f13d10d0..4d9e3b08b056 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1954,7 +1954,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) break; } } - BOOL bAllValid = pLayIter == aAllLayouts.end() ? 1 : 0; + bool bAllValid = pLayIter == aAllLayouts.end() ? 1 : 0; if( bAllValid && ( AUTOUPD_FIELD_ONLY == ( nFldUpdFlag = getFieldUpdateFlags(true) ) || AUTOUPD_FIELD_AND_CHARTS == nFldUpdFlag ) && diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 73f6571e5ad9..ee1b832fd777 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -356,7 +356,7 @@ void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) // dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses // NumFormat gesetzt ist. Das Format muss es nicht geben! const SwCharFmt* pFmt = 0; - USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; + sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; switch( nWhich ) { case RES_ATTRSET_CHG: diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 88418c899080..94fdcb5d54a6 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -443,15 +443,16 @@ sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const else pNd = GetCntntNode(); - const SwFrm* pFrm; - if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, sal_False ) ) ) - { - if( !pSh ) - // dann die Shell vom Doc besorgen: - GetDoc()->GetEditShell( &pSh ); + if( !pSh ) + // dann die Shell vom Doc besorgen: + GetDoc()->GetEditShell( &pSh ); - if( pSh ) + if( pSh ) + { + const SwFrm* pFrm; + if( pNd && 0 != ( pFrm = pNd->getLayoutFrm( pSh->GetLayout(), 0, 0, sal_False ) ) ) { + if ( pFrm->IsInTab() ) pFrm = pFrm->FindTabFrm(); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index db6c04ff54bd..f33ac9a8fd37 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -1087,7 +1087,7 @@ void SwDrawView::DeleteMarked() SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317 if ( pTmpRoot ) pTmpRoot->StartAllAction(); - pDoc->StartUndo(UNDO_EMPTY, NULL); + pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); // OD 18.06.2003 #108784# - replace marked -objects by its // reference objects. { @@ -1106,7 +1106,7 @@ void SwDrawView::DeleteMarked() FmFormView::DeleteMarked(); ::FrameNotify( Imp().GetShell(), FLY_DRAG_END ); } - pDoc->EndUndo(UNDO_EMPTY, NULL); + pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); if( pTmpRoot ) pTmpRoot->EndAllAction(); //swmod 080218 } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 6437b3250046..d4e29b6e8a29 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1780,7 +1780,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromAnyObj( const Point& rPt ) const Point aPt( rPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); - SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, FALSE )->FindFlyFrm(); + SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, sal_False )->FindFlyFrm(); pRet = pFrm ? ((SwLayoutFrm*)pFrm)->GetFmt() : 0; } return pRet; diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 5746b07dba97..7ed451d410bc 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -130,10 +130,10 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, { const bool bOldCallbackActionEnabled = GetLayout()->IsCallbackActionEnabled(); if( bOldCallbackActionEnabled ) - GetLayout()->SetCallbackActionEnabled( FALSE ); + GetLayout()->SetCallbackActionEnabled( sal_False ); pFrm = GetCurrFrm(); if( bOldCallbackActionEnabled ) - GetLayout()->SetCallbackActionEnabled( TRUE ); + GetLayout()->SetCallbackActionEnabled( sal_True ); } } diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index c5907426bf40..35abb46f7cf7 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -39,6 +39,8 @@ class SwFmtAnchor; class SdrMarkList; class SwUndoDelete; class SwRedlineSaveData; +class SwFrm; +class SwFmt; namespace sw { class UndoManager; @@ -188,6 +190,7 @@ public: virtual void RedoImpl( ::sw::UndoRedoContext & ); virtual SwRewriter GetRewriter() const; + void DeRegisterFromFormat( SwFmt& ); }; diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index db16dd447c27..ef2744aea127 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -60,7 +60,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove = class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject { //darf Locken. Definiert in frmtool.cxx - friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * ); + friend void AppendObjs ( const SwSpzFrmFmts *, sal_uLong, SwFrm *, SwPageFrm * ); friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld, const SwRect* pOldPrt ); diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 401c5271a5e6..304659aa2edb 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -170,7 +170,7 @@ public: void AllInvalidateAutoCompleteWords() const;//swmod 080305 void AllAddPaintRect() const; void AllRemoveFtns() ;//swmod 080305 - void AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const;//swmod 080307 + void AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const;//swmod 080307 //Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen) static sal_Bool FlushVout(); //Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 918363dfc648..d76961e0f02b 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1241,7 +1241,7 @@ sal_Bool SwFlowFrm::IsPageBreak( sal_Bool bAct ) const { const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - return FALSE; + return sal_False; const SwAttrSet *pSet = rThis.GetAttrSet(); //Vorgaenger ermitteln diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index b6c977d249b4..a7dda4aa478d 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -425,7 +425,7 @@ SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact ) SdrPage* pPg( 0L ); if ( 0 != ( pPg = pContact->GetMaster()->GetPage() ) ) { - const UINT32 nOrdNum = pContact->GetMaster()->GetOrdNum(); + const sal_uInt32 nOrdNum = pContact->GetMaster()->GetOrdNum(); pPg->ReplaceObject( pDrawObj, nOrdNum ); } // --> OD 2004-08-16 #i27030# - insert new instance diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 18f88b99485c..aa4f6e9921a6 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1240,7 +1240,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, { pDoc->BlockIdling(); SwRootFrm* pLayout = pLay->getRootFrm(); - const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False; + const sal_Bool bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False; if( bOldCallbackActionEnabled ) pLayout->SetCallbackActionEnabled( sal_False ); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 9f70bf9b05b4..a0c99c5cfd79 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -371,7 +371,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool ) } } const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); SwPageFrm *pPage = pBoss->FindPageFrm(); if ( bBrowseMode || !pPage->IsFtnPage() ) { diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 0597876fd07f..405b6fae4910 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1193,7 +1193,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) { sal_Bool bRet = sal_False; const ViewShell *pSh = pRoot->GetCurrShell(); - const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); //Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst //gibts nix als Aerger. @@ -1489,12 +1489,12 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth); } - BOOL bPageInBrowseMode = pLay->IsPageFrm(); + sal_Bool bPageInBrowseMode = pLay->IsPageFrm(); if( bPageInBrowseMode ) { const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ) - bPageInBrowseMode = FALSE; + bPageInBrowseMode = sal_False; } if( bPageInBrowseMode ) { diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 20bc750c84d3..e59957d9174d 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -612,7 +612,7 @@ void SwRootFrm::AllRemoveFtns() { RemoveFtns(); } -void SwRootFrm::AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const +void SwRootFrm::AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const { SwPageFrm *pPage = (SwPageFrm*)this->Lower(); while ( pPage ) diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index a5663b69660c..5d82ba9e13ee 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2043,7 +2043,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst ) sal_Bool bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked(); // OD 2004-03-15 #116561# - allow grow in online layout - BOOL bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() || + sal_Bool bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() || GetSection()->GetFmt()->GetBalancedColumns().GetValue(); if( !bGrow ) { @@ -2482,7 +2482,7 @@ void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() ) { - SwSectionFrm::MoveCntntAndDelete( this, TRUE ); + SwSectionFrm::MoveCntntAndDelete( this, sal_True ); } } diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index f015e84fbdc5..f8768077c7a1 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -525,7 +525,7 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode ) { SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster(); pMaster->SetFollow( pFrm->GetFollow() ); - pFrm->_SetIsFollow( FALSE ); + pFrm->_SetIsFollow( sal_False ); } pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt. //Andernfalls kann es sein, dass ein Follow diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index a0ae514af78b..36995f0b71c4 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -893,7 +893,7 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const { ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" ); SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode(). - GetCntntNode()->GetFrm( 0, + GetCntntNode()->getLayoutFrm( this, 0, pActualCrsr->GetPoint(), sal_False ); return pActFrm->FindPageFrm()->GetPhyPageNum(); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 9d9187c7e61c..c9a5f62264f2 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -179,7 +179,7 @@ void SwSectionFrm::CheckDirection( sal_Bool bVert ) if( pFmt ) { const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), bVert, sal_True, bBrowseMode ); } @@ -193,7 +193,7 @@ void SwFlyFrm::CheckDirection( sal_Bool bVert ) if( pFmt ) { const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), bVert, sal_False, bBrowseMode ); } @@ -207,7 +207,7 @@ void SwTabFrm::CheckDirection( sal_Bool bVert ) if( pFmt ) { const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(), bVert, sal_True, bBrowseMode ); } @@ -227,7 +227,7 @@ void SwCellFrm::CheckDirection( sal_Bool bVert ) { const SvxFrameDirectionItem* pFrmDirItem = static_cast(pItem); const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir( pFrmDirItem->GetValue(), bVert, sal_False, bBrowseMode ); } else @@ -237,7 +237,7 @@ void SwCellFrm::CheckDirection( sal_Bool bVert ) void SwTxtFrm::CheckDirection( sal_Bool bVert ) { const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); CheckDir( GetTxtNode()->GetSwAttrSet().GetFrmDir().GetValue(), bVert, sal_True, bBrowseMode ); } @@ -3343,7 +3343,7 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const const SwFrm *pRel = GetUpper(); long nRel = LONG_MAX; const ViewShell *pSh = getRootFrm()->GetCurrShell(); - const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); + const sal_Bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); if( pRel->IsPageBodyFrm() && pSh && bBrowseMode && pSh->VisArea().Width() ) { nRel = pSh->GetBrowseWidth(); diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 9baac7ad5e87..7ca3d011ad66 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -81,16 +81,16 @@ void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolIte } } -sal_Bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const { if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode || &m_pTxtNode->GetNodes() != static_cast(rInfo).pNodes ) { - return sal_True; + return true; } static_cast(rInfo).pCntntNode = m_pTxtNode; - return sal_False; + return false; } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index bb2d1721d4b0..cfbd4028a230 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -964,26 +964,6 @@ void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) } } -const Programmatic2UIName_Impl* lcl_GetFieldNameTable() -{ - static sal_Bool bInitialized = sal_False; - static Programmatic2UIName_Impl aFieldNames[5]; - if(!bInitialized) - { - bInitialized = sal_True; - int nName = 0; - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_ABB )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_ABB)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_TABLE )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_TABLE)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_FRAME)); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_FRAME)); - aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_DRAWING )); - aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_DRAWING)); - } - return &aFieldNames[0]; -} - OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc) { OUString sRet(rType.GetName()); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index f83d1e1e03e1..26c83647426a 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2362,7 +2362,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) pDoc->CheckDefaultPageFmt(); // <-- - CheckBrowseView( TRUE ); + CheckBrowseView( sal_True ); } pMyWin->Invalidate(); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 9c867a90bf08..eac710d34efd 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -160,7 +160,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( // Disable "multiple layout" -void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) +void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) { GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); UpdateFontList(); @@ -171,19 +171,19 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) if( !GetDoc()->getPrinter( false ) ) pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); GetDoc()->CheckDefaultPageFmt(); - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); do { if( pTmpFrm != pTempView->GetViewFrame() ) { pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); } else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False); } while ( pTmpFrm ); const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - pTempView->GetWrtShell().CheckBrowseView( TRUE ); + pTempView->GetWrtShell().CheckBrowseView( sal_True ); pTempView->CheckVisArea(); if( bSet ) { diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index 91c174478915..b68c531e61ee 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -215,11 +215,9 @@ SwViewOption::SwViewOption() : bStarOneSetting(sal_False), bIsPagePreview(sal_False), bSelectionInReadonly(sal_False), - // --> FME 2004-06-29 #114856# Formular view - bFormView(sal_False), - // <-- - bBookview(sal_False), + mbFormView(sal_False), mbBrowseMode(sal_False), + mbBookView(sal_False), mbViewLayoutBookMode(sal_False), bShowPlaceHolderFields( sal_True ), @@ -279,7 +277,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) sSymbolFont = rVOpt.sSymbolFont; nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode; bStarOneSetting = rVOpt.bStarOneSetting; - mbBookview = rVOpt.mbBookview; + mbBookView = rVOpt.mbBookView; mbBrowseMode = rVOpt.mbBrowseMode; mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; @@ -321,7 +319,7 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) sSymbolFont = rVOpt.sSymbolFont; nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode; bStarOneSetting = rVOpt.bStarOneSetting; - mbBookview = rVOpt.mbBookview; + mbBookView = rVOpt.mbBookView; mbBrowseMode = rVOpt.mbBrowseMode; mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode; bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index c1ac5c30585c..2d392b4658ad 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -746,7 +746,6 @@ void SwView::_CheckReadonlySelection() SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) : SfxViewShell( _pFrame, SWVIEWFLAGS ), - aPageStr( SW_RES( STR_PAGE )), nNewPage(USHRT_MAX), pNumRuleNodeFromDoc(0), // #i23726# @@ -827,9 +826,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) //! get lingu options without loading lingu DLL SvtLinguOptions aLinguOpt; - SvtLinguConfig().GetOptions( aLinguOpt ); - aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto ); sal_Bool bOldShellWasSrcView = sal_False; @@ -840,16 +837,17 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) if ( pOldSh ) { pExistingSh = pOldSh; - // determine type of existing view + // determine type of existing view if( pExistingSh->IsA( TYPE( SwPagePreView ) ) ) - { - sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData(); - sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos(); - nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); - bOldShellWasPagePreView = sal_True; + { + sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData(); + sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos(); + nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); + bOldShellWasPagePreView = sal_True; + } + else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) + bOldShellWasSrcView = sal_True; } - else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) - bOldShellWasSrcView = sal_True; RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" ); if(PTR_CAST( SwView, pExistingSh)) @@ -867,7 +865,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc(); if( !bOldShellWasSrcView && pWebDShell && !bOldShellWasPagePreView ) - aUsrPref.setBrowseMode( TRUE ); + aUsrPref.setBrowseMode( sal_True ); else if( rDoc.IsLoaded() ) aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) ); @@ -1041,10 +1039,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) } - /*uno::Reference< awt::XWindow > aTmpRef; - _pFrame->GetFrame().GetFrameInterface()->setComponent( aTmpRef, - pViewImpl->GetUNOObject_Impl());*/ - uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface(); uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame( @@ -1068,14 +1062,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) if(bOldModifyFlag) pDocSh->EnableSetModified( sal_True ); InvalidateBorder(); - } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwView::~SwView() { delete mpPostItMgr; @@ -1123,11 +1111,6 @@ SwView::~SwView() delete pFormatClipboard; } -/*-------------------------------------------------------------------- - Beschreibung: DocShell rausgrabbeln ueber das FrameWindow - --------------------------------------------------------------------*/ - - SwDocShell* SwView::GetDocShell() { SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell(); diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index 9a4b4f2edf9e..503371fd3837 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -224,7 +224,7 @@ void lcl_SetViewMetaChars( SwViewOption& rVOpt, sal_Bool bOn) void SwView::RecheckBrowseMode() { // OS: numerische Reihenfolge beachten! - static USHORT __READONLY_DATA aInva[] = + static sal_uInt16 __READONLY_DATA aInva[] = { //SID_NEWWINDOW,/*5620*/ SID_BROWSER_MODE, /*6313*/ -- cgit From ad36c8bb35f3ff5666363d876be319497a28001f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 11 Feb 2011 11:08:08 +0100 Subject: debuglevels: outsourced creation of the smoketest doc into an own module, so it can be used outside smoketesoo_native, too --- .../com/sun/star/comp/smoketest/MANIFEST.MF | 2 + .../com/sun/star/comp/smoketest/TestExtension.idl | 40 ++ .../com/sun/star/comp/smoketest/TestExtension.java | 166 +++++ smoketestdoc/com/sun/star/comp/smoketest/delzip | 1 + .../com/sun/star/comp/smoketest/makefile.mk | 89 +++ .../com/sun/star/comp/smoketest/manifest.xml | 5 + smoketestdoc/data/Events.xml | 66 ++ smoketestdoc/data/Global.xml | 789 +++++++++++++++++++++ smoketestdoc/data/OptionsDlg.xml | 64 ++ smoketestdoc/data/Test_10er.xml | 690 ++++++++++++++++++ smoketestdoc/data/Test_DB.xml | 147 ++++ smoketestdoc/data/Test_Ext.xml | 116 +++ smoketestdoc/data/content.xml | 113 +++ smoketestdoc/data/dialog-lb.xml | 31 + smoketestdoc/data/dialog-lc.xml | 31 + smoketestdoc/data/makefile.mk | 70 ++ smoketestdoc/data/manifest.xml | 49 ++ smoketestdoc/data/meta.xml | 28 + smoketestdoc/data/script-lb.xml | 35 + smoketestdoc/data/script-lc.xml | 31 + smoketestdoc/data/settings.xml | 28 + smoketestdoc/data/styles.xml | 28 + smoketestdoc/makefile.mk | 70 ++ smoketestdoc/prj/build.lst | 4 + smoketestdoc/prj/d.lst | 4 + .../com/sun/star/comp/smoketest/MANIFEST.MF | 2 - .../com/sun/star/comp/smoketest/TestExtension.idl | 40 -- .../com/sun/star/comp/smoketest/TestExtension.java | 166 ----- .../com/sun/star/comp/smoketest/delzip | 1 - .../com/sun/star/comp/smoketest/makefile.mk | 90 --- .../com/sun/star/comp/smoketest/manifest.xml | 5 - smoketestoo_native/data/Events.xml | 66 -- smoketestoo_native/data/Global.xml | 789 --------------------- smoketestoo_native/data/OptionsDlg.xml | 64 -- smoketestoo_native/data/Test_10er.xml | 690 ------------------ smoketestoo_native/data/Test_DB.xml | 147 ---- smoketestoo_native/data/Test_Ext.xml | 116 --- smoketestoo_native/data/content.xml | 113 --- smoketestoo_native/data/dialog-lb.xml | 31 - smoketestoo_native/data/dialog-lc.xml | 31 - smoketestoo_native/data/makefile.mk | 70 -- smoketestoo_native/data/manifest.xml | 49 -- smoketestoo_native/data/meta.xml | 28 - smoketestoo_native/data/script-lb.xml | 35 - smoketestoo_native/data/script-lc.xml | 31 - smoketestoo_native/data/settings.xml | 28 - smoketestoo_native/data/styles.xml | 28 - smoketestoo_native/makefile.mk | 2 +- smoketestoo_native/prj/build.lst | 6 +- smoketestoo_native/prj/d.lst | 0 smoketestoo_native/smoketest.cxx | 0 smoketestoo_native/version.map | 0 52 files changed, 2700 insertions(+), 2625 deletions(-) create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/delzip create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/makefile.mk create mode 100755 smoketestdoc/com/sun/star/comp/smoketest/manifest.xml create mode 100755 smoketestdoc/data/Events.xml create mode 100755 smoketestdoc/data/Global.xml create mode 100755 smoketestdoc/data/OptionsDlg.xml create mode 100755 smoketestdoc/data/Test_10er.xml create mode 100755 smoketestdoc/data/Test_DB.xml create mode 100755 smoketestdoc/data/Test_Ext.xml create mode 100755 smoketestdoc/data/content.xml create mode 100755 smoketestdoc/data/dialog-lb.xml create mode 100755 smoketestdoc/data/dialog-lc.xml create mode 100755 smoketestdoc/data/makefile.mk create mode 100755 smoketestdoc/data/manifest.xml create mode 100755 smoketestdoc/data/meta.xml create mode 100755 smoketestdoc/data/script-lb.xml create mode 100755 smoketestdoc/data/script-lc.xml create mode 100755 smoketestdoc/data/settings.xml create mode 100755 smoketestdoc/data/styles.xml create mode 100755 smoketestdoc/makefile.mk create mode 100755 smoketestdoc/prj/build.lst create mode 100755 smoketestdoc/prj/d.lst delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/delzip delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk delete mode 100755 smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml delete mode 100644 smoketestoo_native/data/Events.xml delete mode 100755 smoketestoo_native/data/Global.xml delete mode 100644 smoketestoo_native/data/OptionsDlg.xml delete mode 100644 smoketestoo_native/data/Test_10er.xml delete mode 100644 smoketestoo_native/data/Test_DB.xml delete mode 100644 smoketestoo_native/data/Test_Ext.xml delete mode 100644 smoketestoo_native/data/content.xml delete mode 100644 smoketestoo_native/data/dialog-lb.xml delete mode 100644 smoketestoo_native/data/dialog-lc.xml delete mode 100644 smoketestoo_native/data/makefile.mk delete mode 100644 smoketestoo_native/data/manifest.xml delete mode 100644 smoketestoo_native/data/meta.xml delete mode 100644 smoketestoo_native/data/script-lb.xml delete mode 100644 smoketestoo_native/data/script-lc.xml delete mode 100644 smoketestoo_native/data/settings.xml delete mode 100644 smoketestoo_native/data/styles.xml mode change 100644 => 100755 smoketestoo_native/makefile.mk mode change 100644 => 100755 smoketestoo_native/prj/build.lst mode change 100644 => 100755 smoketestoo_native/prj/d.lst mode change 100644 => 100755 smoketestoo_native/smoketest.cxx mode change 100644 => 100755 smoketestoo_native/version.map diff --git a/smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF b/smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF new file mode 100755 index 000000000000..09e2f42ca0f6 --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/MANIFEST.MF @@ -0,0 +1,2 @@ +RegistrationClassName: com.sun.star.comp.smoketest.TestExtension + diff --git a/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl new file mode 100755 index 000000000000..83c370e11a18 --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.idl @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _com_sun_star_comp_smoketest_TestExtension_idl_ +#define _com_sun_star_comp_smoketest_TestExtension_idl_ + +#include + + +module com { module sun { module star { module comp { module smoketest { + // example service, XServiceInfo is implemented here for demonstration + // issues. XServiceInfo must be implemented by all components. + service TestExtension: ::com::sun::star::lang::XServiceInfo; +};};};};}; + +#endif diff --git a/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java new file mode 100755 index 000000000000..c08c719116ae --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/TestExtension.java @@ -0,0 +1,166 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +package com.sun.star.comp.smoketest; + +import com.sun.star.lib.uno.helper.Factory; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.lang.XSingleComponentFactory; +import com.sun.star.lib.uno.helper.WeakBase; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XComponentContext; +import com.sun.star.registry.XRegistryKey; +import com.sun.star.lang.XInitialization; +import com.sun.star.lang.XTypeProvider; +import com.sun.star.lang.XServiceInfo; +import com.sun.star.uno.Type; + +/** This class capsulates the class, that implements the minimal component, a + * factory for creating the service (__getComponentFactory) and a + * method, that writes the information into the given registry key + * (__writeRegistryServiceInfo). + */ +public class TestExtension { + /** This class implements the component. At least the interfaces XServiceInfo, + * XTypeProvider, and XInitialization should be provided by the service. + */ + public static class _TestExtension extends WeakBase + implements XServiceInfo { + /** The service name, that must be used to get an instance of this service. + */ + static private final String __serviceName = + "com.sun.star.comp.smoketest.TestExtension"; + + /** The initial component contextr, that gives access to + * the service manager, supported singletons, ... + * It's often later used + */ + private XComponentContext m_cmpCtx; + + /** The service manager, that gives access to all registered services. + * It's often later used + */ + private XMultiComponentFactory m_xMCF; + + /** The constructor of the inner class has a XMultiServiceFactory parameter. + * @param xmultiservicefactoryInitialization A special service factory + * could be introduced while initializing. + */ + public _TestExtension(XComponentContext xCompContext) { + try { + m_cmpCtx = xCompContext; + m_xMCF = m_cmpCtx.getServiceManager(); + } + catch( Exception e ) { + e.printStackTrace(); + } + } + + /** This method returns an array of all supported service names. + * @return Array of supported service names. + */ + public String[] getSupportedServiceNames() { + return getServiceNames(); + } + + /** This method is a simple helper function to used in the + * static component initialisation functions as well as in + * getSupportedServiceNames. + */ + public static String[] getServiceNames() { + String[] sSupportedServiceNames = { __serviceName }; + return sSupportedServiceNames; + } + + /** This method returns true, if the given service will be + * supported by the component. + * @param sServiceName Service name. + * @return True, if the given service name will be supported. + */ + public boolean supportsService( String sServiceName ) { + return sServiceName.equals( __serviceName ); + } + + /** Return the class name of the component. + * @return Class name of the component. + */ + public String getImplementationName() { + return _TestExtension.class.getName(); + } + } + + + /** + * Gives a factory for creating the service. + * This method is called by the JavaLoader + *

+ * @return returns a XSingleComponentFactory for creating + * the component + * @param sImplName the name of the implementation for which a + * service is desired + * @see com.sun.star.comp.loader.JavaLoader + */ + public static XSingleComponentFactory __getComponentFactory(String sImplName) + { + XSingleComponentFactory xFactory = null; + + if ( sImplName.equals( _TestExtension.class.getName() ) ) + xFactory = Factory.createComponentFactory(_TestExtension.class, + _TestExtension.getServiceNames()); + + return xFactory; + } + + /** + * Writes the service information into the given registry key. + * This method is called by the JavaLoader + *

+ * @return returns true if the operation succeeded + * @param regKey the registryKey + * @see com.sun.star.comp.loader.JavaLoader + */ + public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { + return Factory.writeRegistryServiceInfo(_TestExtension.class.getName(), + _TestExtension.getServiceNames(), + regKey); + } + /** This method is a member of the interface for initializing an object + * directly after its creation. + * @param object This array of arbitrary objects will be passed to the + * component after its creation. + * @throws Exception Every exception will not be handled, but will be + * passed to the caller. + */ + public void initialize( Object[] object ) + throws com.sun.star.uno.Exception { + /* The component describes what arguments its expected and in which + * order!At this point you can read the objects and can intialize + * your component using these objects. + */ + } + +} diff --git a/smoketestdoc/com/sun/star/comp/smoketest/delzip b/smoketestdoc/com/sun/star/comp/smoketest/delzip new file mode 100755 index 000000000000..636fda90bfcb --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/delzip @@ -0,0 +1 @@ +ECHO is OFF diff --git a/smoketestdoc/com/sun/star/comp/smoketest/makefile.mk b/smoketestdoc/com/sun/star/comp/smoketest/makefile.mk new file mode 100755 index 000000000000..173898970254 --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/makefile.mk @@ -0,0 +1,89 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#************************************************************************* + +PRJ = ../../../../.. +PRJNAME = smoketestdoc +PACKAGE = com/sun/star/comp/smoketest +TARGET = com_sun_star_comp_smoketest + +no_common_build_zip:=TRUE + +# --- Settings ----------------------------------------------------- + +.IF "$(SOLAR_JAVA)" != "" + +.INCLUDE : settings.mk + +JARFILES = ridl.jar jurt.jar unoil.jar juh.jar + +JARTARGET = TestExtension.jar +JARCOMPRESS = TRUE +CUSTOMMANIFESTFILE = MANIFEST.MF + +ZIP1TARGET=TestExtension +ZIP1LIST=* +ZIPFLAGS=-r +ZIP1DIR=$(MISC)/$(TARGET) +ZIP1EXT=.oxt + +# --- Files -------------------------------------------------------- + +#COPY_OXT_MANIFEST:= $(MISC)/$(TARGET)/META-INF/manifest.xml +JAVAFILES = TestExtension.java + +# --- Targets ------------------------------------------------------ + +ZIP1DEPS=$(MISC)/$(TARGET)/$(JARTARGET)\ + $(MISC)/$(TARGET)/TestExtension.rdb\ + $(MISC)/$(TARGET)/META-INF/manifest.xml + +.INCLUDE : target.mk + +$(MISC)/$(TARGET)/META-INF: + @-$(MKDIRHIER) $(@) + +$(MISC)/TestExtension.urd: TestExtension.idl + $(COMMAND_ECHO)$(IDLC) -O$(MISC) -I$(SOLARIDLDIR) -cid -we $< + +$(MISC)/$(TARGET)/META-INF/manifest.xml $(MISC)/$(TARGET)/TestExtension.rdb : $(MISC)/$(TARGET)/META-INF + +$(MISC)/$(TARGET)/META-INF/manifest.xml: manifest.xml + $(COMMAND_ECHO)$(COPY) $< $@ + +$(MISC)/$(TARGET)/TestExtension.rdb: $(MISC)/TestExtension.urd + $(COMMAND_ECHO)$(REGMERGE) $@ /UCR $< + +$(JAVACLASSFILES) .UPDATEALL: $(MISC)/$(TARGET)/TestExtension.rdb + $(COMMAND_ECHO)$(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -X$(SOLARBINDIR)/types.rdb $< + +$(MISC)/$(TARGET)/$(JARTARGET) : $(JARTARGETN) + $(COMMAND_ECHO)$(COPY) $< $@ + +.ELSE +@all: + @echo "Java disabled. Nothing to do." +.ENDIF diff --git a/smoketestdoc/com/sun/star/comp/smoketest/manifest.xml b/smoketestdoc/com/sun/star/comp/smoketest/manifest.xml new file mode 100755 index 000000000000..7e3e7947aa0f --- /dev/null +++ b/smoketestdoc/com/sun/star/comp/smoketest/manifest.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/smoketestdoc/data/Events.xml b/smoketestdoc/data/Events.xml new file mode 100755 index 000000000000..414f2c48e884 --- /dev/null +++ b/smoketestdoc/data/Events.xml @@ -0,0 +1,66 @@ + + + +REM ***** BASIC ***** + +Global s_CloseListenerCalled As Boolean + +Sub PressCancel + gDlgState = cDlgCancel +end Sub + +Sub PressOk + gDlgState = cDlgOk +end Sub + +Sub PressTest + gOptionsDialog.EndExecute() + gDlgState = cDlgStartTest +end Sub + +Sub closeListener_queryClosing + ' not interested in + closeListener_queryClosing = TRUE +End Sub + +Sub closeListener_notifyClosing + s_CloseListenerCalled = TRUE +End Sub + +Sub closeListener_disposing + ' not interested in +End Sub + +Sub ResetCloseListenerFlag + s_CloseListenerCalled = FALSE +End Sub + +Function HasCloseListenerBeenCalled As Boolean + HasCloseListenerBeenCalled = s_CloseListenerCalled +End Function + diff --git a/smoketestdoc/data/Global.xml b/smoketestdoc/data/Global.xml new file mode 100755 index 000000000000..d437eafe3457 --- /dev/null +++ b/smoketestdoc/data/Global.xml @@ -0,0 +1,789 @@ + + + +REM ***** BASIC ***** + +const cMaxErrorStates = 14 + +const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 +const cParagraphBreak = 0 + +global const cExtensionFileName = "TestExtension.oxt" + +global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 +global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 +global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 +global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 +global const cLogfileFailed = 255 + +global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 +global const cStHTML = 6, cStChart = 4, cStJava = 7 +global const cStMath = 5, cStDataBase = 9 +global const cStExtension = 11 +global const cStTestGlue = 12 +global const cStNone = -1 + +global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 + +global const frmWriter = 1, frmCalc = 2, frmImpress = 4 +global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 +global const frmDataBase = 10, frmJava = 13 +global const frmExtension = 14 +global const frmTestGlue = 15 + +Global gCurrentDocTest As Integer +Global gCurrentTestCase As Integer + +global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 + +'UserFieldKennungen +Global const cYes = "y", cNo = "n" +Global const cStateNo = 0, cStateYes = 1 + +'Feldtypen +Global const cFtExtUser = 21, cFtPageNum = 5, cFtStatistic = 8, cFtDateTime = 27, cFtDatabase = 31 + +'UnoStrings +Global const cUnoSeparator = "." +Global const cUnoPrefix = "com.sun.star." +Global const cUnoUserField = cUnoPrefix + "text.FieldMaster.User" +Global const cUnoExtUserField = cUnoPrefix + "text.TextField.ExtendedUser" +Global const cUnoMasterDataBase = cUnoPrefix + "text.FieldMaster.Database" +Global const cUnoDataBase = cUnoPrefix + "text.TextField.Database" +Global const cUnoDateTime = cUnoPrefix + "text.TextField.DateTime" +Global const cUnoTextGraphi2 = cUnoPrefix + "text.Graphic" +Global const cUnoJavaLoader = cUnoPrefix + "loader.Java" +Global const cUnoDatabaseContext = cUnoPrefix + "sdb.DatabaseContext" +Global const cUnoRowSet = cUnoPrefix + "sdb.RowSet" +Global const cUnoSmoketestTestExtension = cUnoPrefix + "comp.smoketest.TestExtension" +Global const cUnoSmoketestCommandEnvironment = cUnoPrefix + "deployment.test.SmoketestCommandEnvironment" +Global const cExtensionManager = cUnoPrefix + "deployment.ExtensionManager" + +'UserFieldNames +Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = "Calc", cUserFieldTestImpress = "Impress" +Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart" +Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database" +Global const cUserFieldTestExtension = "Extension" +Global const cUserFieldTestOpenSaveXML = "SaveOpenXML" +Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8" + +Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard" + +Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2 + +global gErrorState (cMaxErrorStates, 5) as integer +Global gTestCaseAnnotations( cMaxErrorStates, 5 ) As String + +global gOutputDoc as Object +global gOutputDocNotUno as Object +global gOptionsDialog as Object + +Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest as boolean +Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean +Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean +Global bMakeExtensionTest as boolean +Global bMakeSaveOpenXMLTest as boolean +Global bMakeTerminateAfterTest as boolean, bShowTable as boolean +Global bMakeSaveOpen8Test as boolean + +global sExtensionURL as string + +Dim gDlgState as Integer + +Sub SetGlobalDoc + gOutputDoc = ThisComponent +end Sub + +Sub ClearStatus + for j% = 0 to cMaxErrorStates + for i% = 0 to 5 + gErrorState (j%, i%) = cLogUnknown + gTestCaseAnnotations( J%, i% ) = "" + next i% + next j% +end Sub + +Sub ClearAllText + call SetGlobalDoc + call ClearDoc (gOutputDoc) + call ClearStatus +end Sub + +Sub AssertionHandler( sMessage as String ) + LogTestResult( "assertion caught: " + sMessage, FALSE ) +End Sub + +Sub Main + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherSetupDoc + + On Local Error Goto MainError + CaptureAssertions( "AssertionHandler" ) + + call SetGlobalDoc + + Dim bWasModified as Boolean + bWasModified = gOutputDoc.isModified() + + if bShowTable then + call ClearDoc (gOutputDoc) + end If + + call ClearStatus + + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + + Call Test_10er.Main + + gCurrentDocTest = frmTestGlue + gCurrentTestCase = cOtherWriteStatus + if bShowTable then + call CreateStatusTable2 + call CreateStatusTable + call CreateDocState + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result + call CreateSecondState + gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage + end if + + gOutputDoc.setModified( bWasModified ) + + CaptureAssertions( "" ) + Exit Sub + +MainError: + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) +End Sub + +Function GetTestGlueDescription( nTestCase as Integer ) + Select Case ( nTestCase ) + case cOtherSetupDoc + GetTestGlueDescription = "setup test document" + case cOtherWriteStatus + GetTestGlueDescription = "write test status" + case Else + GetTestGlueDescription = "" + End Select +End Function + +Sub CreateStatusTable + dim tableHeaders(7) as string + tableHeaders(cStWriter) = "Writer" + tableHeaders(cStCalc) = "Calc" + tableHeaders(cStPraesentation) = "Präsen- tation" + tableHeaders(cStZeichnen) = "Zeichn." + tableHeaders(cStChart) = "Diagr." + tableHeaders(cStMath) = "Math" + tableHeaders(cStHTML) = "HTML" + tableHeaders(cStJava) = "Java" + + dim tableRows(3) as string + tableRows(cDocNew) = "new" + tableRows(cDocSaveOpen8) = "V8.0" + tableRows(cDocSaveOpenXML) = "XML" + tableRows(cDocClose) = "close" + + aDoc = gOutputDoc + + xText = aDoc.Text + xCursor = xText.createTextCursor() + + xCursor.gotoStart(FALSE) + xCursor.GoRight (4, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) + SetParagraphBreak (xCursor) + xCursor.GoRight (1, False) + + table = aDoc.createInstance("com.sun.star.text.TextTable") + table.initialize(6,9) + table.Name = "StTab1" + table.BackColor = cCoGrey + xText.insertTextContent(xCursor, table, FALSE) + + tableCursor = table.createCursorByCellName(table.CellNames(0)) + tableCursor.gotoStart(FALSE) + tableCursor.goRight(1,FALSE) + + for i% = 0 to 7 + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders( i% ) + next i% +end Sub + +Sub CreateStatusTable2 + dim tableHeaders(4) as string + tableHeaders(0) = "Database" + tableHeaders(1) = "" + tableHeaders(2) = "Extension" + tableHeaders(3) = "" + tableHeaders(4) = "Other" + + dim tableRows(5) as string + tableRows(cDBService ) = "services" + tableRows(cDBOpen ) = "open" + tableRows(cDBInsert ) = "insert" + tableRows(cDBDelete ) = "delete" + tableRows(cDBSeek ) = "seek" + tableRows(cDBClose ) = "close" + + dim tableRows2(2) as string + tableRows2(cEXTService ) = "services" + tableRows2(cEXTInstall ) = "install" + tableRows2(cEXTUninstall ) = "uninstall" + + dim tableRows3(1) as string + tableRows3(cOtherSetupDoc ) = "setup test" + tableRows3(cOtherWriteStatus ) = "write test result" + + aDoc = gOutputDoc + + xText = aDoc.Text + xCursor = xText.createTextCursor() + + xCursor.gotoStart(FALSE) + xCursor.GoRight (4, False) + SetParagraphBreak (xCursor) + SetParagraphBreak (xCursor) + xCursor.gotoEnd(FALSE) + + table = aDoc.createInstance("com.sun.star.text.TextTable") + table.initialize(7,6) + table.Name = "StTab2" + table.BackColor = cCoGrey + + xText.insertTextContent(xCursor, table, FALSE) + + for i% = LBound( tableHeaders ) to UBound( tableHeaders ) + tableCell = table.getCellByPosition( i% + 1, 0 ) + tableCell.String = tableHeaders(i%) + next i% + + for i% = LBound( tableRows ) to UBound( tableRows ) + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) + next i% + + for i% = LBound( tableRows2 ) to UBound( tableRows2 ) + tableCell = table.getCellByPosition( 2, i% + 1 ) + tableCell.String=tableRows2(i%) + next i% + + for i% = LBound( tableRows3 ) to UBound( tableRows3 ) + tableCell = table.getCellByPosition( 4, i% + 1 ) + tableCell.String=tableRows3(i%) + next i% +end Sub + + +Sub CreateDocState + aDoc = gOutputDoc + table = aDoc.TextTables.GetByIndex (1) + + for j% = 0 to 7 + for i% = 0 to 4 + sRangeName = GetRangeName(j%, i%+1) + + tableCursor = table.createCursorByCellName(sRangeName) + + cName = tableCursor.getRangeName() + xCell = table.getCellByName(cName) + + xCell.BackTransparent = False + + If gErrorState (j%, i%) = cLogTrue Then + xCell.BackColor = cCoGreen + else + If gErrorState (j%, i%) = cLogFalse Then + xCell.BackColor = cCoRed + If ( gTestCaseAnnotations( j%, i% ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( j%, i% ) + xCell.insertTextContent( xCell, annotation, false ) + End If + else + xCell.BackColor = cCoGrey + end If + end If + next i% + next j% +end Sub + +Sub CreateSecondState + aDoc = gOutputDoc + table = aDoc.TextTables.GetByIndex (0) + + Dim stateIndex(2) as Integer + stateIndex(0) = cStDataBase + stateIndex(1) = cStExtension + stateIndex(2) = cStTestGlue + + Dim j as Integer + For j = LBound( stateIndex ) To UBound( stateIndex ) + for i% = 1 to 6 + tableCell = table.getCellByPosition( 2 * j + 1, i% ) + tableCell.BackTransparent = False + + if gErrorState( stateIndex(j), i% - 1 ) = cLogTrue then + tableCell.BackColor = cCoGreen + else + if gErrorState ( stateIndex(j), i% - 1 ) = cLogFalse then + tableCell.BackColor = cCoRed + If ( gTestCaseAnnotations( stateIndex(j), i% - 1 ) <> "" ) Then + Dim annotation as Object + annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) + annotation.Author = "smoketest" + annotation.Content = gTestCaseAnnotations( stateIndex(j), i% - 1 ) + tableCell.insertTextContent( tableCell, annotation, false ) + End If + else + tableCell.BackColor = cCoGrey + end If + end If + next i% + next j% +end Sub + +Function GetRangeName (nColumn as integer, nRow as integer) as string + GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) +end Function + +Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) + If ( gCurrentTestCase = cLogfileFailed ) Then + Dim sAnnotation as String + sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" + LogState( FALSE, sAnnotation, MainFileChannel ) + SetStatus( 0, FALSE, sAnnotation ) + Else + If ( LocalFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, LocalFileChannel ) + EndIf + if ( MainFileChannel <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + EndIf + SetStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) + End If +End Sub + +Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) + Dim nStatusType as Integer + Dim nState as integer + nStatusType = GetStatusType( gCurrentDocTest ) + If nStatusType = cStNone then Exit Sub + + if bState then + nState = cLogTrue + else + nState = cLogFalse + end If + + If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then + ' don't overwrite a previous "failed" state for this this + nState = cLogFalse + End If + + gErrorState (nStatusType, nAction) = nState + + If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then + gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) + End If +end Sub + +Function GetStatusType (nDocType as Integer) as Integer + Select Case ( nDocType ) + case frmWriter + GetStatusType = cStWriter ' text document + case frmCalc + GetStatusType = cStCalc ' spreadsheet document + case frmImpress + GetStatusType = cStPraesentation ' presentation + case frmDraw + GetStatusType = cStZeichnen ' drawing + case frmMath + GetStatusType = cStMath ' formula + case frmHyperText + GetStatusType = cStHTML ' HTML document + case frmChart + GetStatusType = cStChart ' chart + case frmJava + GetStatusType = cStJava 'Java + case frmTestGlue + GetStatusType = cStTestGlue ' test framework + case frmDataBase + GetStatusType = cStDataBase 'DataBase + case frmExtension + GetStatusType = cStExtension 'Extension + case else + GetStatusType = cStNone + end Select +end Function + +Sub SetParagraphBreak (aCursor as Object) + aCursor.Text.InsertControlCharacter (aCursor, cParagraphBreak, True) +end Sub + +Sub ClearDoc (aDoc as Object) + Dim aText as Object + Dim i% + for i%=1 to aDoc.TextTables.count + aDoc.TextTables.GetByIndex(0).dispose + next + + aText = aDoc.Text.CreateTextCursor + aText.GotoStart (False) + aText.GoRight (3, False) + SetParagraphBreak (aText) + aText.GotoEnd (True) + aText.String="" +end Sub + +Sub ClearDocFull (aDoc as Object) + Dim aText as Object + Dim i% + for i%=1 to aDoc.TextTables.count + aDoc.TextTables.GetByIndex(0).dispose + next + + aText = aDoc.Text.CreateTextCursor + aText.GotoStart (False) + aText.GotoEnd (True) + aText.String="" +end Sub + +Sub SetGlobalOptionsDialog () + + Dim oLibContainer As Object, oLib As Object + Dim oInputStreamProvider As Object + Dim oDialog As Object + + Const sLibName = cTest10Modul + Const sDialogName = cOptionsDialogName + + REM get library and input stream provider + oLibContainer = DialogLibraries + + REM load the library + oLibContainer.loadLibrary( sLibName ) + + oLib = oLibContainer.getByName( sLibName ) + oInputStreamProvider = oLib.getByName( sDialogName ) + + REM create dialog control + gOptionsDialog = CreateUnoDialog( oInputStreamProvider ) + +end Sub + +Sub ShowOptionsDlg + + call SetGlobalDoc + call SetGlobalOptionsDialog + call GetOptions + + REM show the dialog + gOptionsDialog.execute() + + ' jetzt läuft der Dialog, bis ein Button gedrückt wird + + Select Case (gDlgState) + case cDlgOk + call SetOptions () + case cDlgStartTest + call SetOptions () + call StartTestByOptions () + end Select + + gOptionsDialog.dispose() + +end Sub + +Sub SetOptions + call SetGlobalDoc + SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc) + SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc) +end Sub + +Sub GetOptions + call SetGlobalDoc + gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutputDoc))) + gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutputDoc))) + gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutputDoc))) + gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutputDoc))) + gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutputDoc))) + gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutputDoc))) + gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutputDoc))) + gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutputDoc))) + gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc))) + gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc))) + gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc))) + gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc))) +End Sub + +Sub ReadOptions + call SetGlobalDoc + bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutputDoc) + bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutputDoc) + bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutputDoc) + bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutputDoc) + bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutputDoc) + bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutputDoc) + bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutputDoc) + bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutputDoc) + bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutputDoc) + bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutputDoc) + bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc) + bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) + bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) +end Sub + +Sub SetDefaultOptions + bMakeWriterTest = true + bMakeCalcTest = true + bMakeImpressTest = true + bMakeDrawTest = true + bMakeHTMLTest = true + bMakeMathTest = true + bMakeChartTest = true + if Environ("SOLAR_JAVA") = "" then + bMakeJavaTest = false + bMakeDBTest = false + bMakeExtensionTest = false + else + bMakeJavaTest = true + bMakeDBTest = true + bMakeExtensionTest = true + End If + bMakeSaveOpenXMLTest = true + REM Disable StarOffice 5.0 tests in case binfilter has not been included + bMakeSaveOpen8Test = true + bMakeTerminateAfterTest = false +end Sub + +Sub StartTestByOptions + bShowTable = true + call ReadOptions + call Main + if bMakeTerminateAfterTest then + ClearDocFull (gOutputDoc) + gOutputDoc.dispose + 'StarDesktop.Terminate + + 'EnableReschedule( false ) + 'DispatchSlot( 5300 ) + stop + End If +end Sub + +Function StartTestWithDefaultOptions + bShowTable = false + call SetDefaultOptions + call Main + dim component(cMaxErrorStates) as string + component(cStWriter) = "Writer" + component(cStCalc) = "Calc" + component(cStPraesentation) = "Impress" + component(cStZeichnen) = "Draw" + component(cStChart) = "Chart" + component(cStMath) = "Math" + component(cStHTML) = "HTML" + component(cStJava) = "Java" + component(cStDataBase) = "Base" + component(cStExtension) = "Extensions" + dim action(2) as string + action(cDocNew) = "new" + action(cDocSaveOpen8) = "V8.0" + action(cDocSaveOpenXML) = "XML" + dim baseAction(5) as string + baseAction(cDBService) = "services" + baseAction(cDBOpen) = "open" + baseAction(cDBInsert) = "insert" + baseAction(cDBDelete) = "delete" + baseAction(cDBSeek) = "seek" + baseAction(cDBClose) = "close" + dim extAction(2) as string + extAction(cEXTService) = "services" + extAction(cEXTInstall) = "install" + extAction(cEXTUninstall) = "uninstall" + dim result as string + for i = 0 to cMaxErrorStates + for j = 0 to 5 + if gErrorState(i, j) = cLogFalse then + result = result & " " & component(i) & ":" + if i = cStDataBase then + result = result & baseAction(j) + else if i = cStExtension then + result = result & extAction(j) + else + result = result & action(j) + end if + end if + end if + next j + next i + StartTestWithDefaultOptions = result +end Function + +Sub DispatchSlot(SlotID as Integer) + Dim oArg() as new com.sun.star.beans.PropertyValue + Dim oUrl as new com.sun.star.util.URL + Dim oTrans as Object + Dim oDisp as Object + + oTrans = createUNOService("com.sun.star.util.URLTransformer") + oUrl.Complete = "slot:" & CStr(SlotID) + oTrans.parsestrict(oUrl) + + oDisp = StarDesktop.queryDispatch(oUrl, "_self", 0) + oDisp.dispatch(oUrl, oArg()) +End Sub + +Sub LoadLibrary( LibName As String ) + + dim args(1) + dim arg as new com.sun.star.beans.PropertyValue + arg.Name = "LibraryName" + arg.Value = LibName + args(0) = arg + + dim url as new com.sun.star.util.URL + dim trans as object + trans = createUnoService("com.sun.star.util.URLTransformer" ) + url.Complete = "slot:6517" + trans.parsestrict( url ) + + dim disp as object + disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) + disp.dispatch( url, args() ) + +End Sub + +Sub ExecuteSlot( SlotNr As String, oDoc as Object ) + dim args() + dim url as new com.sun.star.util.URL + dim trans as object + dim disp as object + + trans = createUnoService("com.sun.star.util.URLTransformer" ) + url.Complete = "slot:" + SlotNr + trans.parsestrict( url ) + + disp = oDoc.CurrentController.Frame.queryDispatch( url, "", 0 ) + disp.dispatch( url, args() ) + +End Sub + +Sub DelAllUserFields (aDoc as Object) + Dim aFieldType as Object + Dim aElements as Variant + Dim i% + Dim aFieldMasters, aFieldMaster as Object + Dim sElement$ + aFieldMasters = aDoc.TextFieldMasters + aElements = aFieldMasters.ElementNames + for i = 0 to UBound(aElements) + sElement$ = aElements(i) + if 0 <> instr(sElement$, cUnoUserField ) then + aFieldMaster = aFieldMasters.GetByName(sElement$) + aFieldMaster.Dispose + endif + next +end Sub + +Function GetUserFieldState (sName as String, aDoc as Object) as boolean + Dim sFieldText as String + Dim bState as boolean + sFieldText = ReadUserField (sName, aDoc) + + if LCase(sFieldText) = cYes then + bState = true + else + bState = false + end IF + + GetUserFieldState = bState +end Function + +Sub SetUserFieldState (sName as String, nState as boolean, aDoc as Object) + Dim sFieldText as String + + sFieldText = cNo 'default + + Select case nState + case true + sFieldText = cYes + case false + sFieldText = cNo + end Select + + WriteUserField (sFieldText, sName, aDoc) +end Sub + +Function ReadUserField(sFieldName as String, aDoc as Object) as String + Dim aMasters as Object + aMasters = aDoc.TextFieldMasters + if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then + ReadUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName).Content + else + ReadUserField = "" + end If +End Function + +Sub WriteUserField(sValue as String, sFieldName as String, aDoc as Object, optional aCursor as Object) + Dim aMasters, aUserField, aTxtCursor as Object + aMasters = aDoc.TextFieldMasters + if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then + aUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName) + else + aUserField = aDoc.CreateInstance (cUnoUserField) + aUserField.Name = sFieldName + end if + aUserField.Content = sValue +End Sub + +Sub WriteExtUserField(nIndex as Integer, aCursor as Object, aDoc as Object) + Dim aUserField as Object + aUserField = aDoc.CreateInstance (cUnoExtUserField) + aUserField.UserDataType = nIndex + aCursor.Text.InsertTextContent (aCursor, aUserField, True) + aUserField.Fix = True +End Sub + diff --git a/smoketestdoc/data/OptionsDlg.xml b/smoketestdoc/data/OptionsDlg.xml new file mode 100755 index 000000000000..c03026185886 --- /dev/null +++ b/smoketestdoc/data/OptionsDlg.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smoketestdoc/data/Test_10er.xml b/smoketestdoc/data/Test_10er.xml new file mode 100755 index 000000000000..a6f46b01eb78 --- /dev/null +++ b/smoketestdoc/data/Test_10er.xml @@ -0,0 +1,690 @@ + + + +REM 10er Test + +const sSWLogFileName = "swlog.dat", sSCLogFileName = "sclog.dat" +const sSDLogFileName = "sdlog.dat", sSMathLogFileName = "smalog.dat" +const sSChartLogFileName = "schlog.dat" +const sSHptLogFileName = "shptlog.dat" +const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" +const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" +const sTestGlueLogFileName = "testgluelog.dat" +const sLogFileName = "log.dat" +const cTempFileName = "ttt" + +const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" +const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" +const cMessageNewDoc = "New Document" +const cMessageCloseDoc = "Close Document" + +Global sWorkPath$ +Global sWorkPathURL$ +Global LocalFileChannel% +Global MainFileChannel% + +Sub Main + call TestAllDocs() +end Sub + +Sub DeleteAllSavedFiles() + Dim sFileName as String + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmHyperText) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter or cFltXML) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc or cFltXML) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress or cFltXML) + If FileExists (sFileName) then + Kill (sFileName) + End If + sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw or cFltXML) + If FileExists (sFileName) then + Kill (sFileName) + End If +End Sub + +Sub DeleteAllLogFiles() + If FileExists (sWorkPath+sLogFileName) then + Kill (sWorkPath+sLogFileName) + End If + If FileExists (sWorkPath+sSWLogFileName) then + Kill (sWorkPath+sSWLogFileName) + End If + If FileExists (sWorkPath+sSCLogFileName) then + Kill (sWorkPath+sSCLogFileName) + End If + If FileExists (sWorkPath+sSDLogFileName) then + Kill (sWorkPath+sSDLogFileName) + End If + If FileExists (sWorkPath+sSMathLogFileName) then + Kill (sWorkPath+sSMathLogFileName) + End If + If FileExists (sWorkPath+sSChartLogFileName) then + Kill (sWorkPath+sSChartLogFileName) + End If + If FileExists (sWorkPath+sSHptLogFileName) then + Kill (sWorkPath+sSHptLogFileName) + End If + If FileExists (sWorkPath+sSDrawLogFileName) then + Kill (sWorkPath+sSDrawLogFileName) + End If + If FileExists (sWorkPath+sJavaLogFileName) then + Kill (sWorkPath+sJavaLogFileName) + End If + If FileExists (sWorkPath+sTestGlueLogFileName) then + Kill (sWorkPath+sTestGlueLogFileName) + End If + If FileExists (sWorkPath+sSDBLogFileName) then + Kill (sWorkPath+sSDBLogFileName) + End If + If FileExists (sWorkPath+sExtLogFileName) then + Kill (sWorkPath+sExtLogFileName) + End If +end Sub + +Function OpenLogDat (sFileName as String) as Integer + Dim LocaleFileChannel% + If FileExists (sWorkPath+sFileName) then + Kill (sWorkPath+sFileName) + End If + LocaleFileChannel% = Freefile + Open sWorkPath+sFileName For Output As LocaleFileChannel% + OpenLogDat = LocaleFileChannel% +end Function + +Function GetWorkPath as string + sTemp = "$(userpath)/temp/" + GetWorkPath = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) +End Function + +Function GetWorkURL as string + sTemp = "$(userurl)/temp/" + GetWorkURL = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) +End Function + +Function GetSystem (sTmpWorkPath as string) as string + GetSystem = "" + if InStr (sTmpWorkPath, ":") then + GetSystem = "windows" + else + GetSystem = "unix" + End If +end Function + +Function ConvertPathToWin (sTmpWorkPath as string) as string + for i%=1 to Len(sTmpWorkPath) + sTemp = Mid (sTmpWorkPath, i%, 1) + if sTemp = "/" then + sTmpWorkPath = Left (sTmpWorkPath, i%-1) + "\" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) + else + if sTemp = "|" then + sTmpWorkPath = Left (sTmpWorkPath, i%-1) + ":" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) + end If + end If + next i% + ConvertPathToWin = sTmpWorkPath +end Function + +Sub TestAllDocs() +DIM sDocURL as String, sDocPath as String +DIM nStrPos as Long + + sWorkPath = GetWorkPath + sWorkPathURL = GetWorkURL + + if GetSystem (sWorkPath) = "windows" then + sWorkPath = ConvertPathToWin (sWorkPath) + end if + + 'search ExtensionURL + sDocURL = gOutputDoc.URL + CompatibilityMode(true) + nStrPos = InStrRev (sDocURL, "/" ) + CompatibilityMode(false) + sExtensionURL = Left (sDocURL, nStrPos) + + call DeleteAllSavedFiles() + call DeleteAllLogFiles() + MainFileChannel = OpenLogDat (sLogFileName) + call WriteTestSequence + if bMakeWriterTest then + gCurrentDocTest = frmWriter + call MakeDocTest + end if + if bMakeCalcTest then + gCurrentDocTest = frmCalc + call MakeDocTest + end if + if bMakeImpressTest then + gCurrentDocTest = frmImpress + call MakeDocTest + end if + if bMakeDrawTest then + gCurrentDocTest = frmDraw + call MakeDocTest + end if + if bMakeHTMLTest then + gCurrentDocTest = frmHyperText + call MakeDocTest + end if + if bMakeChartTest then + gCurrentDocTest = frmChart + call MakeChartTest + end if + if bMakeMathTest then + gCurrentDocTest = frmMath + call MakeNewDoc + end if + if bMakeJavaTest then + gCurrentDocTest = frmJava + call TestJava + end if + if bMakeDBTest then + gCurrentDocTest = frmDataBase + call Test_DB.TestDB + end if + if bMakeExtensionTest then + gCurrentDocTest = frmExtension + call Test_Ext.TestExtensions + end if + + Close #MainFileChannel + MainFileChannel = 0 +end Sub + +Sub WriteTestSequence + Print #MainFileChannel, "Sequence of testing" + + if bMakeWriterTest then + WriteTests ("writer : ", true, MainFileChannel) + end if + if bMakeCalcTest then + WriteTests ("calc : ", true, MainFileChannel) + end if + if bMakeImpressTest then + WriteTests ("impress : ", true, MainFileChannel) + end if + if bMakeDrawTest then + WriteTests ("draw : ", true, MainFileChannel) + end if + if bMakeHTMLTest then + WriteTests ("HTML : ", true, MainFileChannel) + end if + if bMakeChartTest then + WriteTests ("chart : ", false, MainFileChannel) + end if + if bMakeMathTest then + WriteTests ("math : ", false, MainFileChannel) + end if + if bMakeJavaTest then + WriteTests ("Java : ", false, MainFileChannel) + end if + if bMakeDBTest then + WriteDBTests ("Database : ", MainFileChannel) + end if + if bMakeExtensionTest then + WriteExtensionTests ("Extension : ", MainFileChannel) + end if + + Print #MainFileChannel +end Sub + +Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) + Dim sWriteStr as string + + sWriteStr = sText + sWriteStr = sWriteStr + "new" + if bTestAll then + if bMakeSaveOpen8Test then + sWriteStr = sWriteStr + ", save 8.0" + end if + if bMakeSaveOpenXMLTest then + sWriteStr = sWriteStr + ", save XML" + end if + if bMakeSaveOpen8Test then + sWriteStr = sWriteStr + ", open 8.0" + end if + if bMakeSaveOpenXMLTest then + sWriteStr = sWriteStr + ", open XML" + end if + end if + + sWriteStr = sWriteStr + ", close" + + Print #nFileChannel, sWriteStr +end Sub + +Sub WriteDBTests (sText as string, nFileChannel as integer) + Dim sWriteStr as string + + sWriteStr = sText + sWriteStr = sWriteStr + "open / services" + sWriteStr = sWriteStr + ", insert" + sWriteStr = sWriteStr + ", delete" + sWriteStr = sWriteStr + ", seek" + sWriteStr = sWriteStr + ", close" + + Print #nFileChannel, sWriteStr +end Sub + +Sub WriteExtensionTests (sText as string, nFileChannel as integer) + Dim sWriteStr as string + + sWriteStr = sText + sWriteStr = sWriteStr + "services" + sWriteStr = sWriteStr + ", install" + sWriteStr = sWriteStr + ", uninstall" + + Print #nFileChannel, sWriteStr +end Sub + +Sub MakeDocTest + Dim oDoc as Object + Dim sFileNameXML$, sFileName8$ + Dim bSuccess as Boolean + + On Local Error GoTo DOCTESTERROR + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + if not IsNull (oDoc) then + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then + sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFlt8) + SaveDoc (sFileName8, oDoc, GetDocFilter(gCurrentDocTest or cFlt8)) + end if + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then + sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFltXML) + SaveDoc (sFileNameXML, oDoc, GetDocFilter(gCurrentDocTest or cFltXML)) + end if + gCurrentTestCase = cDocClose + bSuccess = CloseDoc( oDoc ) + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + gCurrentTestCase = cDocSaveOpen8 + if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then + oDoc = LoadDoc (sFileName8) + +' oDoc = Documents.open(sFileName) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) + + if not IsNull (oDoc) then + gCurrentTestCase = cDocClose + oDoc.close (true) + end If + end if + + gCurrentTestCase = cDocSaveOpenXML + if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then + oDoc = LoadDoc (sFileNameXML) + +' oDoc = Documents.open(sFileName) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) + + if not IsNull (oDoc) then + gCurrentTestCase = cDocClose + oDoc.close (true) + end If + end if + + end If + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub ' Without error + + DOCTESTERROR: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 + End If + Exit Sub ' With error +End Sub + +Sub MakeNewDoc + DIM oDoc as Object + Dim bSuccess as Boolean + On Local Error GoTo DOCTESTERROR2 + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew +' oDoc = Documents.Add(GetDocFilter(gCurrentDocTest)) + oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) + if not IsNull (oDoc) then + gCurrentTestCase = cDocClose + bSuccess = CloseDoc( oDoc ) + LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) + end If + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub ' Without error + + DOCTESTERROR2: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) + Close #LocalFileChannel% + LocalFileChannel = 0 + End If + Exit Sub ' With error +End Sub + +Sub MakeChartTest + Dim oCharts as Object + Dim oDoc as Object + Dim oRange(0) as New com.sun.star.table.CellRangeAddress + Dim oRect as New com.sun.star.awt.Rectangle + const cChartName="TestChart" + Dim bSuccess as Boolean + On Local Error GoTo CHARTTESTERROR + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) + if not IsNull (oDoc) then + oCharts = oDoc.sheets(0).Charts + oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) + bSuccess=oCharts.HasByName(cChartName) + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) + gCurrentTestCase = cDocClose + oDoc.close (true) + else + LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) + End if + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub ' Without error + + CHARTTESTERROR: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) + Close #LocalFileChannel% + LocalFileChannel = 0 + End If + Exit Sub ' With error +End Sub + +Sub LogState (bState as Boolean, sText as String, nLocaleFileChannel as integer) + if bState then + Print #nLocaleFileChannel, sText+" -> ok" + else + Print #nLocaleFileChannel, sText+" -> error" + end If +end Sub + +Function GetDocEndings (DocType as Integer) as String + Select Case ( DocType ) + case frmWriter or cFlt8 + GetDocEndings = "odt" ' Textdokument + case frmCalc or cFlt8 + GetDocEndings = "ods" 'Tabellendokument + case frmImpress or cFlt8 + GetDocEndings = "odp" 'PrÕsentation + case frmDraw or cFlt8 + GetDocEndings = "odg" 'Zeichen + case frmHyperText, frmHyperText or cFltXML + GetDocEndings = "html" 'Hypertext-Dokument + case frmWriter or cFltXML + GetDocEndings = "sxw" ' Textdokument + case frmCalc or cFltXML + GetDocEndings = "sxc" 'Tabellendokument + case frmImpress or cFltXML + GetDocEndings = "sxi" 'PrÕsentation + case frmDraw or cFltXML + GetDocEndings = "sxd" 'Zeichen + case else + GetDocEndings = "" + end Select +end Function + +Function GetDocFilter (DocType as Integer) as String + Select Case ( DocType ) + case frmWriter or cFlt8 + GetDocFilter = "writer8" ' text document + case frmCalc or cFlt8 + GetDocFilter = "calc8" ' spreadsheet document + case frmImpress or cFlt8 + GetDocFilter = "impress8" ' presentation + case frmDraw or cFlt8 + GetDocFilter = "draw8" ' drawing + case frmMath or cFlt8 + GetDocFilter = "math8" ' formula + + case frmWriter or cFltXML + GetDocFilter = "StarOffice XML (Writer)" ' text document + case frmCalc or cFltXML + GetDocFilter = "StarOffice XML (Calc)" ' spreadsheet document + case frmImpress or cFltXML + GetDocFilter = "StarOffice XML (Impress)" ' presentation + case frmDraw or cFltXML + GetDocFilter = "StarOffice XML (Draw)" ' drawing + case frmMath or cFltXML + GetDocFilter = "StarOffice XML (Math)" ' formula + + case frmHyperText, frmHyperText or cFltXML + GetDocFilter = "HTML" ' HTML document + + case frmWriter or cFltNewDoc + GetDocFilter = "swriter" ' text document + case frmCalc or cFltNewDoc + GetDocFilter = "scalc" ' spreadsheet document + case frmImpress or cFltNewDoc + GetDocFilter = "simpress" ' presentation + case frmDraw or cFltNewDoc + GetDocFilter = "sdraw" ' drawing + case frmMath or cFltNewDoc + GetDocFilter = "smath" ' formula + case frmHyperText or cFltNewDoc + GetDocFilter = "swriter/web" ' HTML document + case frmChart or cFltNewDoc + GetDocFilter = "schart" ' chart + case else + GetDocFilter = "" + end Select +end Function + +Function GetLogFileName (DocType as Integer) as String + Select Case ( DocType ) + case frmWriter + GetLogFileName = sSWLogFileName ' text document + case frmCalc + GetLogFileName = sSCLogFileName ' spreadsheet document + case frmImpress + GetLogFileName = sSDLogFileName ' presentation + case frmDraw + GetLogFileName = sSDrawLogFileName ' drawing + case frmMath + GetLogFileName = sSMathLogFileName ' formula + case frmHyperText + GetLogFileName = sSHptLogFileName ' HTML document + case frmChart + GetLogFileName = sSChartLogFileName ' chart + case frmJava + GetLogFileName = sJavaLogFileName 'Java + case frmOther + GetLogFileName = sTestGlueLogFileName ' test framework + case frmDataBase + GetLogFileName = sSDBLogFileName 'Database + case frmExtension + GetLogFileName = sExtLogFileName 'Extension + case else + GetLogFileName = "" + end Select +end Function + +Function GetErrorMessageOnAction (nAction as Integer) as String + Select Case ( nAction ) + case cDocNew + GetErrorMessageOnAction = cMessageNewDoc + case cDocSaveOpen8 + GetErrorMessageOnAction = cMessageSaveOpen8Doc + case cDocSaveOpenXML + GetErrorMessageOnAction = cMessageSaveOpenXMLDoc + case cDocClose + GetErrorMessageOnAction = cMessageCloseDoc + case else + GetErrorMessageOnAction = "" + end Select +end Function + +Function IsFilterAvailable (FilterType as Integer) as boolean + IsFilterAvailable = true + if ((FilterType = (frmHyperText or cFltXML))) then + IsFilterAvailable = false + end if +End Function + +Function TestJava + Dim oObj as Object + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + gCurrentTestCase = cDocNew + oObj = createUnoService( cUnoJavaLoader ) + LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) + + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + + TestJava = not IsNull (oObj) +End Function + +Sub LoadLibrary( LibName as String ) + + dim args(1) + dim arg as new com.sun.star.beans.PropertyValue + arg.Name = "LibraryName" + arg.Value = LibName + args(0) = arg + + dim url as new com.sun.star.util.URL + dim trans as object + trans = createUnoService("com.sun.star.util.URLTransformer" ) + url.Complete = "slot:6517" + trans.parsestrict( url ) + + dim disp as object + disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) + disp.dispatch( url, args() ) + +End Sub + +Sub LoadDoc (DocName as String) as Object + dim trans as object + trans = createUnoService("com.sun.star.util.URLTransformer" ) + url = createUnoStruct("com.sun.star.util.URL" ) + url.Complete = DocName + if Left(DocName, 5 ) <> "file:" then + trans.parsestrict( url ) + endif + + Dim aPropArray(0) as Object + aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") + aPropArray(0).Name = "OpenFlags" + aPropArray(0).Value = "S" + + dim doc as object + dim noargs() + doc = StarDesktop.loadComponentFromURL( url.Complete, "_blank", 0, aPropArray() ) ' XModel + LoadDoc = doc +End Sub + +Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string ) + dim trans as object + trans = createUnoService("com.sun.star.util.URLTransformer" ) + url = createUnoStruct("com.sun.star.util.URL" ) + url.Complete = DocName + if Left(DocName, 5 ) <> "file:" then + trans.parsestrict( url ) + endif + + if not (sFilterName = "") then + Dim aPropArray(0) as Object + aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") + aPropArray(0).Name = "FilterName" + aPropArray(0).Value = sFilterName + + oDoc.storeAsURL( url.Complete, aPropArray() ) + else + MessageBox "Filtername is unknown!" + end if +end Sub + +Function CloseDoc( oDoc as Object ) + Dim oListener as Object + oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" ) + oDoc.addCloseListener( oListener ) + + Events.ResetCloseListenerFlag() + oDoc.close( true ) + closeDoc = Events.HasCloseListenerBeenCalled() + + if ( Not Events.HasCloseListenerBeenCalled() ) Then + ' do this only if closing was not successful - otherwise, we'd get a DisposedException + oDoc.removeCloseListener( oListener ) + End If +End Function + diff --git a/smoketestdoc/data/Test_DB.xml b/smoketestdoc/data/Test_DB.xml new file mode 100755 index 000000000000..a9f1fc2e316d --- /dev/null +++ b/smoketestdoc/data/Test_DB.xml @@ -0,0 +1,147 @@ + + + +REM ***** Database Test ***** + +const cMessageDatabaseService = "Database Service" +const cMessageDatabaseOpen = "Open Database" +const cMessageDatabaseInsert = "Insert record into Database" +const cMessageDatabaseDelete = "Delete record from Database" +const cMessageDatabaseSeek = "Read other record from Database" +const cMessageDatabaseClose = "Close Database" + +Sub TestDB + + Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object + Dim sDBName as String, sTable as String, sCurrentMessage as String + Dim nRowCount as Integer + Dim bResult as Boolean + Const sTestString = "Automatical Test" + + On Local Error GoTo DBERROR + + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + + gCurrentTestCase = cDBService + sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext + + oDBContext = CreateUnoService(cUnoDatabaseContext) + sDBName=oDBContext.ElementNames(0) 'Names of Databases + + gCurrentTestCase = cDBOpen + sCurrentMessage = cMessageDatabaseOpen + + oDataSource = oDBContext.GetByName(sDBName) + sTable=oDataSource.Tables.ElementNames(0) + oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") + + LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) + if (IsNull(oDBConnection)) then + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub + End If + + ' Database is open now + + gCurrentTestCase = cDBService + sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet + oRowSet = createUnoService(cUnoRowSet) + + if (IsNull(oRowSet)) then + LogTestResult( "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) + Exit Sub + else + LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) + End If + + gCurrentTestCase = cDBInsert + sCurrentMessage = cMessageDatabaseInsert + + oRowSet.ActiveConnection = oDBConnection + + oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND + oRowSet.Command = "SELECT * FROM " + sTable + oRowSet.execute() + + oRowSet.moveToInsertRow + oRowSet.updateString(5, sTestString) + + oRowSet.insertRow() + nRowCount=oRowSet.RowCount + + oRowSet.moveToCurrentRow() + + bResult = (oRowSet.getString(5) = sTestString) + LogTestResult( "Database "+ cMessageDatabaseInsert, bResult ) + + 'delete only if insert passed + + if (bResult) Then + gCurrentTestCase = cDBDelete + sCurrentMessage = cMessageDatabaseDelete + oRowSet.deleteRow() + bResult = (nRowCount - oRowSet.RowCount = 0) + if ( bResult ) Then + oRowSet.next() + bResult = (nRowCount - oRowSet.RowCount = 1) + End If + LogTestResult( "Database "+ cMessageDatabaseDelete, bResult ) + End If + + ' read other record + + gCurrentTestCase = cDBSeek + sCurrentMessage = cMessageDatabaseSeek + oRowSet.first() + bResult = not (oRowSet.getString(5) = sTestString) + LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) + + gCurrentTestCase = cDBClose + sCurrentMessage = cMessageDatabaseClose + oDBConnection.Dispose() + LogTestResult( "Database "+ cMessageDatabaseClose, True ) + + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub ' Without error + + DBERROR: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( "Database "+ sCurrentMessage, FALSE ) + Close #LocalFileChannel% + LocalFileChannel = 0 + End If + Exit Sub ' With error +End Sub + diff --git a/smoketestdoc/data/Test_Ext.xml b/smoketestdoc/data/Test_Ext.xml new file mode 100755 index 000000000000..735aae537596 --- /dev/null +++ b/smoketestdoc/data/Test_Ext.xml @@ -0,0 +1,116 @@ + + + +REM ***** BASIC ***** + +const cMessageExtensionService = "Extension Service" +const cMessageExtensionInstall = "Install Extension" +const cMessageExtensionUninstall = "Uninstall Extension" + +Sub TestExtensions + Dim oTestExtension as Object, obj_null as Object + Dim sCurrentMessage as String + Dim bResult as Boolean + Dim sImplementationNameString as String + sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" + + On Local Error GoTo EXTERROR + + gCurrentTestCase = cLogfileFailed + LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + + sCurrentMessage = cMessageExtensionService + gCurrentTestCase = cEXTService + + 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for + 'adding the extension. The implementation is in + 'javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java and the code is in juh.jar + cmdEnv = createUnoService(cUnoSmoketestCommandEnvironment) + + 'Create the component context and then get the singleton ExtensionManager + 'A singleton cannot be created with createUnoService + ctx = getDefaultContext + ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) + + LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) + if (IsNull(ext_mgr)) then + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub + End If + + sCurrentMessage = cMessageExtensionInstall + gCurrentTestCase = cEXTInstall + + 'Add the extension. We must provide a file URL here. + 'By passing "user" we determine that the actions we perform on + 'XExtensionManager only affect the user installation. To modify the share installation one would pass "share". + + Dim props() as Object + ext_mgr.addExtension(sExtensionURL + cExtensionFileName, props, "user", obj_null, cmdEnv) + + 'Check if the extension has been added by creating a service which is contained in the extension. + oTestExtension = createUnoService(cUnoSmoketestTestExtension) + bResult = (oTestExtension.getImplementationName = sImplementationNameString) + LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) + if (not bResult) then + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub + End If + + sCurrentMessage = cMessageExtensionUninstall + gCurrentTestCase = cEXTUninstall + + 'Remove the package + ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) + + 'Try to create the service which is contained in the now removed extension. + oTestExtension = createUnoService(cUnoSmoketestTestExtension) + + 'The service must not be available anymore. Therefor isNull must return true. + LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) + + Print #LocalFileChannel, "---" + Close #LocalFileChannel% + LocalFileChannel = 0 + Exit Sub ' Without error + + EXTERROR: + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( "Extension "+ sCurrentMessage, False ) + Close #LocalFileChannel% + LocalFileChannel = 0 + End If + Exit Sub ' With error + +End Sub + diff --git a/smoketestdoc/data/content.xml b/smoketestdoc/data/content.xml new file mode 100755 index 000000000000..3c81bbfbad5e --- /dev/null +++ b/smoketestdoc/data/content.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + stardiv.one.form.control.CommandButton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smoketestdoc/data/dialog-lb.xml b/smoketestdoc/data/dialog-lb.xml new file mode 100755 index 000000000000..973dfe688828 --- /dev/null +++ b/smoketestdoc/data/dialog-lb.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/smoketestdoc/data/dialog-lc.xml b/smoketestdoc/data/dialog-lc.xml new file mode 100755 index 000000000000..e3a5a0e326e4 --- /dev/null +++ b/smoketestdoc/data/dialog-lc.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/smoketestdoc/data/makefile.mk b/smoketestdoc/data/makefile.mk new file mode 100755 index 000000000000..6cf2706b52b2 --- /dev/null +++ b/smoketestdoc/data/makefile.mk @@ -0,0 +1,70 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#***********************************************************************/ + +PRJ = .. +PRJNAME = smoketestdoc +TARGET = data + +.INCLUDE: settings.mk + +$(BIN)/smoketestdoc.sxw: $(MISC)/zip/smoketestdoc.sxw + $(COPY) $< $@ + +$(MISC)/zip/smoketestdoc.sxw: \ + Events.xml \ + Global.xml \ + OptionsDlg.xml \ + Test_10er.xml \ + Test_DB.xml \ + Test_Ext.xml \ + content.xml \ + dialog-lb.xml \ + dialog-lc.xml \ + manifest.xml \ + meta.xml \ + script-lb.xml \ + script-lc.xml \ + settings.xml \ + styles.xml + $(COMMAND_ECHO)$(RM) -r $(MISC)/zip + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip + $(COMMAND_ECHO)$(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ + $(COMMAND_ECHO)printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/META-INF + $(COMMAND_ECHO)$(COPY) manifest.xml $(MISC)/zip/META-INF/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Basic + $(COMMAND_ECHO)$(COPY) script-lc.xml $(MISC)/zip/Basic/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Basic/Standard + $(COMMAND_ECHO)$(COPY) script-lb.xml Events.xml Global.xml Test_10er.xml Test_DB.xml \ + Test_Ext.xml $(MISC)/zip/Basic/Standard/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Dialogs + $(COMMAND_ECHO)$(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ + $(COMMAND_ECHO)$(MKDIR) $(MISC)/zip/Dialogs/Standard + $(COMMAND_ECHO)$(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ + $(COMMAND_ECHO)cd $(MISC)/zip && zip -rD $(@:f) . + +.INCLUDE: target.mk diff --git a/smoketestdoc/data/manifest.xml b/smoketestdoc/data/manifest.xml new file mode 100755 index 000000000000..48fc9ce900a0 --- /dev/null +++ b/smoketestdoc/data/manifest.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smoketestdoc/data/meta.xml b/smoketestdoc/data/meta.xml new file mode 100755 index 000000000000..43f14295e2b3 --- /dev/null +++ b/smoketestdoc/data/meta.xml @@ -0,0 +1,28 @@ + + +Oracle_Open_Office/3.2$Win32 OpenOffice.org_project/300m77$Build-9496$CWS-renaissance22001-06-08T15:59:032007-01-18T12:45:22de-DE0PT0S diff --git a/smoketestdoc/data/script-lb.xml b/smoketestdoc/data/script-lb.xml new file mode 100755 index 000000000000..fc4f6c6370ba --- /dev/null +++ b/smoketestdoc/data/script-lb.xml @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/smoketestdoc/data/script-lc.xml b/smoketestdoc/data/script-lc.xml new file mode 100755 index 000000000000..e3a5a0e326e4 --- /dev/null +++ b/smoketestdoc/data/script-lc.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/smoketestdoc/data/settings.xml b/smoketestdoc/data/settings.xml new file mode 100755 index 000000000000..cd4524b741ff --- /dev/null +++ b/smoketestdoc/data/settings.xml @@ -0,0 +1,28 @@ + + +003638217120truefalseview217120300200363801711900false100falsefalsefalsefalsefalse1falsefalsetruefalsetruefalsetruetruefalsetruetrueGgX+/01pY3Jvc29mdCBYUFMgRG9jdW1lbnQgV3JpdGVyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATWljcm9zb2Z0IFhQUyBEb2N1bWVudCBXcml0ZXIAAAAWAAEAPAQAAAAAAAAFAFZUAAAkbQAAM1ROVwIACABNAGkAYwByAG8AcwBvAGYAdAAgAFgAUABTACAARABvAGMAdQBtAGUAbgB0ACAAVwByAGkAdABlAHIAAAAAAAAAAQQABtwAWAMD/wAAAQABAJoLNAhkAAEADwBYAgIAAQBYAgIAAABBADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAACAAAAAQAAAP////8AAAAAAAAAAAAAAAAAAAAARElOVSIAEAFMAwwAytL2cgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAQAQAAU01USgAAAAAQAAABTQBpAGMAcgBvAHMAbwBmAHQAIABYAFAAUwAgAEQAbwBjAHUAbQBlAG4AdAAgAFcAcgBpAHQAZQByAAAASW5wdXRCaW4ARk9STVNPVVJDRQBSRVNETEwAVW5pcmVzRExMAEludGVybGVhdmluZwBPRkYASW1hZ2VUeXBlAEpQRUdNZWQAT3JpZW50YXRpb24AUE9SVFJBSVQAQ29sbGF0ZQBPRkYAUmVzb2x1dGlvbgBPcHRpb24xAFBhcGVyU2l6ZQBMRVRURVIAQ29sb3JNb2RlADI0YnBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAABNWERXAQEAABIAQ09NUEFUX0RVUExFWF9NT0RFDgBEVVBMRVhfVU5LTk9XTg==Adreßbuchfalseadressenfalsefalsefalsetruetruetruefalse0falsetruefalseMicrosoft XPS Document Writertruefalsetruetrue0truefalsefalsefalsetruetrue0truefalsetruefalsefalsetruefalsetruefalsetruetruedisabledfalsefalsefalse diff --git a/smoketestdoc/data/styles.xml b/smoketestdoc/data/styles.xml new file mode 100755 index 000000000000..3f8d75fa6db3 --- /dev/null +++ b/smoketestdoc/data/styles.xml @@ -0,0 +1,28 @@ + + + diff --git a/smoketestdoc/makefile.mk b/smoketestdoc/makefile.mk new file mode 100755 index 000000000000..2096d07de90e --- /dev/null +++ b/smoketestdoc/makefile.mk @@ -0,0 +1,70 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#***********************************************************************/ + +PRJ = .. +PRJNAME = smoketestoo_native +TARGET = data + +.INCLUDE: settings.mk + +$(BIN)/smoketestdoc.sxw: $(MISC)/zip/smoketestdoc.sxw + $(COPY) $< $@ + +$(MISC)/zip/smoketestdoc.sxw: \ + Events.xml \ + Global.xml \ + OptionsDlg.xml \ + Test_10er.xml \ + Test_DB.xml \ + Test_Ext.xml \ + content.xml \ + dialog-lb.xml \ + dialog-lc.xml \ + manifest.xml \ + meta.xml \ + script-lb.xml \ + script-lc.xml \ + settings.xml \ + styles.xml + $(RM) -r $(MISC)/zip + $(MKDIR) $(MISC)/zip + $(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ + printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype + $(MKDIR) $(MISC)/zip/META-INF + $(COPY) manifest.xml $(MISC)/zip/META-INF/ + $(MKDIR) $(MISC)/zip/Basic + $(COPY) script-lc.xml $(MISC)/zip/Basic/ + $(MKDIR) $(MISC)/zip/Basic/Standard + $(COPY) script-lb.xml Events.xml Global.xml Test_10er.xml Test_DB.xml \ + Test_Ext.xml $(MISC)/zip/Basic/Standard/ + $(MKDIR) $(MISC)/zip/Dialogs + $(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ + $(MKDIR) $(MISC)/zip/Dialogs/Standard + $(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ + cd $(MISC)/zip && zip -rD $(@:f) . + +.INCLUDE: target.mk diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst new file mode 100755 index 000000000000..4fd727fe2e6c --- /dev/null +++ b/smoketestdoc/prj/build.lst @@ -0,0 +1,4 @@ +smdoc smoketestdoc :: NULL +smdoc smoketestdoc usr1 - all smdoc_mkout NULL +smdoc smoketestdoc\data nmake - all smdoc_data NULL +smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL diff --git a/smoketestdoc/prj/d.lst b/smoketestdoc/prj/d.lst new file mode 100755 index 000000000000..618cd83a145b --- /dev/null +++ b/smoketestdoc/prj/d.lst @@ -0,0 +1,4 @@ +mkdir: %_DEST%\bin%_EXT% + +..\%__SRC%\bin\smoketestdoc.sxw %_DEST%\bin%_EXT%\smoketestdoc.sxw +..\%__SRC%\bin\TestExtension.oxt %_DEST%\bin%_EXT%\TestExtension.oxt diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF b/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF deleted file mode 100755 index 09e2f42ca0f6..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -RegistrationClassName: com.sun.star.comp.smoketest.TestExtension - diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl b/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl deleted file mode 100755 index 83c370e11a18..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.idl +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 _com_sun_star_comp_smoketest_TestExtension_idl_ -#define _com_sun_star_comp_smoketest_TestExtension_idl_ - -#include - - -module com { module sun { module star { module comp { module smoketest { - // example service, XServiceInfo is implemented here for demonstration - // issues. XServiceInfo must be implemented by all components. - service TestExtension: ::com::sun::star::lang::XServiceInfo; -};};};};}; - -#endif diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java b/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java deleted file mode 100755 index c08c719116ae..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/TestExtension.java +++ /dev/null @@ -1,166 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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. - * - ************************************************************************/ - -package com.sun.star.comp.smoketest; - -import com.sun.star.lib.uno.helper.Factory; -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.lang.XSingleComponentFactory; -import com.sun.star.lib.uno.helper.WeakBase; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.registry.XRegistryKey; -import com.sun.star.lang.XInitialization; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.uno.Type; - -/** This class capsulates the class, that implements the minimal component, a - * factory for creating the service (__getComponentFactory) and a - * method, that writes the information into the given registry key - * (__writeRegistryServiceInfo). - */ -public class TestExtension { - /** This class implements the component. At least the interfaces XServiceInfo, - * XTypeProvider, and XInitialization should be provided by the service. - */ - public static class _TestExtension extends WeakBase - implements XServiceInfo { - /** The service name, that must be used to get an instance of this service. - */ - static private final String __serviceName = - "com.sun.star.comp.smoketest.TestExtension"; - - /** The initial component contextr, that gives access to - * the service manager, supported singletons, ... - * It's often later used - */ - private XComponentContext m_cmpCtx; - - /** The service manager, that gives access to all registered services. - * It's often later used - */ - private XMultiComponentFactory m_xMCF; - - /** The constructor of the inner class has a XMultiServiceFactory parameter. - * @param xmultiservicefactoryInitialization A special service factory - * could be introduced while initializing. - */ - public _TestExtension(XComponentContext xCompContext) { - try { - m_cmpCtx = xCompContext; - m_xMCF = m_cmpCtx.getServiceManager(); - } - catch( Exception e ) { - e.printStackTrace(); - } - } - - /** This method returns an array of all supported service names. - * @return Array of supported service names. - */ - public String[] getSupportedServiceNames() { - return getServiceNames(); - } - - /** This method is a simple helper function to used in the - * static component initialisation functions as well as in - * getSupportedServiceNames. - */ - public static String[] getServiceNames() { - String[] sSupportedServiceNames = { __serviceName }; - return sSupportedServiceNames; - } - - /** This method returns true, if the given service will be - * supported by the component. - * @param sServiceName Service name. - * @return True, if the given service name will be supported. - */ - public boolean supportsService( String sServiceName ) { - return sServiceName.equals( __serviceName ); - } - - /** Return the class name of the component. - * @return Class name of the component. - */ - public String getImplementationName() { - return _TestExtension.class.getName(); - } - } - - - /** - * Gives a factory for creating the service. - * This method is called by the JavaLoader - *

- * @return returns a XSingleComponentFactory for creating - * the component - * @param sImplName the name of the implementation for which a - * service is desired - * @see com.sun.star.comp.loader.JavaLoader - */ - public static XSingleComponentFactory __getComponentFactory(String sImplName) - { - XSingleComponentFactory xFactory = null; - - if ( sImplName.equals( _TestExtension.class.getName() ) ) - xFactory = Factory.createComponentFactory(_TestExtension.class, - _TestExtension.getServiceNames()); - - return xFactory; - } - - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

- * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_TestExtension.class.getName(), - _TestExtension.getServiceNames(), - regKey); - } - /** This method is a member of the interface for initializing an object - * directly after its creation. - * @param object This array of arbitrary objects will be passed to the - * component after its creation. - * @throws Exception Every exception will not be handled, but will be - * passed to the caller. - */ - public void initialize( Object[] object ) - throws com.sun.star.uno.Exception { - /* The component describes what arguments its expected and in which - * order!At this point you can read the objects and can intialize - * your component using these objects. - */ - } - -} diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/delzip b/smoketestoo_native/com/sun/star/comp/smoketest/delzip deleted file mode 100755 index 636fda90bfcb..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/delzip +++ /dev/null @@ -1 +0,0 @@ -ECHO is OFF diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk b/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk deleted file mode 100755 index da9b302791f0..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/makefile.mk +++ /dev/null @@ -1,90 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# 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. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/.. -PRJNAME = smoke_test -PACKAGE = com$/sun$/star$/comp$/smoketest -TARGET = com_sun_star_comp_smoketest - -no_common_build_zip:=TRUE - -# --- Settings ----------------------------------------------------- - -.IF "$(SOLAR_JAVA)" != "" - -.INCLUDE : settings.mk - -JARFILES = ridl.jar jurt.jar unoil.jar juh.jar - - -JARTARGET = TestExtension.jar -JARCOMPRESS = TRUE -CUSTOMMANIFESTFILE = MANIFEST.MF - -ZIP1TARGET=TestExtension -ZIP1LIST=* -ZIPFLAGS=-r -ZIP1DIR=$(MISC)$/$(TARGET) -ZIP1EXT=.oxt - -# --- Files -------------------------------------------------------- - -#COPY_OXT_MANIFEST:= $(MISC)$/$(TARGET)$/META-INF$/manifest.xml -JAVAFILES = TestExtension.java - -# --- Targets ------------------------------------------------------ - -ZIP1DEPS=$(MISC)$/$(TARGET)$/$(JARTARGET)\ - $(MISC)$/$(TARGET)$/TestExtension.rdb\ - $(MISC)$/$(TARGET)$/META-INF$/manifest.xml - -.INCLUDE : target.mk - -$(MISC)$/$(TARGET)$/META-INF: - @-$(MKDIRHIER) $(@) - -$(MISC)$/TestExtension.urd: TestExtension.idl - $(IDLC) -O$(MISC) -I$(SOLARIDLDIR) -cid -we $< - -$(MISC)$/$(TARGET)$/META-INF$/manifest.xml $(MISC)$/$(TARGET)$/TestExtension.rdb : $(MISC)$/$(TARGET)$/META-INF - -$(MISC)$/$(TARGET)$/META-INF$/manifest.xml: manifest.xml - $(COPY) $< $@ - -$(MISC)$/$(TARGET)$/TestExtension.rdb: $(MISC)$/TestExtension.urd - $(REGMERGE) $@ /UCR $< - -$(JAVACLASSFILES) .UPDATEALL: $(MISC)$/$(TARGET)$/TestExtension.rdb - $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -X$(SOLARBINDIR)/types.rdb $< - -$(MISC)$/$(TARGET)$/$(JARTARGET) : $(JARTARGETN) - $(COPY) $< $@ - -.ELSE -@all: - @echo "Java disabled. Nothing to do." -.ENDIF diff --git a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml b/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml deleted file mode 100755 index 7e3e7947aa0f..000000000000 --- a/smoketestoo_native/com/sun/star/comp/smoketest/manifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/smoketestoo_native/data/Events.xml b/smoketestoo_native/data/Events.xml deleted file mode 100644 index 414f2c48e884..000000000000 --- a/smoketestoo_native/data/Events.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - -REM ***** BASIC ***** - -Global s_CloseListenerCalled As Boolean - -Sub PressCancel - gDlgState = cDlgCancel -end Sub - -Sub PressOk - gDlgState = cDlgOk -end Sub - -Sub PressTest - gOptionsDialog.EndExecute() - gDlgState = cDlgStartTest -end Sub - -Sub closeListener_queryClosing - ' not interested in - closeListener_queryClosing = TRUE -End Sub - -Sub closeListener_notifyClosing - s_CloseListenerCalled = TRUE -End Sub - -Sub closeListener_disposing - ' not interested in -End Sub - -Sub ResetCloseListenerFlag - s_CloseListenerCalled = FALSE -End Sub - -Function HasCloseListenerBeenCalled As Boolean - HasCloseListenerBeenCalled = s_CloseListenerCalled -End Function - diff --git a/smoketestoo_native/data/Global.xml b/smoketestoo_native/data/Global.xml deleted file mode 100755 index d437eafe3457..000000000000 --- a/smoketestoo_native/data/Global.xml +++ /dev/null @@ -1,789 +0,0 @@ - - - -REM ***** BASIC ***** - -const cMaxErrorStates = 14 - -const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256 -const cParagraphBreak = 0 - -global const cExtensionFileName = "TestExtension.oxt" - -global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 -global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 -global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 -global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 -global const cLogfileFailed = 255 - -global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 -global const cStHTML = 6, cStChart = 4, cStJava = 7 -global const cStMath = 5, cStDataBase = 9 -global const cStExtension = 11 -global const cStTestGlue = 12 -global const cStNone = -1 - -global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128 - -global const frmWriter = 1, frmCalc = 2, frmImpress = 4 -global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 -global const frmDataBase = 10, frmJava = 13 -global const frmExtension = 14 -global const frmTestGlue = 15 - -Global gCurrentDocTest As Integer -Global gCurrentTestCase As Integer - -global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2 - -'UserFieldKennungen -Global const cYes = "y", cNo = "n" -Global const cStateNo = 0, cStateYes = 1 - -'Feldtypen -Global const cFtExtUser = 21, cFtPageNum = 5, cFtStatistic = 8, cFtDateTime = 27, cFtDatabase = 31 - -'UnoStrings -Global const cUnoSeparator = "." -Global const cUnoPrefix = "com.sun.star." -Global const cUnoUserField = cUnoPrefix + "text.FieldMaster.User" -Global const cUnoExtUserField = cUnoPrefix + "text.TextField.ExtendedUser" -Global const cUnoMasterDataBase = cUnoPrefix + "text.FieldMaster.Database" -Global const cUnoDataBase = cUnoPrefix + "text.TextField.Database" -Global const cUnoDateTime = cUnoPrefix + "text.TextField.DateTime" -Global const cUnoTextGraphi2 = cUnoPrefix + "text.Graphic" -Global const cUnoJavaLoader = cUnoPrefix + "loader.Java" -Global const cUnoDatabaseContext = cUnoPrefix + "sdb.DatabaseContext" -Global const cUnoRowSet = cUnoPrefix + "sdb.RowSet" -Global const cUnoSmoketestTestExtension = cUnoPrefix + "comp.smoketest.TestExtension" -Global const cUnoSmoketestCommandEnvironment = cUnoPrefix + "deployment.test.SmoketestCommandEnvironment" -Global const cExtensionManager = cUnoPrefix + "deployment.ExtensionManager" - -'UserFieldNames -Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = "Calc", cUserFieldTestImpress = "Impress" -Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart" -Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database" -Global const cUserFieldTestExtension = "Extension" -Global const cUserFieldTestOpenSaveXML = "SaveOpenXML" -Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8" - -Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard" - -Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2 - -global gErrorState (cMaxErrorStates, 5) as integer -Global gTestCaseAnnotations( cMaxErrorStates, 5 ) As String - -global gOutputDoc as Object -global gOutputDocNotUno as Object -global gOptionsDialog as Object - -Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest as boolean -Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean -Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean -Global bMakeExtensionTest as boolean -Global bMakeSaveOpenXMLTest as boolean -Global bMakeTerminateAfterTest as boolean, bShowTable as boolean -Global bMakeSaveOpen8Test as boolean - -global sExtensionURL as string - -Dim gDlgState as Integer - -Sub SetGlobalDoc - gOutputDoc = ThisComponent -end Sub - -Sub ClearStatus - for j% = 0 to cMaxErrorStates - for i% = 0 to 5 - gErrorState (j%, i%) = cLogUnknown - gTestCaseAnnotations( J%, i% ) = "" - next i% - next j% -end Sub - -Sub ClearAllText - call SetGlobalDoc - call ClearDoc (gOutputDoc) - call ClearStatus -end Sub - -Sub AssertionHandler( sMessage as String ) - LogTestResult( "assertion caught: " + sMessage, FALSE ) -End Sub - -Sub Main - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherSetupDoc - - On Local Error Goto MainError - CaptureAssertions( "AssertionHandler" ) - - call SetGlobalDoc - - Dim bWasModified as Boolean - bWasModified = gOutputDoc.isModified() - - if bShowTable then - call ClearDoc (gOutputDoc) - end If - - call ClearStatus - - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) - - Call Test_10er.Main - - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherWriteStatus - if bShowTable then - call CreateStatusTable2 - call CreateStatusTable - call CreateDocState - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) - ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result - call CreateSecondState - gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage - end if - - gOutputDoc.setModified( bWasModified ) - - CaptureAssertions( "" ) - Exit Sub - -MainError: - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) -End Sub - -Function GetTestGlueDescription( nTestCase as Integer ) - Select Case ( nTestCase ) - case cOtherSetupDoc - GetTestGlueDescription = "setup test document" - case cOtherWriteStatus - GetTestGlueDescription = "write test status" - case Else - GetTestGlueDescription = "" - End Select -End Function - -Sub CreateStatusTable - dim tableHeaders(7) as string - tableHeaders(cStWriter) = "Writer" - tableHeaders(cStCalc) = "Calc" - tableHeaders(cStPraesentation) = "Präsen- tation" - tableHeaders(cStZeichnen) = "Zeichn." - tableHeaders(cStChart) = "Diagr." - tableHeaders(cStMath) = "Math" - tableHeaders(cStHTML) = "HTML" - tableHeaders(cStJava) = "Java" - - dim tableRows(3) as string - tableRows(cDocNew) = "new" - tableRows(cDocSaveOpen8) = "V8.0" - tableRows(cDocSaveOpenXML) = "XML" - tableRows(cDocClose) = "close" - - aDoc = gOutputDoc - - xText = aDoc.Text - xCursor = xText.createTextCursor() - - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) - SetParagraphBreak (xCursor) - xCursor.GoRight (1, False) - - table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(6,9) - table.Name = "StTab1" - table.BackColor = cCoGrey - xText.insertTextContent(xCursor, table, FALSE) - - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - - for i% = 0 to 7 - tableCell = table.getCellByPosition( i% + 1, 0 ) - tableCell.String = tableHeaders( i% ) - next i% -end Sub - -Sub CreateStatusTable2 - dim tableHeaders(4) as string - tableHeaders(0) = "Database" - tableHeaders(1) = "" - tableHeaders(2) = "Extension" - tableHeaders(3) = "" - tableHeaders(4) = "Other" - - dim tableRows(5) as string - tableRows(cDBService ) = "services" - tableRows(cDBOpen ) = "open" - tableRows(cDBInsert ) = "insert" - tableRows(cDBDelete ) = "delete" - tableRows(cDBSeek ) = "seek" - tableRows(cDBClose ) = "close" - - dim tableRows2(2) as string - tableRows2(cEXTService ) = "services" - tableRows2(cEXTInstall ) = "install" - tableRows2(cEXTUninstall ) = "uninstall" - - dim tableRows3(1) as string - tableRows3(cOtherSetupDoc ) = "setup test" - tableRows3(cOtherWriteStatus ) = "write test result" - - aDoc = gOutputDoc - - xText = aDoc.Text - xCursor = xText.createTextCursor() - - xCursor.gotoStart(FALSE) - xCursor.GoRight (4, False) - SetParagraphBreak (xCursor) - SetParagraphBreak (xCursor) - xCursor.gotoEnd(FALSE) - - table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(7,6) - table.Name = "StTab2" - table.BackColor = cCoGrey - - xText.insertTextContent(xCursor, table, FALSE) - - for i% = LBound( tableHeaders ) to UBound( tableHeaders ) - tableCell = table.getCellByPosition( i% + 1, 0 ) - tableCell.String = tableHeaders(i%) - next i% - - for i% = LBound( tableRows ) to UBound( tableRows ) - tableCell = table.getCellByPosition( 0, i% + 1 ) - tableCell.String=tableRows(i%) - next i% - - for i% = LBound( tableRows2 ) to UBound( tableRows2 ) - tableCell = table.getCellByPosition( 2, i% + 1 ) - tableCell.String=tableRows2(i%) - next i% - - for i% = LBound( tableRows3 ) to UBound( tableRows3 ) - tableCell = table.getCellByPosition( 4, i% + 1 ) - tableCell.String=tableRows3(i%) - next i% -end Sub - - -Sub CreateDocState - aDoc = gOutputDoc - table = aDoc.TextTables.GetByIndex (1) - - for j% = 0 to 7 - for i% = 0 to 4 - sRangeName = GetRangeName(j%, i%+1) - - tableCursor = table.createCursorByCellName(sRangeName) - - cName = tableCursor.getRangeName() - xCell = table.getCellByName(cName) - - xCell.BackTransparent = False - - If gErrorState (j%, i%) = cLogTrue Then - xCell.BackColor = cCoGreen - else - If gErrorState (j%, i%) = cLogFalse Then - xCell.BackColor = cCoRed - If ( gTestCaseAnnotations( j%, i% ) <> "" ) Then - Dim annotation as Object - annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) - annotation.Author = "smoketest" - annotation.Content = gTestCaseAnnotations( j%, i% ) - xCell.insertTextContent( xCell, annotation, false ) - End If - else - xCell.BackColor = cCoGrey - end If - end If - next i% - next j% -end Sub - -Sub CreateSecondState - aDoc = gOutputDoc - table = aDoc.TextTables.GetByIndex (0) - - Dim stateIndex(2) as Integer - stateIndex(0) = cStDataBase - stateIndex(1) = cStExtension - stateIndex(2) = cStTestGlue - - Dim j as Integer - For j = LBound( stateIndex ) To UBound( stateIndex ) - for i% = 1 to 6 - tableCell = table.getCellByPosition( 2 * j + 1, i% ) - tableCell.BackTransparent = False - - if gErrorState( stateIndex(j), i% - 1 ) = cLogTrue then - tableCell.BackColor = cCoGreen - else - if gErrorState ( stateIndex(j), i% - 1 ) = cLogFalse then - tableCell.BackColor = cCoRed - If ( gTestCaseAnnotations( stateIndex(j), i% - 1 ) <> "" ) Then - Dim annotation as Object - annotation = aDoc.createInstance( "com.sun.star.text.TextField.Annotation" ) - annotation.Author = "smoketest" - annotation.Content = gTestCaseAnnotations( stateIndex(j), i% - 1 ) - tableCell.insertTextContent( tableCell, annotation, false ) - End If - else - tableCell.BackColor = cCoGrey - end If - end If - next i% - next j% -end Sub - -Function GetRangeName (nColumn as integer, nRow as integer) as string - GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1)) -end Function - -Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) - If ( gCurrentTestCase = cLogfileFailed ) Then - Dim sAnnotation as String - sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" - LogState( FALSE, sAnnotation, MainFileChannel ) - SetStatus( 0, FALSE, sAnnotation ) - Else - If ( LocalFileChannel <> 0 ) Then - LogState( bSuccess, sTestCaseDescription, LocalFileChannel ) - EndIf - if ( MainFileChannel <> 0 ) Then - LogState( bSuccess, sTestCaseDescription, MainFileChannel ) - EndIf - SetStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) - End If -End Sub - -Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) - Dim nStatusType as Integer - Dim nState as integer - nStatusType = GetStatusType( gCurrentDocTest ) - If nStatusType = cStNone then Exit Sub - - if bState then - nState = cLogTrue - else - nState = cLogFalse - end If - - If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then - ' don't overwrite a previous "failed" state for this this - nState = cLogFalse - End If - - gErrorState (nStatusType, nAction) = nState - - If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then - gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) - End If -end Sub - -Function GetStatusType (nDocType as Integer) as Integer - Select Case ( nDocType ) - case frmWriter - GetStatusType = cStWriter ' text document - case frmCalc - GetStatusType = cStCalc ' spreadsheet document - case frmImpress - GetStatusType = cStPraesentation ' presentation - case frmDraw - GetStatusType = cStZeichnen ' drawing - case frmMath - GetStatusType = cStMath ' formula - case frmHyperText - GetStatusType = cStHTML ' HTML document - case frmChart - GetStatusType = cStChart ' chart - case frmJava - GetStatusType = cStJava 'Java - case frmTestGlue - GetStatusType = cStTestGlue ' test framework - case frmDataBase - GetStatusType = cStDataBase 'DataBase - case frmExtension - GetStatusType = cStExtension 'Extension - case else - GetStatusType = cStNone - end Select -end Function - -Sub SetParagraphBreak (aCursor as Object) - aCursor.Text.InsertControlCharacter (aCursor, cParagraphBreak, True) -end Sub - -Sub ClearDoc (aDoc as Object) - Dim aText as Object - Dim i% - for i%=1 to aDoc.TextTables.count - aDoc.TextTables.GetByIndex(0).dispose - next - - aText = aDoc.Text.CreateTextCursor - aText.GotoStart (False) - aText.GoRight (3, False) - SetParagraphBreak (aText) - aText.GotoEnd (True) - aText.String="" -end Sub - -Sub ClearDocFull (aDoc as Object) - Dim aText as Object - Dim i% - for i%=1 to aDoc.TextTables.count - aDoc.TextTables.GetByIndex(0).dispose - next - - aText = aDoc.Text.CreateTextCursor - aText.GotoStart (False) - aText.GotoEnd (True) - aText.String="" -end Sub - -Sub SetGlobalOptionsDialog () - - Dim oLibContainer As Object, oLib As Object - Dim oInputStreamProvider As Object - Dim oDialog As Object - - Const sLibName = cTest10Modul - Const sDialogName = cOptionsDialogName - - REM get library and input stream provider - oLibContainer = DialogLibraries - - REM load the library - oLibContainer.loadLibrary( sLibName ) - - oLib = oLibContainer.getByName( sLibName ) - oInputStreamProvider = oLib.getByName( sDialogName ) - - REM create dialog control - gOptionsDialog = CreateUnoDialog( oInputStreamProvider ) - -end Sub - -Sub ShowOptionsDlg - - call SetGlobalDoc - call SetGlobalOptionsDialog - call GetOptions - - REM show the dialog - gOptionsDialog.execute() - - ' jetzt läuft der Dialog, bis ein Button gedrückt wird - - Select Case (gDlgState) - case cDlgOk - call SetOptions () - case cDlgStartTest - call SetOptions () - call StartTestByOptions () - end Select - - gOptionsDialog.dispose() - -end Sub - -Sub SetOptions - call SetGlobalDoc - SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl("cbWriterTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl("cbCalcTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl("cbImpressTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl("cbDrawTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl("cbHTMLTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl("cbMathTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl("cbChartTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc) - SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc) -end Sub - -Sub GetOptions - call SetGlobalDoc - gOptionsDialog.getControl("cbWriterTest").setState( -( GetUserFieldState (cUserFieldTestWriter, gOutputDoc))) - gOptionsDialog.getControl("cbCalcTest").setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutputDoc))) - gOptionsDialog.getControl("cbImpressTest").setState( -( GetUserFieldState (cUserFieldTestImpress, gOutputDoc))) - gOptionsDialog.getControl("cbDrawTest").setState( -( GetUserFieldState (cUserFieldTestDraw, gOutputDoc))) - gOptionsDialog.getControl("cbHTMLTest").setState( -( GetUserFieldState (cUserFieldTestHTML, gOutputDoc))) - gOptionsDialog.getControl("cbMathTest").setState( -( GetUserFieldState (cUserFieldTestMath, gOutputDoc))) - gOptionsDialog.getControl("cbChartTest").setState( -( GetUserFieldState (cUserFieldTestChart, gOutputDoc))) - gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutputDoc))) - gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc))) - gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc))) - gOptionsDialog.getControl("cbSaveOpenXMLTest").setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc))) - gOptionsDialog.getControl("cbSaveOpen8Test").setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc))) - gOptionsDialog.getControl("cbTerminateAfterTest").setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc))) -End Sub - -Sub ReadOptions - call SetGlobalDoc - bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutputDoc) - bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutputDoc) - bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutputDoc) - bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutputDoc) - bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutputDoc) - bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutputDoc) - bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutputDoc) - bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutputDoc) - bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutputDoc) - bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutputDoc) - bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutputDoc) - bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutputDoc) - bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutputDoc) -end Sub - -Sub SetDefaultOptions - bMakeWriterTest = true - bMakeCalcTest = true - bMakeImpressTest = true - bMakeDrawTest = true - bMakeHTMLTest = true - bMakeMathTest = true - bMakeChartTest = true - if Environ("SOLAR_JAVA") = "" then - bMakeJavaTest = false - bMakeDBTest = false - bMakeExtensionTest = false - else - bMakeJavaTest = true - bMakeDBTest = true - bMakeExtensionTest = true - End If - bMakeSaveOpenXMLTest = true - REM Disable StarOffice 5.0 tests in case binfilter has not been included - bMakeSaveOpen8Test = true - bMakeTerminateAfterTest = false -end Sub - -Sub StartTestByOptions - bShowTable = true - call ReadOptions - call Main - if bMakeTerminateAfterTest then - ClearDocFull (gOutputDoc) - gOutputDoc.dispose - 'StarDesktop.Terminate - - 'EnableReschedule( false ) - 'DispatchSlot( 5300 ) - stop - End If -end Sub - -Function StartTestWithDefaultOptions - bShowTable = false - call SetDefaultOptions - call Main - dim component(cMaxErrorStates) as string - component(cStWriter) = "Writer" - component(cStCalc) = "Calc" - component(cStPraesentation) = "Impress" - component(cStZeichnen) = "Draw" - component(cStChart) = "Chart" - component(cStMath) = "Math" - component(cStHTML) = "HTML" - component(cStJava) = "Java" - component(cStDataBase) = "Base" - component(cStExtension) = "Extensions" - dim action(2) as string - action(cDocNew) = "new" - action(cDocSaveOpen8) = "V8.0" - action(cDocSaveOpenXML) = "XML" - dim baseAction(5) as string - baseAction(cDBService) = "services" - baseAction(cDBOpen) = "open" - baseAction(cDBInsert) = "insert" - baseAction(cDBDelete) = "delete" - baseAction(cDBSeek) = "seek" - baseAction(cDBClose) = "close" - dim extAction(2) as string - extAction(cEXTService) = "services" - extAction(cEXTInstall) = "install" - extAction(cEXTUninstall) = "uninstall" - dim result as string - for i = 0 to cMaxErrorStates - for j = 0 to 5 - if gErrorState(i, j) = cLogFalse then - result = result & " " & component(i) & ":" - if i = cStDataBase then - result = result & baseAction(j) - else if i = cStExtension then - result = result & extAction(j) - else - result = result & action(j) - end if - end if - end if - next j - next i - StartTestWithDefaultOptions = result -end Function - -Sub DispatchSlot(SlotID as Integer) - Dim oArg() as new com.sun.star.beans.PropertyValue - Dim oUrl as new com.sun.star.util.URL - Dim oTrans as Object - Dim oDisp as Object - - oTrans = createUNOService("com.sun.star.util.URLTransformer") - oUrl.Complete = "slot:" & CStr(SlotID) - oTrans.parsestrict(oUrl) - - oDisp = StarDesktop.queryDispatch(oUrl, "_self", 0) - oDisp.dispatch(oUrl, oArg()) -End Sub - -Sub LoadLibrary( LibName As String ) - - dim args(1) - dim arg as new com.sun.star.beans.PropertyValue - arg.Name = "LibraryName" - arg.Value = LibName - args(0) = arg - - dim url as new com.sun.star.util.URL - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:6517" - trans.parsestrict( url ) - - dim disp as object - disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub ExecuteSlot( SlotNr As String, oDoc as Object ) - dim args() - dim url as new com.sun.star.util.URL - dim trans as object - dim disp as object - - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:" + SlotNr - trans.parsestrict( url ) - - disp = oDoc.CurrentController.Frame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub DelAllUserFields (aDoc as Object) - Dim aFieldType as Object - Dim aElements as Variant - Dim i% - Dim aFieldMasters, aFieldMaster as Object - Dim sElement$ - aFieldMasters = aDoc.TextFieldMasters - aElements = aFieldMasters.ElementNames - for i = 0 to UBound(aElements) - sElement$ = aElements(i) - if 0 <> instr(sElement$, cUnoUserField ) then - aFieldMaster = aFieldMasters.GetByName(sElement$) - aFieldMaster.Dispose - endif - next -end Sub - -Function GetUserFieldState (sName as String, aDoc as Object) as boolean - Dim sFieldText as String - Dim bState as boolean - sFieldText = ReadUserField (sName, aDoc) - - if LCase(sFieldText) = cYes then - bState = true - else - bState = false - end IF - - GetUserFieldState = bState -end Function - -Sub SetUserFieldState (sName as String, nState as boolean, aDoc as Object) - Dim sFieldText as String - - sFieldText = cNo 'default - - Select case nState - case true - sFieldText = cYes - case false - sFieldText = cNo - end Select - - WriteUserField (sFieldText, sName, aDoc) -end Sub - -Function ReadUserField(sFieldName as String, aDoc as Object) as String - Dim aMasters as Object - aMasters = aDoc.TextFieldMasters - if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then - ReadUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName).Content - else - ReadUserField = "" - end If -End Function - -Sub WriteUserField(sValue as String, sFieldName as String, aDoc as Object, optional aCursor as Object) - Dim aMasters, aUserField, aTxtCursor as Object - aMasters = aDoc.TextFieldMasters - if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then - aUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName) - else - aUserField = aDoc.CreateInstance (cUnoUserField) - aUserField.Name = sFieldName - end if - aUserField.Content = sValue -End Sub - -Sub WriteExtUserField(nIndex as Integer, aCursor as Object, aDoc as Object) - Dim aUserField as Object - aUserField = aDoc.CreateInstance (cUnoExtUserField) - aUserField.UserDataType = nIndex - aCursor.Text.InsertTextContent (aCursor, aUserField, True) - aUserField.Fix = True -End Sub - diff --git a/smoketestoo_native/data/OptionsDlg.xml b/smoketestoo_native/data/OptionsDlg.xml deleted file mode 100644 index c03026185886..000000000000 --- a/smoketestoo_native/data/OptionsDlg.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml deleted file mode 100644 index a6f46b01eb78..000000000000 --- a/smoketestoo_native/data/Test_10er.xml +++ /dev/null @@ -1,690 +0,0 @@ - - - -REM 10er Test - -const sSWLogFileName = "swlog.dat", sSCLogFileName = "sclog.dat" -const sSDLogFileName = "sdlog.dat", sSMathLogFileName = "smalog.dat" -const sSChartLogFileName = "schlog.dat" -const sSHptLogFileName = "shptlog.dat" -const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" -const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" -const sTestGlueLogFileName = "testgluelog.dat" -const sLogFileName = "log.dat" -const cTempFileName = "ttt" - -const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" -const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" -const cMessageNewDoc = "New Document" -const cMessageCloseDoc = "Close Document" - -Global sWorkPath$ -Global sWorkPathURL$ -Global LocalFileChannel% -Global MainFileChannel% - -Sub Main - call TestAllDocs() -end Sub - -Sub DeleteAllSavedFiles() - Dim sFileName as String - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmHyperText) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmWriter or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmCalc or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmImpress or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If - sFileName = sWorkPath+cTempFileName+"."+GetDocEndings(frmDraw or cFltXML) - If FileExists (sFileName) then - Kill (sFileName) - End If -End Sub - -Sub DeleteAllLogFiles() - If FileExists (sWorkPath+sLogFileName) then - Kill (sWorkPath+sLogFileName) - End If - If FileExists (sWorkPath+sSWLogFileName) then - Kill (sWorkPath+sSWLogFileName) - End If - If FileExists (sWorkPath+sSCLogFileName) then - Kill (sWorkPath+sSCLogFileName) - End If - If FileExists (sWorkPath+sSDLogFileName) then - Kill (sWorkPath+sSDLogFileName) - End If - If FileExists (sWorkPath+sSMathLogFileName) then - Kill (sWorkPath+sSMathLogFileName) - End If - If FileExists (sWorkPath+sSChartLogFileName) then - Kill (sWorkPath+sSChartLogFileName) - End If - If FileExists (sWorkPath+sSHptLogFileName) then - Kill (sWorkPath+sSHptLogFileName) - End If - If FileExists (sWorkPath+sSDrawLogFileName) then - Kill (sWorkPath+sSDrawLogFileName) - End If - If FileExists (sWorkPath+sJavaLogFileName) then - Kill (sWorkPath+sJavaLogFileName) - End If - If FileExists (sWorkPath+sTestGlueLogFileName) then - Kill (sWorkPath+sTestGlueLogFileName) - End If - If FileExists (sWorkPath+sSDBLogFileName) then - Kill (sWorkPath+sSDBLogFileName) - End If - If FileExists (sWorkPath+sExtLogFileName) then - Kill (sWorkPath+sExtLogFileName) - End If -end Sub - -Function OpenLogDat (sFileName as String) as Integer - Dim LocaleFileChannel% - If FileExists (sWorkPath+sFileName) then - Kill (sWorkPath+sFileName) - End If - LocaleFileChannel% = Freefile - Open sWorkPath+sFileName For Output As LocaleFileChannel% - OpenLogDat = LocaleFileChannel% -end Function - -Function GetWorkPath as string - sTemp = "$(userpath)/temp/" - GetWorkPath = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function - -Function GetWorkURL as string - sTemp = "$(userurl)/temp/" - GetWorkURL = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function - -Function GetSystem (sTmpWorkPath as string) as string - GetSystem = "" - if InStr (sTmpWorkPath, ":") then - GetSystem = "windows" - else - GetSystem = "unix" - End If -end Function - -Function ConvertPathToWin (sTmpWorkPath as string) as string - for i%=1 to Len(sTmpWorkPath) - sTemp = Mid (sTmpWorkPath, i%, 1) - if sTemp = "/" then - sTmpWorkPath = Left (sTmpWorkPath, i%-1) + "\" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) - else - if sTemp = "|" then - sTmpWorkPath = Left (sTmpWorkPath, i%-1) + ":" + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%) - end If - end If - next i% - ConvertPathToWin = sTmpWorkPath -end Function - -Sub TestAllDocs() -DIM sDocURL as String, sDocPath as String -DIM nStrPos as Long - - sWorkPath = GetWorkPath - sWorkPathURL = GetWorkURL - - if GetSystem (sWorkPath) = "windows" then - sWorkPath = ConvertPathToWin (sWorkPath) - end if - - 'search ExtensionURL - sDocURL = gOutputDoc.URL - CompatibilityMode(true) - nStrPos = InStrRev (sDocURL, "/" ) - CompatibilityMode(false) - sExtensionURL = Left (sDocURL, nStrPos) - - call DeleteAllSavedFiles() - call DeleteAllLogFiles() - MainFileChannel = OpenLogDat (sLogFileName) - call WriteTestSequence - if bMakeWriterTest then - gCurrentDocTest = frmWriter - call MakeDocTest - end if - if bMakeCalcTest then - gCurrentDocTest = frmCalc - call MakeDocTest - end if - if bMakeImpressTest then - gCurrentDocTest = frmImpress - call MakeDocTest - end if - if bMakeDrawTest then - gCurrentDocTest = frmDraw - call MakeDocTest - end if - if bMakeHTMLTest then - gCurrentDocTest = frmHyperText - call MakeDocTest - end if - if bMakeChartTest then - gCurrentDocTest = frmChart - call MakeChartTest - end if - if bMakeMathTest then - gCurrentDocTest = frmMath - call MakeNewDoc - end if - if bMakeJavaTest then - gCurrentDocTest = frmJava - call TestJava - end if - if bMakeDBTest then - gCurrentDocTest = frmDataBase - call Test_DB.TestDB - end if - if bMakeExtensionTest then - gCurrentDocTest = frmExtension - call Test_Ext.TestExtensions - end if - - Close #MainFileChannel - MainFileChannel = 0 -end Sub - -Sub WriteTestSequence - Print #MainFileChannel, "Sequence of testing" - - if bMakeWriterTest then - WriteTests ("writer : ", true, MainFileChannel) - end if - if bMakeCalcTest then - WriteTests ("calc : ", true, MainFileChannel) - end if - if bMakeImpressTest then - WriteTests ("impress : ", true, MainFileChannel) - end if - if bMakeDrawTest then - WriteTests ("draw : ", true, MainFileChannel) - end if - if bMakeHTMLTest then - WriteTests ("HTML : ", true, MainFileChannel) - end if - if bMakeChartTest then - WriteTests ("chart : ", false, MainFileChannel) - end if - if bMakeMathTest then - WriteTests ("math : ", false, MainFileChannel) - end if - if bMakeJavaTest then - WriteTests ("Java : ", false, MainFileChannel) - end if - if bMakeDBTest then - WriteDBTests ("Database : ", MainFileChannel) - end if - if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", MainFileChannel) - end if - - Print #MainFileChannel -end Sub - -Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "new" - if bTestAll then - if bMakeSaveOpen8Test then - sWriteStr = sWriteStr + ", save 8.0" - end if - if bMakeSaveOpenXMLTest then - sWriteStr = sWriteStr + ", save XML" - end if - if bMakeSaveOpen8Test then - sWriteStr = sWriteStr + ", open 8.0" - end if - if bMakeSaveOpenXMLTest then - sWriteStr = sWriteStr + ", open XML" - end if - end if - - sWriteStr = sWriteStr + ", close" - - Print #nFileChannel, sWriteStr -end Sub - -Sub WriteDBTests (sText as string, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "open / services" - sWriteStr = sWriteStr + ", insert" - sWriteStr = sWriteStr + ", delete" - sWriteStr = sWriteStr + ", seek" - sWriteStr = sWriteStr + ", close" - - Print #nFileChannel, sWriteStr -end Sub - -Sub WriteExtensionTests (sText as string, nFileChannel as integer) - Dim sWriteStr as string - - sWriteStr = sText - sWriteStr = sWriteStr + "services" - sWriteStr = sWriteStr + ", install" - sWriteStr = sWriteStr + ", uninstall" - - Print #nFileChannel, sWriteStr -end Sub - -Sub MakeDocTest - Dim oDoc as Object - Dim sFileNameXML$, sFileName8$ - Dim bSuccess as Boolean - - On Local Error GoTo DOCTESTERROR - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - gCurrentTestCase = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) - if not IsNull (oDoc) then - gCurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then - sFileName8 = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFlt8) - SaveDoc (sFileName8, oDoc, GetDocFilter(gCurrentDocTest or cFlt8)) - end if - gCurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then - sFileNameXML = sWorkPathURL+cTempFileName+"."+GetDocEndings(gCurrentDocTest or cFltXML) - SaveDoc (sFileNameXML, oDoc, GetDocFilter(gCurrentDocTest or cFltXML)) - end if - gCurrentTestCase = cDocClose - bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - gCurrentTestCase = cDocSaveOpen8 - if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then - oDoc = LoadDoc (sFileName8) - -' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpen8Doc, not IsNull (oDoc) ) - - if not IsNull (oDoc) then - gCurrentTestCase = cDocClose - oDoc.close (true) - end If - end if - - gCurrentTestCase = cDocSaveOpenXML - if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then - oDoc = LoadDoc (sFileNameXML) - -' oDoc = Documents.open(sFileName) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) ) - - if not IsNull (oDoc) then - gCurrentTestCase = cDocClose - oDoc.close (true) - end If - end if - - end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DOCTESTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub MakeNewDoc - DIM oDoc as Object - Dim bSuccess as Boolean - On Local Error GoTo DOCTESTERROR2 - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - gCurrentTestCase = cDocNew -' oDoc = Documents.Add(GetDocFilter(gCurrentDocTest)) - oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) - if not IsNull (oDoc) then - gCurrentTestCase = cDocClose - bSuccess = CloseDoc( oDoc ) - LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) - end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DOCTESTERROR2: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub MakeChartTest - Dim oCharts as Object - Dim oDoc as Object - Dim oRange(0) as New com.sun.star.table.CellRangeAddress - Dim oRect as New com.sun.star.awt.Rectangle - const cChartName="TestChart" - Dim bSuccess as Boolean - On Local Error GoTo CHARTTESTERROR - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - gCurrentTestCase = cDocNew - oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) - if not IsNull (oDoc) then - oCharts = oDoc.sheets(0).Charts - oCharts.AddNewByName (cChartName, oRect, oRange(), true, true) - bSuccess=oCharts.HasByName(cChartName) - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, bSuccess ) - gCurrentTestCase = cDocClose - oDoc.close (true) - else - LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) - End if - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - CHARTTESTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - -Sub LogState (bState as Boolean, sText as String, nLocaleFileChannel as integer) - if bState then - Print #nLocaleFileChannel, sText+" -> ok" - else - Print #nLocaleFileChannel, sText+" -> error" - end If -end Sub - -Function GetDocEndings (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter or cFlt8 - GetDocEndings = "odt" ' Textdokument - case frmCalc or cFlt8 - GetDocEndings = "ods" 'Tabellendokument - case frmImpress or cFlt8 - GetDocEndings = "odp" 'PrÕsentation - case frmDraw or cFlt8 - GetDocEndings = "odg" 'Zeichen - case frmHyperText, frmHyperText or cFltXML - GetDocEndings = "html" 'Hypertext-Dokument - case frmWriter or cFltXML - GetDocEndings = "sxw" ' Textdokument - case frmCalc or cFltXML - GetDocEndings = "sxc" 'Tabellendokument - case frmImpress or cFltXML - GetDocEndings = "sxi" 'PrÕsentation - case frmDraw or cFltXML - GetDocEndings = "sxd" 'Zeichen - case else - GetDocEndings = "" - end Select -end Function - -Function GetDocFilter (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter or cFlt8 - GetDocFilter = "writer8" ' text document - case frmCalc or cFlt8 - GetDocFilter = "calc8" ' spreadsheet document - case frmImpress or cFlt8 - GetDocFilter = "impress8" ' presentation - case frmDraw or cFlt8 - GetDocFilter = "draw8" ' drawing - case frmMath or cFlt8 - GetDocFilter = "math8" ' formula - - case frmWriter or cFltXML - GetDocFilter = "StarOffice XML (Writer)" ' text document - case frmCalc or cFltXML - GetDocFilter = "StarOffice XML (Calc)" ' spreadsheet document - case frmImpress or cFltXML - GetDocFilter = "StarOffice XML (Impress)" ' presentation - case frmDraw or cFltXML - GetDocFilter = "StarOffice XML (Draw)" ' drawing - case frmMath or cFltXML - GetDocFilter = "StarOffice XML (Math)" ' formula - - case frmHyperText, frmHyperText or cFltXML - GetDocFilter = "HTML" ' HTML document - - case frmWriter or cFltNewDoc - GetDocFilter = "swriter" ' text document - case frmCalc or cFltNewDoc - GetDocFilter = "scalc" ' spreadsheet document - case frmImpress or cFltNewDoc - GetDocFilter = "simpress" ' presentation - case frmDraw or cFltNewDoc - GetDocFilter = "sdraw" ' drawing - case frmMath or cFltNewDoc - GetDocFilter = "smath" ' formula - case frmHyperText or cFltNewDoc - GetDocFilter = "swriter/web" ' HTML document - case frmChart or cFltNewDoc - GetDocFilter = "schart" ' chart - case else - GetDocFilter = "" - end Select -end Function - -Function GetLogFileName (DocType as Integer) as String - Select Case ( DocType ) - case frmWriter - GetLogFileName = sSWLogFileName ' text document - case frmCalc - GetLogFileName = sSCLogFileName ' spreadsheet document - case frmImpress - GetLogFileName = sSDLogFileName ' presentation - case frmDraw - GetLogFileName = sSDrawLogFileName ' drawing - case frmMath - GetLogFileName = sSMathLogFileName ' formula - case frmHyperText - GetLogFileName = sSHptLogFileName ' HTML document - case frmChart - GetLogFileName = sSChartLogFileName ' chart - case frmJava - GetLogFileName = sJavaLogFileName 'Java - case frmOther - GetLogFileName = sTestGlueLogFileName ' test framework - case frmDataBase - GetLogFileName = sSDBLogFileName 'Database - case frmExtension - GetLogFileName = sExtLogFileName 'Extension - case else - GetLogFileName = "" - end Select -end Function - -Function GetErrorMessageOnAction (nAction as Integer) as String - Select Case ( nAction ) - case cDocNew - GetErrorMessageOnAction = cMessageNewDoc - case cDocSaveOpen8 - GetErrorMessageOnAction = cMessageSaveOpen8Doc - case cDocSaveOpenXML - GetErrorMessageOnAction = cMessageSaveOpenXMLDoc - case cDocClose - GetErrorMessageOnAction = cMessageCloseDoc - case else - GetErrorMessageOnAction = "" - end Select -end Function - -Function IsFilterAvailable (FilterType as Integer) as boolean - IsFilterAvailable = true - if ((FilterType = (frmHyperText or cFltXML))) then - IsFilterAvailable = false - end if -End Function - -Function TestJava - Dim oObj as Object - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - gCurrentTestCase = cDocNew - oObj = createUnoService( cUnoJavaLoader ) - LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - - TestJava = not IsNull (oObj) -End Function - -Sub LoadLibrary( LibName as String ) - - dim args(1) - dim arg as new com.sun.star.beans.PropertyValue - arg.Name = "LibraryName" - arg.Value = LibName - args(0) = arg - - dim url as new com.sun.star.util.URL - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url.Complete = "slot:6517" - trans.parsestrict( url ) - - dim disp as object - disp = StarDesktop.currentFrame.queryDispatch( url, "", 0 ) - disp.dispatch( url, args() ) - -End Sub - -Sub LoadDoc (DocName as String) as Object - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url = createUnoStruct("com.sun.star.util.URL" ) - url.Complete = DocName - if Left(DocName, 5 ) <> "file:" then - trans.parsestrict( url ) - endif - - Dim aPropArray(0) as Object - aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") - aPropArray(0).Name = "OpenFlags" - aPropArray(0).Value = "S" - - dim doc as object - dim noargs() - doc = StarDesktop.loadComponentFromURL( url.Complete, "_blank", 0, aPropArray() ) ' XModel - LoadDoc = doc -End Sub - -Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string ) - dim trans as object - trans = createUnoService("com.sun.star.util.URLTransformer" ) - url = createUnoStruct("com.sun.star.util.URL" ) - url.Complete = DocName - if Left(DocName, 5 ) <> "file:" then - trans.parsestrict( url ) - endif - - if not (sFilterName = "") then - Dim aPropArray(0) as Object - aPropArray(0) = CreateUnoStruct("com.sun.star.beans.PropertyValue") - aPropArray(0).Name = "FilterName" - aPropArray(0).Value = sFilterName - - oDoc.storeAsURL( url.Complete, aPropArray() ) - else - MessageBox "Filtername is unknown!" - end if -end Sub - -Function CloseDoc( oDoc as Object ) - Dim oListener as Object - oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" ) - oDoc.addCloseListener( oListener ) - - Events.ResetCloseListenerFlag() - oDoc.close( true ) - closeDoc = Events.HasCloseListenerBeenCalled() - - if ( Not Events.HasCloseListenerBeenCalled() ) Then - ' do this only if closing was not successful - otherwise, we'd get a DisposedException - oDoc.removeCloseListener( oListener ) - End If -End Function - diff --git a/smoketestoo_native/data/Test_DB.xml b/smoketestoo_native/data/Test_DB.xml deleted file mode 100644 index a9f1fc2e316d..000000000000 --- a/smoketestoo_native/data/Test_DB.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - -REM ***** Database Test ***** - -const cMessageDatabaseService = "Database Service" -const cMessageDatabaseOpen = "Open Database" -const cMessageDatabaseInsert = "Insert record into Database" -const cMessageDatabaseDelete = "Delete record from Database" -const cMessageDatabaseSeek = "Read other record from Database" -const cMessageDatabaseClose = "Close Database" - -Sub TestDB - - Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object - Dim sDBName as String, sTable as String, sCurrentMessage as String - Dim nRowCount as Integer - Dim bResult as Boolean - Const sTestString = "Automatical Test" - - On Local Error GoTo DBERROR - - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - - gCurrentTestCase = cDBService - sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext - - oDBContext = CreateUnoService(cUnoDatabaseContext) - sDBName=oDBContext.ElementNames(0) 'Names of Databases - - gCurrentTestCase = cDBOpen - sCurrentMessage = cMessageDatabaseOpen - - oDataSource = oDBContext.GetByName(sDBName) - sTable=oDataSource.Tables.ElementNames(0) - oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","") - - LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) - if (IsNull(oDBConnection)) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - ' Database is open now - - gCurrentTestCase = cDBService - sCurrentMessage = cMessageDatabaseService + " " + cUnoRowSet - oRowSet = createUnoService(cUnoRowSet) - - if (IsNull(oRowSet)) then - LogTestResult( "Database "+ cMessageDatabaseService + " " + cUnoRowSet, not IsNull (oRowSet) ) - Exit Sub - else - LogTestResult( "Database "+ cMessageDatabaseService, TRUE ) - End If - - gCurrentTestCase = cDBInsert - sCurrentMessage = cMessageDatabaseInsert - - oRowSet.ActiveConnection = oDBConnection - - oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND - oRowSet.Command = "SELECT * FROM " + sTable - oRowSet.execute() - - oRowSet.moveToInsertRow - oRowSet.updateString(5, sTestString) - - oRowSet.insertRow() - nRowCount=oRowSet.RowCount - - oRowSet.moveToCurrentRow() - - bResult = (oRowSet.getString(5) = sTestString) - LogTestResult( "Database "+ cMessageDatabaseInsert, bResult ) - - 'delete only if insert passed - - if (bResult) Then - gCurrentTestCase = cDBDelete - sCurrentMessage = cMessageDatabaseDelete - oRowSet.deleteRow() - bResult = (nRowCount - oRowSet.RowCount = 0) - if ( bResult ) Then - oRowSet.next() - bResult = (nRowCount - oRowSet.RowCount = 1) - End If - LogTestResult( "Database "+ cMessageDatabaseDelete, bResult ) - End If - - ' read other record - - gCurrentTestCase = cDBSeek - sCurrentMessage = cMessageDatabaseSeek - oRowSet.first() - bResult = not (oRowSet.getString(5) = sTestString) - LogTestResult( "Database "+ cMessageDatabaseSeek, bResult ) - - gCurrentTestCase = cDBClose - sCurrentMessage = cMessageDatabaseClose - oDBConnection.Dispose() - LogTestResult( "Database "+ cMessageDatabaseClose, True ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - DBERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( "Database "+ sCurrentMessage, FALSE ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error -End Sub - diff --git a/smoketestoo_native/data/Test_Ext.xml b/smoketestoo_native/data/Test_Ext.xml deleted file mode 100644 index 735aae537596..000000000000 --- a/smoketestoo_native/data/Test_Ext.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - -REM ***** BASIC ***** - -const cMessageExtensionService = "Extension Service" -const cMessageExtensionInstall = "Install Extension" -const cMessageExtensionUninstall = "Uninstall Extension" - -Sub TestExtensions - Dim oTestExtension as Object, obj_null as Object - Dim sCurrentMessage as String - Dim bResult as Boolean - Dim sImplementationNameString as String - sImplementationNameString = cUnoSmoketestTestExtension + "$_TestExtension" - - On Local Error GoTo EXTERROR - - gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) - - sCurrentMessage = cMessageExtensionService - gCurrentTestCase = cEXTService - - 'Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for - 'adding the extension. The implementation is in - 'javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java and the code is in juh.jar - cmdEnv = createUnoService(cUnoSmoketestCommandEnvironment) - - 'Create the component context and then get the singleton ExtensionManager - 'A singleton cannot be created with createUnoService - ctx = getDefaultContext - ext_mgr = ctx.getValueByName("/singletons/" + cExtensionManager) - - LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) - if (IsNull(ext_mgr)) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - sCurrentMessage = cMessageExtensionInstall - gCurrentTestCase = cEXTInstall - - 'Add the extension. We must provide a file URL here. - 'By passing "user" we determine that the actions we perform on - 'XExtensionManager only affect the user installation. To modify the share installation one would pass "share". - - Dim props() as Object - ext_mgr.addExtension(sExtensionURL + cExtensionFileName, props, "user", obj_null, cmdEnv) - - 'Check if the extension has been added by creating a service which is contained in the extension. - oTestExtension = createUnoService(cUnoSmoketestTestExtension) - bResult = (oTestExtension.getImplementationName = sImplementationNameString) - LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) - if (not bResult) then - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub - End If - - sCurrentMessage = cMessageExtensionUninstall - gCurrentTestCase = cEXTUninstall - - 'Remove the package - ext_mgr.removeExtension("org.openoffice.legacy." + cExtensionFileName, cExtensionFileName, "user",obj_null, cmdEnv) - - 'Try to create the service which is contained in the now removed extension. - oTestExtension = createUnoService(cUnoSmoketestTestExtension) - - 'The service must not be available anymore. Therefor isNull must return true. - LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 - Exit Sub ' Without error - - EXTERROR: - If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) - Exit Sub - else - LogTestResult( "Extension "+ sCurrentMessage, False ) - Close #LocalFileChannel% - LocalFileChannel = 0 - End If - Exit Sub ' With error - -End Sub - diff --git a/smoketestoo_native/data/content.xml b/smoketestoo_native/data/content.xml deleted file mode 100644 index 3c81bbfbad5e..000000000000 --- a/smoketestoo_native/data/content.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - stardiv.one.form.control.CommandButton - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/dialog-lb.xml b/smoketestoo_native/data/dialog-lb.xml deleted file mode 100644 index 973dfe688828..000000000000 --- a/smoketestoo_native/data/dialog-lb.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/dialog-lc.xml b/smoketestoo_native/data/dialog-lc.xml deleted file mode 100644 index e3a5a0e326e4..000000000000 --- a/smoketestoo_native/data/dialog-lc.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/makefile.mk b/smoketestoo_native/data/makefile.mk deleted file mode 100644 index 2096d07de90e..000000000000 --- a/smoketestoo_native/data/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# 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. -# -#***********************************************************************/ - -PRJ = .. -PRJNAME = smoketestoo_native -TARGET = data - -.INCLUDE: settings.mk - -$(BIN)/smoketestdoc.sxw: $(MISC)/zip/smoketestdoc.sxw - $(COPY) $< $@ - -$(MISC)/zip/smoketestdoc.sxw: \ - Events.xml \ - Global.xml \ - OptionsDlg.xml \ - Test_10er.xml \ - Test_DB.xml \ - Test_Ext.xml \ - content.xml \ - dialog-lb.xml \ - dialog-lc.xml \ - manifest.xml \ - meta.xml \ - script-lb.xml \ - script-lc.xml \ - settings.xml \ - styles.xml - $(RM) -r $(MISC)/zip - $(MKDIR) $(MISC)/zip - $(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ - printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype - $(MKDIR) $(MISC)/zip/META-INF - $(COPY) manifest.xml $(MISC)/zip/META-INF/ - $(MKDIR) $(MISC)/zip/Basic - $(COPY) script-lc.xml $(MISC)/zip/Basic/ - $(MKDIR) $(MISC)/zip/Basic/Standard - $(COPY) script-lb.xml Events.xml Global.xml Test_10er.xml Test_DB.xml \ - Test_Ext.xml $(MISC)/zip/Basic/Standard/ - $(MKDIR) $(MISC)/zip/Dialogs - $(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ - $(MKDIR) $(MISC)/zip/Dialogs/Standard - $(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ - cd $(MISC)/zip && zip -rD $(@:f) . - -.INCLUDE: target.mk diff --git a/smoketestoo_native/data/manifest.xml b/smoketestoo_native/data/manifest.xml deleted file mode 100644 index 48fc9ce900a0..000000000000 --- a/smoketestoo_native/data/manifest.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/smoketestoo_native/data/meta.xml b/smoketestoo_native/data/meta.xml deleted file mode 100644 index 43f14295e2b3..000000000000 --- a/smoketestoo_native/data/meta.xml +++ /dev/null @@ -1,28 +0,0 @@ - - -Oracle_Open_Office/3.2$Win32 OpenOffice.org_project/300m77$Build-9496$CWS-renaissance22001-06-08T15:59:032007-01-18T12:45:22de-DE0PT0S diff --git a/smoketestoo_native/data/script-lb.xml b/smoketestoo_native/data/script-lb.xml deleted file mode 100644 index fc4f6c6370ba..000000000000 --- a/smoketestoo_native/data/script-lb.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/smoketestoo_native/data/script-lc.xml b/smoketestoo_native/data/script-lc.xml deleted file mode 100644 index e3a5a0e326e4..000000000000 --- a/smoketestoo_native/data/script-lc.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/smoketestoo_native/data/settings.xml b/smoketestoo_native/data/settings.xml deleted file mode 100644 index cd4524b741ff..000000000000 --- a/smoketestoo_native/data/settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - -003638217120truefalseview217120300200363801711900false100falsefalsefalsefalsefalse1falsefalsetruefalsetruefalsetruetruefalsetruetrueGgX+/01pY3Jvc29mdCBYUFMgRG9jdW1lbnQgV3JpdGVyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATWljcm9zb2Z0IFhQUyBEb2N1bWVudCBXcml0ZXIAAAAWAAEAPAQAAAAAAAAFAFZUAAAkbQAAM1ROVwIACABNAGkAYwByAG8AcwBvAGYAdAAgAFgAUABTACAARABvAGMAdQBtAGUAbgB0ACAAVwByAGkAdABlAHIAAAAAAAAAAQQABtwAWAMD/wAAAQABAJoLNAhkAAEADwBYAgIAAQBYAgIAAABBADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAACAAAAAQAAAP////8AAAAAAAAAAAAAAAAAAAAARElOVSIAEAFMAwwAytL2cgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAQAQAAU01USgAAAAAQAAABTQBpAGMAcgBvAHMAbwBmAHQAIABYAFAAUwAgAEQAbwBjAHUAbQBlAG4AdAAgAFcAcgBpAHQAZQByAAAASW5wdXRCaW4ARk9STVNPVVJDRQBSRVNETEwAVW5pcmVzRExMAEludGVybGVhdmluZwBPRkYASW1hZ2VUeXBlAEpQRUdNZWQAT3JpZW50YXRpb24AUE9SVFJBSVQAQ29sbGF0ZQBPRkYAUmVzb2x1dGlvbgBPcHRpb24xAFBhcGVyU2l6ZQBMRVRURVIAQ29sb3JNb2RlADI0YnBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAABNWERXAQEAABIAQ09NUEFUX0RVUExFWF9NT0RFDgBEVVBMRVhfVU5LTk9XTg==Adreßbuchfalseadressenfalsefalsefalsetruetruetruefalse0falsetruefalseMicrosoft XPS Document Writertruefalsetruetrue0truefalsefalsefalsetruetrue0truefalsetruefalsefalsetruefalsetruefalsetruetruedisabledfalsefalsefalse diff --git a/smoketestoo_native/data/styles.xml b/smoketestoo_native/data/styles.xml deleted file mode 100644 index 3f8d75fa6db3..000000000000 --- a/smoketestoo_native/data/styles.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk old mode 100644 new mode 100755 index 18f3a42b789f..aa7d4f5a0725 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -56,7 +56,7 @@ ALLTAR : cpptest cpptest : $(SHL1TARGETN) -TEST_ARGUMENTS = smoketest.doc=$(BIN)/smoketestdoc.sxw +TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(PROEXT)/smoketestdoc.sxw CPPTEST_LIBRARY = $(SHL1TARGETN) .IF "$(OS)" != "WNT" diff --git a/smoketestoo_native/prj/build.lst b/smoketestoo_native/prj/build.lst old mode 100644 new mode 100755 index 147a363d3da5..9527079f56d2 --- a/smoketestoo_native/prj/build.lst +++ b/smoketestoo_native/prj/build.lst @@ -1,5 +1,3 @@ -smtoon smoketestoo_native :: instsetoo_native test NULL +smtoon smoketestoo_native :: instsetoo_native test smoketestdoc NULL smtoon smoketestoo_native usr1 - all smoketestoonative_mkout NULL -smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smoketestoonative_csscs NULL -smtoon smoketestoo_native\data nmake - all smoketestoonative_data NULL -smtoon smoketestoo_native nmake - all,test10 smoketestoonative_mk smoketestoonative_csscs smoketestoonative_data NULL +smtoon smoketestoo_native nmake - all,test10 smoketestoonative_mk NULL diff --git a/smoketestoo_native/prj/d.lst b/smoketestoo_native/prj/d.lst old mode 100644 new mode 100755 diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx old mode 100644 new mode 100755 diff --git a/smoketestoo_native/version.map b/smoketestoo_native/version.map old mode 100644 new mode 100755 -- cgit From 0b3be71b8bf6d521679c9fabb0704768cfa538cb Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Fri, 11 Feb 2011 18:16:30 +0100 Subject: chart51: #i116681# fixed defaults for lights --- chart2/source/model/main/Diagram.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index aac706ab0c91..2e81d8c8680e 100755 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -195,6 +195,7 @@ private: ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 ); + ::chart::SceneProperties::AddDefaultsToMap( rOutMap ); } }; -- cgit From 1275251797b8ce74312d91a9e0f5252068ebd6c8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:15:05 +0100 Subject: debuglevels: bin, not binPROEXT --- smoketestoo_native/makefile.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index aa7d4f5a0725..76ea6c2c52ae 100755 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -56,18 +56,18 @@ ALLTAR : cpptest cpptest : $(SHL1TARGETN) -TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(PROEXT)/smoketestdoc.sxw +TEST_ARGUMENTS = smoketest.doc=$(OUTDIR)/bin$(UPDMINOREXT)/smoketestdoc.sxw CPPTEST_LIBRARY = $(SHL1TARGETN) .IF "$(OS)" != "WNT" $(installationtest_instpath).flag : $(shell ls \ $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).tar.gz) - $(RM) -r $(installationtest_instpath) - $(MKDIRHIER) $(installationtest_instpath) - cd $(installationtest_instpath) && $(GNUTAR) xfz \ + $(COMMAND_ECHO)$(RM) -r $(installationtest_instpath) + $(COMMAND_ECHO)$(MKDIRHIER) $(installationtest_instpath) + $(COMMAND_ECHO)cd $(installationtest_instpath) && $(GNUTAR) xfz \ $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).tar.gz - $(MV) $(installationtest_instpath)/OOo_*_install-arc_$(defaultlangiso) \ + $(COMMAND_ECHO)$(MV) $(installationtest_instpath)/OOo_*_install-arc_$(defaultlangiso) \ $(installationtest_instpath)/opt - $(TOUCH) $@ + $(COMMAND_ECHO)$(TOUCH) $@ cpptest : $(installationtest_instpath).flag .END -- cgit From 3f6abe1e8c1194616ac80885533cdf2b7fce3be5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:18:35 +0100 Subject: debuglevels: SalRGB.other -> SalRGB.otherSalRGB. Allows compiling with debug an WaE on current Solaris platforms (whether otherwise the identifier 'other' conflicts with another one deep inside boost) --- vcl/unx/inc/saldisp.hxx | 2 +- vcl/unx/source/app/saldisp.cxx | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 89efad3cde4d..d4f80f25da9b 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -127,7 +127,7 @@ enum SalRGB { RGB, RBG, RGBA, RBGA, GBRA, GRBA, BGRA, BRGA, - other }; + otherSalRGB }; // -=-= SalVisual =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= class SalVisual : public XVisualInfo diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 92d5f75f7315..45f0988bde43 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -912,7 +912,7 @@ void SalDisplay::Init() // carefully. if we are running linux (i.e. not netbsd) on an xfree // display, fvwm is most probable the wm to choose, confusing with mwm // doesn't harm. #57791# start maximized if possible - if( (otherwm == eWindowManager_) + if( (otherwm == eWindowManager_) || (olwm == eWindowManager_ )) { eWindowManager_ = fvwm; // ??? @@ -2790,44 +2790,44 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) if( blue_mask == 0xFF ) eRGBMode_ = RGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = RBG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( blue_mask == 0xFF ) eRGBMode_ = GRB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = GBR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = BRG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = BGR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; } } @@ -2851,7 +2851,7 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) switch( GetMode() ) { - case other: + case otherSalRGB: return FALSE; case SALCOLOR: break; @@ -2886,7 +2886,7 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2 ) switch( GetMode() ) { - case other: + case otherSalRGB: return FALSE; case SALCOLOR: break; @@ -2939,7 +2939,7 @@ SalColor SalVisual::GetTCColor( Pixel nPixel ) const Pixel g = nPixel & green_mask; Pixel b = nPixel & blue_mask; - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return MAKE_SALCOLOR( r >> nRedShift_, g >> nGreenShift_, b >> nBlueShift_ ); @@ -2970,7 +2970,7 @@ Pixel SalVisual::GetTCPixel( SalColor nSalColor ) const if( SALCOLORREVERSE == eRGBMode_ ) return (b << 16) | (g << 8) | (r); - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_); if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_; -- cgit From a4894295f3af978314b2abb1e3ff0b8c6a709179 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:23:40 +0100 Subject: debuglevels: silence unxsoli4.pro+debug warning --- extensions/source/plugin/unx/sysplug.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx index fbcf9b7497eb..97de2911ca82 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -109,7 +109,7 @@ UnxPluginComm::~UnxPluginComm() int status = 16777216; pid_t nExit = waitpid( m_nCommPID, &status, WUNTRACED ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "child %d (plugin app child %d) exited with status %d\n", nExit, m_nCommPID, WEXITSTATUS(status) ); + fprintf( stderr, "child %d (plugin app child %d) exited with status %d\n", (int)nExit, (int)m_nCommPID, (int)WEXITSTATUS(status) ); #else (void)nExit; #endif -- cgit From 767f07ae9389f73209bf6920991aef977968f97b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 20:27:14 +0100 Subject: debuglevels: silence WaE with uncmaxci.pro+debug --- rsc/source/rscpp/cpp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c index b8f90ab4f7ed..04d715f35351 100644 --- a/rsc/source/rscpp/cpp4.c +++ b/rsc/source/rscpp/cpp4.c @@ -629,7 +629,7 @@ void dumpparm(char* why) nargs, parmp - parm, why); for (i = 0; i < nargs; i++) { fprintf( pCppOut, "parm[%d] (%d) = \"%s\"\n", - i + 1, strlen(parlist[i]), parlist[i]); + i + 1, (int)strlen(parlist[i]), parlist[i]); } } #endif -- cgit From f6da0ecba9329d3b4f9d5840cbeaa01c7659f0c4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 13 Feb 2011 21:29:04 +0100 Subject: debuglevels: ensure the test closure log file is mentioned in the main log file as well --- smoketestdoc/data/Test_10er.xml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/smoketestdoc/data/Test_10er.xml b/smoketestdoc/data/Test_10er.xml index a6f46b01eb78..68d69d46991d 100755 --- a/smoketestdoc/data/Test_10er.xml +++ b/smoketestdoc/data/Test_10er.xml @@ -34,8 +34,8 @@ const sSChartLogFileName = "schlog.dat" const sSHptLogFileName = "shptlog.dat" const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "javalog.dat" const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" -const sTestGlueLogFileName = "testgluelog.dat" -const sLogFileName = "log.dat" +const sTestGlueLogFileName = "testclosure.log" +const sLogFileName = "smoketest.log" const cTempFileName = "ttt" const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" @@ -272,17 +272,19 @@ Sub WriteTestSequence WriteDBTests ("Database : ", MainFileChannel) end if if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", MainFileChannel) - end if + WriteExtensionTests ("Extension : ", MainFileChannel) + end if - Print #MainFileChannel -end Sub + Print #MainFileChannel, "testclosure : setup, write_status" -Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) - Dim sWriteStr as string + Print #MainFileChannel + end Sub - sWriteStr = sText - sWriteStr = sWriteStr + "new" + Sub WriteTests (sText as string, bTestAll as boolean) + Dim sWriteStr as string + + sWriteStr = sText + sWriteStr = sWriteStr + "new" if bTestAll then if bMakeSaveOpen8Test then sWriteStr = sWriteStr + ", save 8.0" @@ -300,7 +302,7 @@ Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer) sWriteStr = sWriteStr + ", close" - Print #nFileChannel, sWriteStr + Print #MainFileChannel, sWriteStr end Sub Sub WriteDBTests (sText as string, nFileChannel as integer) -- cgit From 68bcb8d2fa5021af8ba67309eee65dc2028adf63 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Feb 2011 11:15:55 +0100 Subject: debuglevels: fixed various issues around the test closure's log file --- smoketestdoc/data/Global.xml | 94 +++++++++++++++++++++----------- smoketestdoc/data/Test_10er.xml | 115 ++++++++++++++++++---------------------- smoketestdoc/data/Test_DB.xml | 18 +++---- smoketestdoc/data/Test_Ext.xml | 22 ++++---- 4 files changed, 134 insertions(+), 115 deletions(-) diff --git a/smoketestdoc/data/Global.xml b/smoketestdoc/data/Global.xml index d437eafe3457..53f913234227 100755 --- a/smoketestdoc/data/Global.xml +++ b/smoketestdoc/data/Global.xml @@ -38,7 +38,7 @@ global const cExtensionFileName = "TestExtension.oxt" global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2 -global const cOtherSetupDoc = 0, cOtherWriteStatus = 1 +global const cTestClosureSetupDoc = 0, cTestClosureWriteStatus = 1 global const cLogfileFailed = 255 global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3 @@ -54,7 +54,7 @@ global const frmWriter = 1, frmCalc = 2, frmImpress = 4 global const frmMath = 5, frmChart = 7, frmHyperText = 8, frmDraw = 9 global const frmDataBase = 10, frmJava = 13 global const frmExtension = 14 -global const frmTestGlue = 15 +global const frmTestClosure = 15 Global gCurrentDocTest As Integer Global gCurrentTestCase As Integer @@ -139,11 +139,23 @@ Sub AssertionHandler( sMessage as String ) End Sub Sub Main - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherSetupDoc - On Local Error Goto MainError - CaptureAssertions( "AssertionHandler" ) + + gCurrentDocTest = frmTestClosure + gCurrentTestCase = cLogfileFailed + + DeleteAllSavedFiles() + DeleteAllLogFiles() + SetupWorkPath() + + if GetSystem (sWorkPath) = "windows" then + sWorkPath = ConvertPathToWin (sWorkPath) + end if + + LocalTestLog% = OpenLogDat( GetLogFileName( gCurrentDocTest ) ) + + gCurrentTestCase = cTestClosureSetupDoc + CaptureAssertions( "AssertionHandler" ) call SetGlobalDoc @@ -158,10 +170,13 @@ Sub Main LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + Dim nPreserveFileHandle% + nPreserveFileHandle% = LocalTestLog% Call Test_10er.Main + LocalTestLog% = nPreserveFileHandle% - gCurrentDocTest = frmTestGlue - gCurrentTestCase = cOtherWriteStatus + gCurrentDocTest = frmTestClosure + gCurrentTestCase = cTestClosureWriteStatus if bShowTable then call CreateStatusTable2 call CreateStatusTable @@ -170,7 +185,13 @@ Sub Main ' do this LogTestResult call before CreateSecondState, since the latter accesses (and displays) the result call CreateSecondState gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage - end if + Else + LogTestResult( GetTestGlueDescription( gCurrentTestCase ), TRUE ) + End If + + ' print the 'test complete' marker + Print #LocalTestLog%, "---" + LocalTestLog% = 0 gOutputDoc.setModified( bWasModified ) @@ -178,15 +199,22 @@ Sub Main Exit Sub MainError: - LogTestResult( GetTestGlueDescription( gCurrentTestCase ), FALSE ) + If ( gCurrentTestCase = cLogfileFailed ) then + LogTestResult( "", False ) + Exit Sub + else + LogTestResult( "testclosure " + GetTestGlueDescription( gCurrentTestCase ), FALSE ) + Close #LocalTestLog% + LocalTestLog = 0 + End If End Sub Function GetTestGlueDescription( nTestCase as Integer ) Select Case ( nTestCase ) - case cOtherSetupDoc - GetTestGlueDescription = "setup test document" - case cOtherWriteStatus - GetTestGlueDescription = "write test status" + case cTestClosureSetupDoc + GetTestGlueDescription = "setup" + case cTestClosureWriteStatus + GetTestGlueDescription = "write_status" case Else GetTestGlueDescription = "" End Select @@ -259,8 +287,8 @@ Sub CreateStatusTable2 tableRows2(cEXTUninstall ) = "uninstall" dim tableRows3(1) as string - tableRows3(cOtherSetupDoc ) = "setup test" - tableRows3(cOtherWriteStatus ) = "write test result" + tableRows3(cTestClosureSetupDoc ) = "setup test" + tableRows3(cTestClosureWriteStatus ) = "write test result" aDoc = gOutputDoc @@ -380,24 +408,29 @@ Sub LogTestResult( sTestCaseDescription as String, bSuccess as Boolean ) If ( gCurrentTestCase = cLogfileFailed ) Then Dim sAnnotation as String sAnnotation = "creating logfile '" + GetLogFileName( gCurrentDocTest ) + "' failed" - LogState( FALSE, sAnnotation, MainFileChannel ) - SetStatus( 0, FALSE, sAnnotation ) + LogState( FALSE, sAnnotation, GlobalTestLog ) + RecordTestCaseStatus( 0, FALSE, sAnnotation ) Else - If ( LocalFileChannel <> 0 ) Then - LogState( bSuccess, sTestCaseDescription, LocalFileChannel ) + bSuccess = RecordTestCaseStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) + If ( LocalTestLog <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, LocalTestLog ) EndIf - if ( MainFileChannel <> 0 ) Then - LogState( bSuccess, sTestCaseDescription, MainFileChannel ) + if ( GlobalTestLog <> 0 ) Then + LogState( bSuccess, sTestCaseDescription, GlobalTestLog ) EndIf - SetStatus( gCurrentTestCase, bSuccess, sTestCaseDescription ) End If End Sub -Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) +Function RecordTestCaseStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as String ) as Boolean Dim nStatusType as Integer Dim nState as integer nStatusType = GetStatusType( gCurrentDocTest ) - If nStatusType = cStNone then Exit Sub + If nStatusType = cStNone then Exit Function + + If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then + ' don't overwrite a previous "failed" state for this test + bState = FALSE + End If if bState then nState = cLogTrue @@ -405,17 +438,14 @@ Sub SetStatus( nAction as Integer, bState as Boolean, sFailureAnnotation as Stri nState = cLogFalse end If - If ( gErrorState( nStatusType, nAction ) = cLogFalse ) Then - ' don't overwrite a previous "failed" state for this this - nState = cLogFalse - End If - gErrorState (nStatusType, nAction) = nState If ( nState = cLogFalse ) And ( sFailureAnnotation <> "" ) Then gTestCaseAnnotations( nStatusType, nAction ) = gTestCaseAnnotations( nStatusType, nAction ) + sFailureAnnotation + chr(13) End If -end Sub + + RecordTestCaseStatus = bState +End Function Function GetStatusType (nDocType as Integer) as Integer Select Case ( nDocType ) @@ -435,7 +465,7 @@ Function GetStatusType (nDocType as Integer) as Integer GetStatusType = cStChart ' chart case frmJava GetStatusType = cStJava 'Java - case frmTestGlue + case frmTestClosure GetStatusType = cStTestGlue ' test framework case frmDataBase GetStatusType = cStDataBase 'DataBase diff --git a/smoketestdoc/data/Test_10er.xml b/smoketestdoc/data/Test_10er.xml index 68d69d46991d..b929caccb1b8 100755 --- a/smoketestdoc/data/Test_10er.xml +++ b/smoketestdoc/data/Test_10er.xml @@ -36,7 +36,7 @@ const sSDrawLogFileName = "sdrwlog.dat", sJavaLogFileName = "java const sSDBLogFileName = "dblog.dat", sExtLogFileName = "extlog.dat" const sTestGlueLogFileName = "testclosure.log" const sLogFileName = "smoketest.log" -const cTempFileName = "ttt" +const cTempFileName = "smoketest_file" const cMessageSaveOpen8Doc = "Save/Open open Documents (8.0)" const cMessageSaveOpenXMLDoc = "Save/Open Document XML (6/7)" @@ -45,8 +45,8 @@ const cMessageCloseDoc = "Close Document" Global sWorkPath$ Global sWorkPathURL$ -Global LocalFileChannel% -Global MainFileChannel% +Global LocalTestLog% +Global GlobalTestLog% Sub Main call TestAllDocs() @@ -141,15 +141,13 @@ Function OpenLogDat (sFileName as String) as Integer OpenLogDat = LocaleFileChannel% end Function -Function GetWorkPath as string - sTemp = "$(userpath)/temp/" - GetWorkPath = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function +Sub SetupWorkPath + Dim configManager as Object + configManager = CreateUnoService( "com.sun.star.config.SpecialConfigManager" ) -Function GetWorkURL as string - sTemp = "$(userurl)/temp/" - GetWorkURL = CreateUnoService("com.sun.star.config.SpecialConfigManager").SubstituteVariables(sTemp) -End Function + sWorkPath = configManager.SubstituteVariables( "$(userpath)/temp/" ) + sWorkPathURL = configManager.SubstituteVariables( "$(userurl)/temp/" ) +End Sub Function GetSystem (sTmpWorkPath as string) as string GetSystem = "" @@ -178,13 +176,6 @@ Sub TestAllDocs() DIM sDocURL as String, sDocPath as String DIM nStrPos as Long - sWorkPath = GetWorkPath - sWorkPathURL = GetWorkURL - - if GetSystem (sWorkPath) = "windows" then - sWorkPath = ConvertPathToWin (sWorkPath) - end if - 'search ExtensionURL sDocURL = gOutputDoc.URL CompatibilityMode(true) @@ -192,9 +183,7 @@ DIM nStrPos as Long CompatibilityMode(false) sExtensionURL = Left (sDocURL, nStrPos) - call DeleteAllSavedFiles() - call DeleteAllLogFiles() - MainFileChannel = OpenLogDat (sLogFileName) + GlobalTestLog = OpenLogDat (sLogFileName) call WriteTestSequence if bMakeWriterTest then gCurrentDocTest = frmWriter @@ -237,47 +226,47 @@ DIM nStrPos as Long call Test_Ext.TestExtensions end if - Close #MainFileChannel - MainFileChannel = 0 + Close #GlobalTestLog + GlobalTestLog = 0 end Sub Sub WriteTestSequence - Print #MainFileChannel, "Sequence of testing" + Print #GlobalTestLog, "Sequence of testing" if bMakeWriterTest then - WriteTests ("writer : ", true, MainFileChannel) + WriteTests ("writer : ", true, GlobalTestLog) end if if bMakeCalcTest then - WriteTests ("calc : ", true, MainFileChannel) + WriteTests ("calc : ", true, GlobalTestLog) end if if bMakeImpressTest then - WriteTests ("impress : ", true, MainFileChannel) + WriteTests ("impress : ", true, GlobalTestLog) end if if bMakeDrawTest then - WriteTests ("draw : ", true, MainFileChannel) + WriteTests ("draw : ", true, GlobalTestLog) end if if bMakeHTMLTest then - WriteTests ("HTML : ", true, MainFileChannel) + WriteTests ("HTML : ", true, GlobalTestLog) end if if bMakeChartTest then - WriteTests ("chart : ", false, MainFileChannel) + WriteTests ("chart : ", false, GlobalTestLog) end if if bMakeMathTest then - WriteTests ("math : ", false, MainFileChannel) + WriteTests ("math : ", false, GlobalTestLog) end if if bMakeJavaTest then - WriteTests ("Java : ", false, MainFileChannel) + WriteTests ("Java : ", false, GlobalTestLog) end if if bMakeDBTest then - WriteDBTests ("Database : ", MainFileChannel) + WriteDBTests ("Database : ", GlobalTestLog) end if if bMakeExtensionTest then - WriteExtensionTests ("Extension : ", MainFileChannel) + WriteExtensionTests ("Extension : ", GlobalTestLog) end if - Print #MainFileChannel, "testclosure : setup, write_status" + Print #GlobalTestLog, "testclosure : setup, write_status" - Print #MainFileChannel + Print #GlobalTestLog end Sub Sub WriteTests (sText as string, bTestAll as boolean) @@ -302,7 +291,7 @@ Sub WriteTestSequence sWriteStr = sWriteStr + ", close" - Print #MainFileChannel, sWriteStr + Print #GlobalTestLog, sWriteStr end Sub Sub WriteDBTests (sText as string, nFileChannel as integer) @@ -336,7 +325,7 @@ Sub MakeDocTest On Local Error GoTo DOCTESTERROR gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) gCurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ cMessageNewDoc, not IsNull (oDoc) ) @@ -381,19 +370,19 @@ Sub MakeDocTest end if end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DOCTESTERROR: If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) + LogTestResult( " ", False ) Exit Sub else LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub @@ -403,7 +392,7 @@ Sub MakeNewDoc Dim bSuccess as Boolean On Local Error GoTo DOCTESTERROR2 gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) gCurrentTestCase = cDocNew ' oDoc = Documents.Add(GetDocFilter(gCurrentDocTest)) oDoc = LoadDoc ("private:factory/" + GetDocFilter(gCurrentDocTest or cFltNewDoc)) @@ -413,19 +402,19 @@ Sub MakeNewDoc bSuccess = CloseDoc( oDoc ) LogTestResult( GetDocFilter(gCurrentDocTest)+" "+ cMessageCloseDoc, bSuccess ) end If - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DOCTESTERROR2: If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) + LogTestResult( " ", False ) Exit Sub else LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), False ) - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub @@ -439,7 +428,7 @@ Sub MakeChartTest Dim bSuccess as Boolean On Local Error GoTo CHARTTESTERROR gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) gCurrentTestCase = cDocNew oDoc = LoadDoc ("private:factory/" + GetDocFilter(frmCalc or cFltNewDoc)) if not IsNull (oDoc) then @@ -452,19 +441,19 @@ Sub MakeChartTest else LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+" "+ cMessageNewDoc, FALSE ) End if - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error CHARTTESTERROR: If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) + LogTestResult( " ", False ) Exit Sub else LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+" "+ GetErrorMessage(gCurrentTestCase), FALSE ) - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub @@ -566,7 +555,7 @@ Function GetLogFileName (DocType as Integer) as String GetLogFileName = sSChartLogFileName ' chart case frmJava GetLogFileName = sJavaLogFileName 'Java - case frmOther + case frmTestClosure GetLogFileName = sTestGlueLogFileName ' test framework case frmDataBase GetLogFileName = sSDBLogFileName 'Database @@ -602,14 +591,14 @@ End Function Function TestJava Dim oObj as Object gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) gCurrentTestCase = cDocNew oObj = createUnoService( cUnoJavaLoader ) LogTestResult( "Java "+ cMessageNewDoc, not IsNull (oObj) ) - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 TestJava = not IsNull (oObj) End Function diff --git a/smoketestdoc/data/Test_DB.xml b/smoketestdoc/data/Test_DB.xml index a9f1fc2e316d..1f5667cae5a5 100755 --- a/smoketestdoc/data/Test_DB.xml +++ b/smoketestdoc/data/Test_DB.xml @@ -46,7 +46,7 @@ Sub TestDB On Local Error GoTo DBERROR gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) gCurrentTestCase = cDBService sCurrentMessage = cMessageDatabaseService + " " + cUnoDatabaseContext @@ -63,8 +63,8 @@ Sub TestDB LogTestResult( "Database "+ cMessageDatabaseOpen, not IsNull (oDBConnection) ) if (IsNull(oDBConnection)) then - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If @@ -128,19 +128,19 @@ Sub TestDB oDBConnection.Dispose() LogTestResult( "Database "+ cMessageDatabaseClose, True ) - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error DBERROR: If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) + LogTestResult( " ", False ) Exit Sub else LogTestResult( "Database "+ sCurrentMessage, FALSE ) - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error End Sub diff --git a/smoketestdoc/data/Test_Ext.xml b/smoketestdoc/data/Test_Ext.xml index 735aae537596..ac39f4816d7b 100755 --- a/smoketestdoc/data/Test_Ext.xml +++ b/smoketestdoc/data/Test_Ext.xml @@ -42,7 +42,7 @@ Sub TestExtensions On Local Error GoTo EXTERROR gCurrentTestCase = cLogfileFailed - LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest)) + LocalTestLog% = OpenLogDat (GetLogFileName(gCurrentDocTest)) sCurrentMessage = cMessageExtensionService gCurrentTestCase = cEXTService @@ -59,8 +59,8 @@ Sub TestExtensions LogTestResult( "Extension "+ cMessageExtensionService, not IsNull (ext_mgr) ) if (IsNull(ext_mgr)) then - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If @@ -79,8 +79,8 @@ Sub TestExtensions bResult = (oTestExtension.getImplementationName = sImplementationNameString) LogTestResult( "Extension "+ cMessageExtensionInstall, bResult ) if (not bResult) then - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub End If @@ -96,19 +96,19 @@ Sub TestExtensions 'The service must not be available anymore. Therefor isNull must return true. LogTestResult( "Extension "+ cMessageExtensionUninstall, IsNull (oTestExtension) ) - Print #LocalFileChannel, "---" - Close #LocalFileChannel% - LocalFileChannel = 0 + Print #LocalTestLog, "---" + Close #LocalTestLog% + LocalTestLog = 0 Exit Sub ' Without error EXTERROR: If ( gCurrentTestCase = cLogfileFailed ) then - LogTestResult( "", False ) + LogTestResult( " ", False ) Exit Sub else LogTestResult( "Extension "+ sCurrentMessage, False ) - Close #LocalFileChannel% - LocalFileChannel = 0 + Close #LocalTestLog% + LocalTestLog = 0 End If Exit Sub ' With error -- cgit From aa29f5ad1ec43392b5f88fc446e16b375b630bac Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Feb 2011 13:43:17 +0100 Subject: debuglevels: ResetCapturedAssertions: don't reset to NULL channel if assertions are not captured --- basic/source/runtime/sbdiagnose.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx index d779fe17e254..d75d15252711 100644 --- a/basic/source/runtime/sbdiagnose.cxx +++ b/basic/source/runtime/sbdiagnose.cxx @@ -44,7 +44,10 @@ static bool bReportingAssertion = false; void ResetCapturedAssertions() { - DBG_INSTOUTERROR( nRestoreChannelId != 0 ? nRestoreChannelId : DBG_OUT_NULL ); + if ( nRestoreChannelId != 0 ) + { + DBG_INSTOUTERROR( nRestoreChannelId ); + } nRestoreChannelId = 0; xAssertionChannelBasic = NULL; sCaptureFunctionName = String(); -- cgit From 90d10fefa3e84d03b544867133803b8d747e4ebb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Feb 2011 15:22:39 +0100 Subject: debuglevels: corrected assertion's condition (report the existence, not the non-existence of forward slashes in the given path) --- sal/osl/w32/file_dirvol.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index 09bdec7988c3..549f42861f94 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -155,7 +155,7 @@ namespace /* private */ void parse_UNC_path(const sal_Unicode* path, UNCComponents* puncc) { OSL_PRECOND(is_UNC_path(path), "Precondition violated: No UNC path"); - OSL_PRECOND(rtl_ustr_indexOfChar(path, SLASH) != -1, "Path must not contain slashes"); + OSL_PRECOND(rtl_ustr_indexOfChar(path, SLASH) == -1, "Path must not contain slashes"); const sal_Unicode* pend = path + rtl_ustr_getLength(path); const sal_Unicode* ppos = path + 2; @@ -691,7 +691,7 @@ static int path_make_parent(sal_Unicode* path) If there are no more parents 0 will be returned, e.g. 'c:\' or '\\Share' have no more parents */ - OSL_PRECOND(rtl_ustr_indexOfChar(path, SLASH) != -1, "Path must not contain slashes"); + OSL_PRECOND(rtl_ustr_indexOfChar(path, SLASH) == -1, "Path must not contain slashes"); OSL_PRECOND(has_path_parent(path), "Path must have a parent"); sal_Unicode* pos_last_backslash = path + rtl_ustr_lastIndexOfChar(path, BACKSLASH); -- cgit From 194717cb55e09f031f11aaf3684eaf479a50a96d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Feb 2011 15:33:27 +0100 Subject: debuglevels: removed now-useless (and annoying) trace --- sfx2/source/doc/objxtor.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a5141662fa3d..aa3c0747b528 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -921,11 +921,6 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp s_xCurrentComponent = _rxComponent; if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) ); - -#if OSL_DEBUG_LEVEL > 0 - const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void"; - OSL_TRACE( "current component is a %s\n", pComponentImplName ); -#endif } Reference< XInterface > SfxObjectShell::GetCurrentComponent() -- cgit From b06bea2d125b0621dbafa6a17f76ce3a0ef9bb43 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 14 Feb 2011 21:48:48 +0100 Subject: CWS swlayoutrefactoring: gcc3 needs some help --- sw/inc/ddefld.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx index 6fb7a76c3728..07215ff435ad 100644 --- a/sw/inc/ddefld.hxx +++ b/sw/inc/ddefld.hxx @@ -89,6 +89,7 @@ public: void DecRefCnt() { if( !--nRefCnt && pDoc ) _RefCntChgd(); } void SetCRLFDelFlag( sal_Bool bFlag = sal_True ) { bCRLFFlag = bFlag; } + SwDDEFieldType( const SwDDEFieldType& ); }; /*-------------------------------------------------------------------- -- cgit From 015d7aafddc017e8d877d509d7f0d608d3ea55c7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Feb 2011 12:54:56 +0100 Subject: debuglevels: post-rebase fixes --- basic/source/runtime/sbdiagnose.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx index d75d15252711..97bfb0a00814 100644 --- a/basic/source/runtime/sbdiagnose.cxx +++ b/basic/source/runtime/sbdiagnose.cxx @@ -119,7 +119,7 @@ RTLFUNC(CaptureAssertions) // ensure OSL assertions are captured, too DbgData aData( *DbgGetData() ); - aData.bHookOSLAssert = TRUE; + aData.bHookOSLAssert = sal_True; DbgUpdateOslHook( &aData ); } -- cgit From 3a16bfa1ff6ece66b912ff003ad3897c47d59263 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Feb 2011 23:58:09 +0100 Subject: debuglevels: #i116845# ~OfficeDocumentsManager: don't assert an empty document list --- ucb/source/ucp/tdoc/tdoc_docmgr.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 46aa1ae69ec3..261bedb7b4f9 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -84,7 +84,11 @@ OfficeDocumentsManager::OfficeDocumentsManager( // virtual OfficeDocumentsManager::~OfficeDocumentsManager() { - OSL_ENSURE( m_aDocs.empty(), "document list not empty!" ); + //OSL_ENSURE( m_aDocs.empty(), "document list not empty!" ); + // no need to assert this: Normal shutdown of OOo could already trigger it, since the order in which + // objects are actually released/destroyed upon shutdown is not defined. And when we arrive *here*, + // OOo *is* shutting down currently, since we're held by the TDOC provider, which is disposed + // upon shutdown. } //========================================================================= -- cgit From 9a02d3ff84209d7349527ad245a6f4f1261135e6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Feb 2011 23:58:09 +0100 Subject: debuglevels: BasicManager::ExecuteMacro: when the return value of the executed method is the method itself, don't retrieve its value - it would execute the method, again (encountered in the refactored smoketest_native) --- basic/source/basmgr/basmgr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index bb686c765f4c..a6a1fb5f23c0 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1975,7 +1975,7 @@ ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String c sCall += ']'; SbxVariable* pRet = pMethod->GetParent()->Execute( sCall ); - if ( pRet ) + if ( pRet && ( pRet != pMethod ) ) *i_retValue = *pRet; return SbxBase::GetError(); } -- cgit From 1c14599519ed693d9c9db3b564627559c9e813c3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Feb 2011 23:58:09 +0100 Subject: debuglevels: a little less verbosity --- solenv/inc/installationtest.mk | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index b7b49c4aec3b..23e95be60de5 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -79,28 +79,27 @@ my_javaenv = \ # on other platforms, a single installation to solver is created in # smoketestoo_native: .IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == "" +OOO_EXTRACT_TO:=$(shell cygpath -m `mktemp -dt ooosmoke.XXXXXX`) $(MISC)/$(TARGET)/installation.flag : $(shell \ ls $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip) - $(MKDIRHIER) $(@:d) - my_tmp=$$(cygpath -m $$(mktemp -dt ooosmoke.XXXXXX)) && \ - unzip $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip \ - -d "$$my_tmp" && \ - mv "$$my_tmp"/OOo_*_install-arc_$(defaultlangiso) "$$my_tmp"/opt && \ - echo "$$my_tmp" > $@ + $(COMMAND_ECHO)$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)unzip -q $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip -d "$(OOO_EXTRACT_TO)" + $(COMMAND_ECHO)mv "$(OOO_EXTRACT_TO)"/OOo_*_install-arc_$(defaultlangiso) "$(OOO_EXTRACT_TO)"/opt + $(COMMAND_ECHO)echo "$(OOO_EXTRACT_TO)" > $@ .END cpptest .PHONY : - $(RM) -r $(MISC)/$(TARGET)/user - $(MKDIRHIER) $(MISC)/$(TARGET)/user + $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user + $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(CPPUNITTESTER) \ -env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb \ -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb \ -env:arg-soffice=$(my_soffice) -env:arg-user=$(MISC)/$(TARGET)/user \ $(my_cppenv) $(TEST_ARGUMENTS:^"-env:arg-testarg.") $(CPPTEST_LIBRARY) - # As a workaround for #i111400#, ignore failure of $(RM): - - $(RM) -r $(MISC)/$(TARGET)/user +# As a workaround for #i111400#, ignore failure of $(RM): + $(COMMAND_ECHO)- $(RM) -r $(MISC)/$(TARGET)/user .IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == "" - $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag + $(COMMAND_ECHO)$(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag cpptest : $(MISC)/$(TARGET)/installation.flag .END @@ -137,5 +136,5 @@ javatest : $(MISC)/$(TARGET)/installation.flag .END .ELSE javatest .PHONY : - echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR' + @echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR' .END -- cgit From e648dff4561470d3aba457ec916437d04fea5c0c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Feb 2011 10:23:55 +0100 Subject: debuglevels: explicit failure upon catching an UNO exception (which gives a slightly better idea of the failure than what cppunit emits by default) --- smoketestoo_native/smoketest.cxx | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index a4e532123456..002967823e00 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -48,6 +48,7 @@ #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/util/URL.hpp" #include +#include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" @@ -56,6 +57,7 @@ #include #include "osl/conditn.hxx" #include "osl/diagnose.h" +#include "rtl/strbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "test/gettestargument.hxx" @@ -130,23 +132,46 @@ public: private: CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(test); + CPPUNIT_TEST(runSmoketestDoc); CPPUNIT_TEST_SUITE_END(); - void test(); + void runSmoketestDoc(); + + ::rtl::OString getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ); test::OfficeConnection connection_; }; +::rtl::OString Test::getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ) +{ + ::rtl::OStringBuffer failMessage; + failMessage.append( i_context ); + failMessage.append( ": caught a " ); + failMessage.append( ::rtl::OUStringToOString( i_exception.getValueTypeName(), RTL_TEXTENCODING_ASCII_US ) ); + return failMessage.makeStringAndClear(); +} + void Test::setUp() { - connection_.setUp(); + try { + connection_.setUp(); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "setting up the connection failed", ::cppu::getCaughtException() ).getStr() ); + } } void Test::tearDown() { - connection_.tearDown(); + try { + connection_.tearDown(); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "tearing down the connection failed", ::cppu::getCaughtException() ).getStr() ); + } } -void Test::test() { +void Test::runSmoketestDoc() { + try + { rtl::OUString doc; CPPUNIT_ASSERT( test::getTestArgument( @@ -195,6 +220,10 @@ void Test::test() { result.condition.wait(); CPPUNIT_ASSERT(result.success); CPPUNIT_ASSERT_EQUAL(rtl::OUString(), result.result); + } + catch( css::uno::Exception const & ) { + CPPUNIT_FAIL( getFailMessage( "executing the smoketest macro", ::cppu::getCaughtException() ).getStr() ); + } } CPPUNIT_TEST_SUITE_REGISTRATION(Test); -- cgit From 92c21df5580369a2a7a3ad3ce6c9ed939782ce93 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Wed, 16 Feb 2011 16:39:11 +0100 Subject: chart51: merge with DEV300_m100 - part 2 --- sc/source/ui/app/scdll.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 1199ea378d53..f87241f2fa40 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -287,7 +287,7 @@ void ScDLL::Init() // Child-Windows - ScInputWindowWrapper ::RegisterChildWindow( TRUE, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK|SFX_CHILDWIN_NEVERHIDEACTIVEOLE ); + ScInputWindowWrapper ::RegisterChildWindow( sal_True, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK|SFX_CHILDWIN_NEVERHIDEACTIVEOLE ); ScNavigatorDialogWrapper ::RegisterChildWindowContext( sal::static_int_cast(ScTabViewShell::GetInterfaceId()), pMod); ScSolverDlgWrapper ::RegisterChildWindow(sal_False, pMod); -- cgit From d536f34a8d7c0cf5360690a428d0a07143aac708 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Wed, 16 Feb 2011 16:39:11 +0100 Subject: chart51: merge with DEV300_m100 - part 2 --- sfx2/source/appl/workwin.cxx | 2 +- xmloff/source/chart/SchXMLExport.cxx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 0a8fb6987b3e..cbc9b1f7c46a 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -823,7 +823,7 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( sal_Bool bForce ) pClient = pF->GetViewShell()->GetIPClient(); bool bForceArrange( false ); - for ( USHORT n = 0; n < pChildWins->Count(); ++n ) + for ( sal_uInt16 n = 0; n < pChildWins->Count(); ++n ) { SfxChildWin_Impl* pCW = (*pChildWins)[ n ]; SfxChildWindow* pChild = pCW->pWin; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index dbbedc09f751..2f1c9adcfc74 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -838,7 +838,6 @@ lcl_TableData lcl_getDataForLocalTable( tStringVector& rCategories = bSeriesFromColumns ? aResult.aRowDescriptions : aResult.aColumnDescriptions; tStringVector& rLabels = bSeriesFromColumns ? aResult.aColumnDescriptions : aResult.aRowDescriptions; - Sequence< Sequence< OUString > >& rComplexLabels = bSeriesFromColumns ? aResult.aComplexColumnDescriptions : aResult.aComplexRowDescriptions;//#i116544# //categories lcl_SequenceToVector( aSimpleCategories, rCategories ); @@ -855,10 +854,11 @@ lcl_TableData lcl_getDataForLocalTable( // iterate over all sequences size_t nSeqIdx = 0; + Sequence< Sequence< OUString > > aComplexLabels; for( ; aIt != aEnd; ++aIt, ++nSeqIdx ) { OUString aRange; - Sequence< OUString >& rCurrentComplexLabel = rComplexLabels[nSeqIdx]; + Sequence< OUString >& rCurrentComplexLabel = aComplexLabels[nSeqIdx]; if( aIt->first.is()) { lcl_getLabelStringSequence( rCurrentComplexLabel, aIt->first ); @@ -900,6 +900,16 @@ lcl_TableData lcl_getDataForLocalTable( if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) ) aResult.aHiddenColumns.push_back(nSeqIdx); } + Sequence< Sequence< Any > >& rComplexAnyLabels = bSeriesFromColumns ? aResult.aComplexColumnDescriptions : aResult.aComplexRowDescriptions;//#i116544# + rComplexAnyLabels.realloc(aComplexLabels.getLength()); + for( sal_Int32 nN=0; nN& rSource = aComplexLabels[nN]; + Sequence< Any >& rTarget = rComplexAnyLabels[nN]; + rTarget.realloc( rSource.getLength() ); + for( sal_Int32 i=0; i Date: Wed, 16 Feb 2011 19:12:40 +0100 Subject: chart51: #i116544# integrate fix for copy/paste bug #i116943# --- sc/source/core/tool/charthelper.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index a2db16dff690..64b2a7776bb5 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -309,6 +309,7 @@ void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, if ( xEmbeddedObj.is() ) { bool bDisableDataTableDialog = false; + sal_Int32 nOldState = xEmbeddedObj->getCurrentState(); svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj ); uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY ); if ( xProps.is() && @@ -333,6 +334,10 @@ void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, } } } + if ( xEmbeddedObj->getCurrentState() != nOldState ) + { + xEmbeddedObj->changeState( nOldState ); + } } } } -- cgit From 4940c2e354be0e577e96de60976e84be1235cf28 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 17 Feb 2011 10:48:20 +0100 Subject: dba34d: #i116991# fix ScriptEventListenerWrapper to report failures in the delegatee creation as assertions only, instead of throwing a RuntimeException which is caught way too late (transplanted from 173bca2cba4074c69e487271427dce15318befe6) --- svx/source/form/fmundo.cxx | 78 ++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 52 deletions(-) diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index eee61c5c2dee..8a72cb768d5f 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -66,6 +66,7 @@ #include #include #include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -88,7 +89,9 @@ typedef cppu::WeakImplHelper1< XScriptListener > ScriptEventListener_BASE; class ScriptEventListenerWrapper : public ScriptEventListener_BASE { public: - ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel) + ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) + :m_rModel( _rModel ) + ,m_attemptedListenerCreation( false ) { } @@ -98,7 +101,7 @@ public: // XScriptListener virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { m_vbaListener->firing( evt ); @@ -107,7 +110,7 @@ public: virtual Any SAL_CALL approveFiring(const ScriptEvent& evt) throw( com::sun::star::reflection::InvocationTargetException, RuntimeException) { - setModel(); + attemptListenerCreation(); if ( m_vbaListener.is() ) { return m_vbaListener->approveFiring( evt ); @@ -116,61 +119,32 @@ public: } private: - void setModel() + void attemptListenerCreation() { - if ( !m_vbaListener.is() ) - { - Reference < XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - if ( xProps.is() ) - { - Reference< XComponentContext > xCtx( xProps->getPropertyValue( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY ); - if ( xCtx.is() ) - { - Reference< XMultiComponentFactory > xMFac( - xCtx->getServiceManager(), UNO_QUERY ); - - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - Reference< XMultiServiceFactory > xDocFac; - if ( xObjSh.Is() ) - xDocFac.set( xObjSh->GetModel(), UNO_QUERY ); + if ( m_attemptedListenerCreation ) + return; + m_attemptedListenerCreation = true; - if ( xMFac.is() ) - { - m_vbaListener.set( xMFac->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "ooo.vba.EventListener" ) ), xCtx ), - UNO_QUERY_THROW ); - } - } - } + try + { + ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW ); + Reference< XPropertySet > const xListenerProps( m_vbaListener, UNO_QUERY_THROW ); + // SfxObjectShellRef is good here since the model controls the lifetime of the shell + SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell(); + ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" ); + xListenerProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), makeAny( xObjectShell->GetModel() ) ); + + m_vbaListener = xScriptListener; } - Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY ); - if ( xProps.is() ) + catch( Exception const & ) { - try - { - // SfxObjectShellRef is good here since the model controls the lifetime of the shell - SfxObjectShellRef xObjSh = pModel->GetObjectShell(); - if ( xObjSh.Is() && m_vbaListener.is() ) - { - Any aVal; - aVal <<= xObjSh->GetModel(); - xProps->setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), - aVal ); - } - } - catch( Exception& ) - { - //swallow any errors - } + DBG_UNHANDLED_EXCEPTION(); } } - FmFormModel* pModel; - Reference< XScriptListener > m_vbaListener; + FmFormModel& m_rModel; + Reference< XScriptListener > m_vbaListener; + bool m_attemptedListenerCreation; }; -- cgit From 0a642c8bcfc4955147ab45eab9fa227babd92140 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Thu, 17 Feb 2011 17:46:11 +0100 Subject: chart51: merge with DEV300_m100 - part 3 --- xmloff/source/chart/SchXMLExport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 2f1c9adcfc74..d9b157757fd8 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -854,7 +854,7 @@ lcl_TableData lcl_getDataForLocalTable( // iterate over all sequences size_t nSeqIdx = 0; - Sequence< Sequence< OUString > > aComplexLabels; + Sequence< Sequence< OUString > > aComplexLabels(nNumSequences); for( ; aIt != aEnd; ++aIt, ++nSeqIdx ) { OUString aRange; -- cgit From bf2af8dbb892d5f6b66a786ce75459a0de4c9477 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 18 Feb 2011 17:17:49 +0100 Subject: jl64 #i109096# extensions do not work with long path names --- desktop/source/deployment/manager/dp_manager.cxx | 29 ++++++++++++++-------- .../source/deployment/registry/dp_backenddb.cxx | 5 +++- 2 files changed, 23 insertions(+), 11 deletions(-) mode change 100644 => 100755 desktop/source/deployment/manager/dp_manager.cxx mode change 100644 => 100755 desktop/source/deployment/registry/dp_backenddb.cxx diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx old mode 100644 new mode 100755 index 2e2c5e2a2f53..ad01a9dbb79e --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -63,6 +63,7 @@ #include "com/sun/star/ucb/UnsupportedCommandException.hpp" #include "boost/bind.hpp" #include "tools/urlobj.hxx" +#include "unotools/tempfile.hxx" #include "osl/file.hxx" #include @@ -636,20 +637,28 @@ OUString PackageManagerImpl::insertToActivationLayer( ::ucbhelper::Content sourceContent(sourceContent_); Reference xCmdEnv( sourceContent.getCommandEnvironment() ); - OUString destFolder, tempEntry; - if (::osl::File::createTempFile( - m_activePackages_expanded.getLength() == 0 - ? 0 : &m_activePackages_expanded, - 0, &tempEntry ) != ::osl::File::E_None) - throw RuntimeException( - OUSTR("::osl::File::createTempFile() failed!"), 0 ); + OUString destFolder; + OUString tempEntry; + // if (::osl::File::createTempFile( + // m_activePackages_expanded.getLength() == 0 + // ? 0 : &m_activePackages_expanded, + // 0, &tempEntry ) != ::osl::File::E_None) + // throw RuntimeException( + // OUSTR("::osl::File::createTempFile() failed!"), 0 ); + //::utl::TempFile::SetTempNameBaseDirectory(m_activePackages_expanded); + String baseDir(m_activePackages_expanded); + ::utl::TempFile aTemp(OUSTR("jl123"), NULL, &baseDir, sal_False); if (m_activePackages_expanded.getLength() == 0) { - destFolder = tempEntry; +// destFolder = tempEntry; + destFolder = aTemp.GetFileName(); } else { - tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); +// tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); // tweak user|share to macrofied url: - destFolder = makeURL( m_activePackages, tempEntry ); +// destFolder = makeURL( m_activePackages, tempEntry ); + tempEntry = aTemp.GetURL(); + tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1); + destFolder = makeURL( m_activePackages, tempEntry); } destFolder += OUSTR("_"); diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx old mode 100644 new mode 100755 index 9629855aaf11..44e11efdef0e --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -91,7 +91,10 @@ css::uno::Reference BackendDb::getDocument() ::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item); if (err == ::osl::File::E_None) { - m_doc = xDocBuilder->parseURI(m_urlDb); + ::ucbhelper::Content descContent( + m_urlDb, css::uno::Reference()); + Reference xIn = descContent.openStream(); + m_doc = xDocBuilder->parse(xIn); } else if (err == ::osl::File::E_NOENT) { -- cgit From 67245de3e046449e78b98654909dd48f1ebb31bb Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 18 Feb 2011 19:02:00 +0100 Subject: CWS swlayoutrefactoring: construction of RootFrm must be done in two steps; the layout must not be created in the ctor as creating the draw view will need a pLayout set at the ViewShell; worked in old versions because of a side effect that has set pLayout at SwDoc though the SwRootFrm still was not constructed --- sw/source/core/inc/rootfrm.hxx | 1 + sw/source/core/layout/newfrm.cxx | 3 +++ sw/source/core/view/vnew.cxx | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 304659aa2edb..c5e0cefc7383 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -178,6 +178,7 @@ public: SwRootFrm( SwFrmFmt*, ViewShell* ); ~SwRootFrm(); + void Init(SwFrmFmt*, ViewShell* ); ViewShell *GetCurrShell() const { return pCurrShell; } void DeRegisterShell( ViewShell *pSh ); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index e59957d9174d..4fbc700379d7 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -447,7 +447,10 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) : bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True; bCheckSuperfluous = bBrowseWidthValid = sal_False; setRootFrm( this ); +} +void SwRootFrm::Init( SwFrmFmt* pFmt, ViewShell* pSh ) +{ InitCurrShells( this ); IDocumentTimerAccess *pTimerAccess = pFmt->getIDocumentTimerAccess(); diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 1aa1d91b2f94..ef82ed0b81a5 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -141,7 +141,11 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) pLayout = pCurrShell->pLayout; // end of "disable multiple layouts" if( !pLayout ) + { + // switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016 + pLayout->Init( pDoc->GetDfltFrmFmt(), this ); + } } SizeChgNotify(); //swmod 071108 -- cgit From 192c891e562da3575d94103cf839997918b1b1a5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 20 Feb 2011 23:09:20 +0100 Subject: debuglevels: #i116845# replace the 'CoreDump' output channel for assertions with 'Debug' The former was implemented on Windows only, and then effectively the same as the 'Debugger' option. So, it was removed in favour of a new 'Abort' channel which, well, aborts when an assertion fires. --- tools/inc/tools/debug.hxx | 8 +++++++- tools/source/debug/debug.cxx | 20 ++++++++++++++------ vcl/source/app/dbggui.cxx | 20 +++++++++++++++----- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx index 4d640642c69d..63a94555a8c1 100644 --- a/tools/inc/tools/debug.hxx +++ b/tools/inc/tools/debug.hxx @@ -80,7 +80,7 @@ typedef void (*DbgTestSolarMutexProc)(); #define DBG_OUT_MSGBOX 4 #define DBG_OUT_TESTTOOL 5 #define DBG_OUT_DEBUGGER 6 -#define DBG_OUT_COREDUMP 7 +#define DBG_OUT_ABORT 7 #define DBG_OUT_COUNT 8 @@ -137,6 +137,7 @@ struct DbgDataType #define DBG_FUNC_GETPRINTMSGBOX 17 #define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967 #define DBG_FUNC_UPDATEOSLHOOK 19 +#define DBG_FUNC_SET_ABORT 20 TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL ); @@ -180,6 +181,11 @@ inline void DbgSetPrintTestTool( DbgPrintLine pProc ) DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc ); } +inline void DbgSetAbort( DbgPrintLine pProc ) +{ + DbgFunc( DBG_FUNC_SET_ABORT, (void*)(long)pProc ); +} + typedef sal_uInt16 DbgChannelId; /** registers a user-defined channel for emitting the diagnostic messages diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index fd6f499b4036..acdb7a291026 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -152,6 +152,7 @@ struct DebugData DbgPrintLine pDbgPrintMsgBox; DbgPrintLine pDbgPrintWindow; DbgPrintLine pDbgPrintTestTool; + DbgPrintLine pDbgAbort; ::std::vector< DbgPrintLine > aDbgPrintUserChannels; PointerList* pProfList; @@ -163,9 +164,10 @@ struct DebugData DebugData() :bInit( sal_False ) - ,pDbgPrintMsgBox( sal_False ) + ,pDbgPrintMsgBox( NULL ) ,pDbgPrintWindow( NULL ) ,pDbgPrintTestTool( NULL ) + ,pDbgAbort( NULL ) ,pProfList( NULL ) ,pXtorList( NULL ) ,pDbgTestSolarMutex( NULL ) @@ -420,7 +422,7 @@ namespace { const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] ); } @@ -475,7 +477,7 @@ namespace { const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; sal_Char aBuf[20]; size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); @@ -1199,6 +1201,10 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) pDebugData->pDbgPrintTestTool = (DbgPrintLine)(long)pParam; break; + case DBG_FUNC_SET_ABORT: + pDebugData->pDbgAbort = (DbgPrintLine)(long)pParam; + break; + case DBG_FUNC_SAVEDATA: { const DbgData* pData = static_cast< const DbgData* >( pParam ); @@ -1706,10 +1712,12 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa nOut = DBG_OUT_DEBUGGER; } - if ( nOut == DBG_OUT_COREDUMP ) + if ( nOut == DBG_OUT_ABORT ) { - if ( !ImplCoreDump() ) - nOut = DBG_OUT_DEBUGGER; + if ( pData->pDbgAbort != NULL ) + pData->pDbgAbort( aBufOut ); + abort(); + nOut = DBG_OUT_DEBUGGER; } if ( nOut == DBG_OUT_DEBUGGER ) diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index a50c8aeec149..6649f19e0030 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -346,8 +346,8 @@ static const sal_Char* pDbgHelpText[] = "Attempt to activate the debugger and produce the message there, in order to " "always obtain the corresponding stack trace in the debugger.\n", "\n", -"CoreDump\n", -"Causes a crash\n", +"Abort\n", +"Aborts the application\n", "\n", "\n", "Reroute osl messages - Checkbox\n", @@ -1083,7 +1083,7 @@ DbgDialog::DbgDialog() : maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maTraceBox ); ImplSelectChannel( maTraceBox, pData->nTraceOut, 0 ); maTraceBox.Show(); @@ -1106,7 +1106,7 @@ DbgDialog::DbgDialog() : maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maWarningBox ); ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 ); maWarningBox.Show(); @@ -1135,7 +1135,7 @@ DbgDialog::DbgDialog() : maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maErrorBox ); ImplSelectChannel( maErrorBox, pData->nErrorOut, mnErrorOff ); maErrorBox.Show(); @@ -1962,6 +1962,14 @@ void DbgPrintWindow( const char* pLine ) bIn = sal_False; } +// ----------------------------------------------------------------------- + +void DbgAbort( char const * i_message ) +{ + ::rtl::OUString const message( i_message, strlen( i_message ), osl_getThreadTextEncoding() ); + Application::Abort( message ); +} + // ======================================================================= void ImplDbgTestSolarMutex() @@ -1977,6 +1985,7 @@ void DbgGUIInit() DbgSetPrintMsgBox( DbgPrintMsgBox ); DbgSetPrintWindow( DbgPrintWindow ); DbgSetTestSolarMutex( ImplDbgTestSolarMutex ); + DbgSetAbort( DbgAbort ); } // ----------------------------------------------------------------------- @@ -1986,6 +1995,7 @@ void DbgGUIDeInit() DbgSetPrintMsgBox( NULL ); DbgSetPrintWindow( NULL ); DbgSetTestSolarMutex( NULL ); + DbgSetAbort( NULL ); DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin; if ( pDbgWindow ) -- cgit From 9bc3b66c176713a11810a922938e77a4caf4c0b3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 20 Feb 2011 23:09:26 +0100 Subject: debuglevels: #i116845# on assertions, don't/call osl_osl_breakDebug depending on an environemnt variable SAL_DIAGNOSE_ABORT. On Unix, osl_breakDebug was previously implemented as exit(0), but never called (since osl_assertFailedLine always returned sal_False). It is now implemented as "abort". On Windows, osl_debugBreak was implemented as DebugBreak, which fits our intention of always aborting on an assertion, given that SAL_DIAGNOSE_ABORT is set. On OS/2 (is this an active port?), osl_debugBreak is implemented as calling "int 3" - which is quite old-fashioned, but should also do what we want. --- sal/osl/os2/diagnose.c | 3 ++- sal/osl/unx/diagnose.c | 14 ++++++++++---- sal/osl/w32/diagnose.c | 50 ++++++++++++++++++++++++++++---------------------- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/sal/osl/os2/diagnose.c b/sal/osl/os2/diagnose.c index b105e0b78c29..b412a65ff090 100644 --- a/sal/osl/os2/diagnose.c +++ b/sal/osl/os2/diagnose.c @@ -124,7 +124,8 @@ sal_Bool SAL_CALL osl_assertFailedLine( const sal_Char* pszFileName, sal_Int32 n fputs(szMessage, stderr); - return sal_True; /* abort */ + char const * env = getenv( "SAL_DIAGNOSE_ABORT" ); + return ( ( env != NULL ) && ( *env != '\0' ) ); } /*----------------------------------------------------------------------------*/ diff --git a/sal/osl/unx/diagnose.c b/sal/osl/unx/diagnose.c index 02967b3ad7f7..5d9a4f31a40e 100644 --- a/sal/osl/unx/diagnose.c +++ b/sal/osl/unx/diagnose.c @@ -218,6 +218,11 @@ sal_Bool SAL_CALL osl_assertFailedLine ( oslDebugMessageFunc f = g_pDebugMessageFunc; char szMessage[1024]; + // after reporting the assertion, abort if told so by SAL_DIAGNOSE_ABORT, but *not* if + // assertions are routed to some external instance + char const * env = getenv( "SAL_DIAGNOSE_ABORT" ); + sal_Bool const doAbort = ( ( env != NULL ) && ( *env != '\0' ) && ( f == NULL ) ); + /* If there's a callback for detailed messages, use it */ if ( g_pDetailedDebugMessageFunc != NULL ) { @@ -227,7 +232,7 @@ sal_Bool SAL_CALL osl_assertFailedLine ( /* if SAL assertions are disabled in general, stop here */ if ( getenv("DISABLE_SAL_DBGBOX") ) - return sal_False; + return doAbort; /* format message into buffer */ if (pszMessage != 0) @@ -252,9 +257,10 @@ sal_Bool SAL_CALL osl_assertFailedLine ( /* output backtrace */ osl_diagnose_backtrace_Impl(f); - /* release lock and leave, w/o calling osl_breakDebug() */ + /* release lock and leave */ pthread_mutex_unlock(&g_mutex); - return sal_False; + + return doAbort; } /************************************************************************/ @@ -262,7 +268,7 @@ sal_Bool SAL_CALL osl_assertFailedLine ( /************************************************************************/ void SAL_CALL osl_breakDebug() { - exit(0); + abort(); } /************************************************************************/ diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c index 9c75e4502743..1feab6ded8da 100755 --- a/sal/osl/w32/diagnose.c +++ b/sal/osl/w32/diagnose.c @@ -93,6 +93,7 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL /* get app name or NULL if unknown (don't call assert) */ LPCSTR lpszAppName = "Error"; sal_Char szMessage[512]; + char const * env = getenv( "SAL_DIAGNOSE_ABORT" ); /* format message into buffer */ szMessage[sizeof(szMessage)-1] = '\0'; /* zero terminate always */ @@ -105,39 +106,44 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL _pPrintDetailedDebugMessage( pszFileName, nLine, pszMessage ); else if ( _pPrintDebugMessage ) _pPrintDebugMessage( szMessage ); - else if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) + else { - TCHAR szBoxMessage[1024]; + if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) + { + TCHAR szBoxMessage[1024]; - /* active popup window for the current thread */ - hWndParent = GetActiveWindow(); - if (hWndParent != NULL) - hWndParent = GetLastActivePopup(hWndParent); + /* active popup window for the current thread */ + hWndParent = GetActiveWindow(); + if (hWndParent != NULL) + hWndParent = GetLastActivePopup(hWndParent); - /* set message box flags */ - nFlags = MB_TASKMODAL | MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND; - if (hWndParent == NULL) - nFlags |= MB_SERVICE_NOTIFICATION; + /* set message box flags */ + nFlags = MB_TASKMODAL | MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND; + if (hWndParent == NULL) + nFlags |= MB_SERVICE_NOTIFICATION; - /* display the assert */ + /* display the assert */ - szBoxMessage[sizeof(szBoxMessage)-1] = 0; - _snprintf(szBoxMessage, sizeof(szBoxMessage)-1, "%s\n( Yes=Abort / No=Ignore / Cancel=Debugger )", - szMessage); + szBoxMessage[sizeof(szBoxMessage)-1] = 0; + _snprintf(szBoxMessage, sizeof(szBoxMessage)-1, "%s\n( Yes=Abort / No=Ignore / Cancel=Debugger )", + szMessage); - nCode = MessageBox(hWndParent, szBoxMessage, "Assertion Failed!", nFlags); + nCode = MessageBox(hWndParent, szBoxMessage, "Assertion Failed!", nFlags); - if (nCode == IDYES) - FatalExit(-1); + if (nCode == IDYES) + FatalExit(-1); - if (nCode == IDNO) - return sal_False; /* ignore */ + if (nCode == IDNO) + return sal_False; /* ignore */ - if (nCode == IDCANCEL) - return sal_True; /* will cause oslDebugBreak */ + if (nCode == IDCANCEL) + return sal_True; /* will cause oslDebugBreak */ + } + return ( ( env != NULL ) && ( *env != '\0' ) ); } + + return sal_False; #endif /* NO_DEBUG_CRT */ - return sal_False; /* not shure, not care */ } sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage) -- cgit From dd23e0428ff23f7217ae4dbc9798fc55d1275b13 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 10:32:07 +0100 Subject: debuglevels: let smoketestoo_native use a dedicated version of dbgsvrc/DBGSV_INIT, instead of using the default which the build env points to - it might direct assertion output to whereever ... --- set_soenv.in | 1 - solenv/config/sdev300.ini | 1 - solenv/inc/installationtest.mk | 25 ++++++++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/set_soenv.in b/set_soenv.in index d10cdfab8da3..d26cee12f012 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -2053,7 +2053,6 @@ if ($platform =~ m/os2/) ToFile( "SWITCHAR", "-", "e"); } ToFile( "SAL_ENABLE_FILE_LOCKING", "1", "e"); -ToFile( "DBGSV_INIT", "$SOLARENV/bin/dbgsv.ini", "e"); # # Writing unset variables you might not need to file. # diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini index 3b096337d5d7..01e651e743b9 100644 --- a/solenv/config/sdev300.ini +++ b/solenv/config/sdev300.ini @@ -200,7 +200,6 @@ finish SOLARSRC %SRC_ROOT% SOURCE_ROOT_DIR $expand(%SOLARSRC%/..) ANT_HOME %COMMON_BUILD_TOOLS%$/apache-ant-1.7.1 - DBGSV_INIT %SOLARENV%/bin/dbgsv.ini WORKDIR %SOLARVERSION%/%INPATH%/workdir OUTDIR %SOLARVERSION%/%INPATH% diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index 23e95be60de5..13f8867df5e8 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -23,6 +23,16 @@ # for a copy of the LGPLv3 License. #***********************************************************************/ +# relevant for non-product builds only, but built unconditionally +DIAGNOSTICS_CONTROL_FILE=$(MISC)/dbgsvrc +DBGSV_INIT:=$(MAKEDIR)/$(DIAGNOSTICS_CONTROL_FILE) +.EXPORT: DBGSV_INIT + +.IF "$(ABORT_ON_ASSERTION)" != "" + SAL_DIAGNOSE_ABORT:=TRUE + .EXPORT: SAL_DIAGNOSE_ABORT +.ENDIF + .IF "$(OS)" == "WNT" my_file = file:/// .ELSE @@ -88,7 +98,7 @@ $(MISC)/$(TARGET)/installation.flag : $(shell \ $(COMMAND_ECHO)echo "$(OOO_EXTRACT_TO)" > $@ .END -cpptest .PHONY : +cpptest .PHONY : $(DIAGNOSTICS_CONTROL_FILE) $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(CPPUNITTESTER) \ @@ -104,7 +114,7 @@ cpptest : $(MISC)/$(TARGET)/installation.flag .END .IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != "" -javatest_% .PHONY : $(JAVATARGET) +javatest_% .PHONY : $(JAVATARGET) $(DIAGNOSTICS_CONTROL_FILE) $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \ @@ -119,7 +129,7 @@ javatest_% .PHONY : $(JAVATARGET) $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag javatest : $(MISC)/$(TARGET)/installation.flag .END -javatest .PHONY : $(JAVATARGET) +javatest .PHONY : $(JAVATARGET) $(DIAGNOSTICS_CONTROL_FILE) $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \ @@ -138,3 +148,12 @@ javatest : $(MISC)/$(TARGET)/installation.flag javatest .PHONY : @echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR' .END + +# relevant for non-product builds only, but built unconditionally +$(DIAGNOSTICS_CONTROL_FILE): + $(COMMAND_ECHO)echo [output] > $@ +.IF "$(ABORT_ON_ASSERTION)" != "" + $(COMMAND_ECHO)echo error=abort >> $@ +.ELSE + $(COMMAND_ECHO)echo error=shell >> $@ +.ENDIF -- cgit From 123c60ed46489e3147d58ab6684c9de1cf0f656d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 10:32:07 +0100 Subject: debuglevels: let smoketestoo_native use a dedicated version of dbgsvrc/DBGSV_INIT, instead of using the default which the build env points to - it might direct assertion output to whereever ... --- smoketestoo_native/makefile.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index 76ea6c2c52ae..aab245371a72 100755 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -29,6 +29,8 @@ TARGET = smoketest ENABLE_EXCEPTIONS = TRUE +ABORT_ON_ASSERTION = TRUE + .INCLUDE: settings.mk CFLAGSCXX += $(CPPUNIT_CFLAGS) -- cgit From 60e454d12b4ed5a697eb040c1468f0c9992c7dd5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 11:15:06 +0100 Subject: debuglevels: removed useless assertions Those assertions were dependent on OSL_DEBUG_LEVEL > 1 (i.e. only existent with "dmake=1"), and then always fired. Which fulfills the definition of "useless", /me thinks. --- cppu/source/typelib/typelib.cxx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index aa0d18589a89..cbd8ee3872d4 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -330,20 +330,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () ) delete pWeakMap; pWeakMap = 0; } -#if OSL_DEBUG_LEVEL > 1 - OSL_ASSERT( nTypeDescriptionCount == 0 ); - OSL_ASSERT( nCompoundTypeDescriptionCount == 0 ); - OSL_ASSERT( nUnionTypeDescriptionCount == 0 ); - OSL_ASSERT( nIndirectTypeDescriptionCount == 0 ); - OSL_ASSERT( nArrayTypeDescriptionCount == 0 ); - OSL_ASSERT( nEnumTypeDescriptionCount == 0 ); - OSL_ASSERT( nInterfaceMethodTypeDescriptionCount == 0 ); - OSL_ASSERT( nInterfaceAttributeTypeDescriptionCount == 0 ); - OSL_ASSERT( nInterfaceTypeDescriptionCount == 0 ); - OSL_ASSERT( nTypeDescriptionReferenceCount == 0 ); - OSL_ASSERT( !pCallbacks || pCallbacks->empty() ); -#endif delete pCallbacks; pCallbacks = 0; -- cgit From fb4f853ff6e53f3537e8e5ff2b488d039d175a16 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 12:45:48 +0100 Subject: debuglevels: removed yet another useless (aka: nearly-always-firing) assertion --- cppu/source/typelib/typelib.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index cbd8ee3872d4..935a64397505 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -330,7 +330,6 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () ) delete pWeakMap; pWeakMap = 0; } - OSL_ASSERT( !pCallbacks || pCallbacks->empty() ); delete pCallbacks; pCallbacks = 0; -- cgit From 962afcec3103cf33b2b7e7ff5a4ef4c35c09d0c9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Feb 2011 13:10:28 +0100 Subject: #i117037# re-introduce the XDialog2 support which got lost with some merge conflict resolving --- toolkit/inc/toolkit/controls/dialogcontrol.hxx | 26 ++++++++-------- toolkit/source/controls/dialogcontrol.cxx | 41 +++++++++++--------------- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index 17b958aeace9..9c0ffa3b78fb 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -30,12 +30,13 @@ #include #include -#include +#include #include #include "toolkit/helper/servicenames.hxx" #include "toolkit/helper/macros.hxx" #include #include +#include #include // ---------------------------------------------------- @@ -64,10 +65,12 @@ public: }; -class UnoDialogControl :public ControlContainerBase, - public ::com::sun::star::awt::XTopWindow, - public ::com::sun::star::awt::XDialog, - public ::com::sun::star::awt::XWindowListener +typedef ::cppu::AggImplInheritanceHelper3 < ControlContainerBase + , ::com::sun::star::awt::XTopWindow + , ::com::sun::star::awt::XDialog2 + , ::com::sun::star::awt::XWindowListener + > UnoDialogControl_Base; +class UnoDialogControl : public UnoDialogControl_Base { private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar; @@ -80,11 +83,6 @@ public: ~UnoDialogControl(); ::rtl::OUString GetComponentServiceName(); - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); } - ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } - void SAL_CALL release() throw() { OWeakAggObject::release(); } - void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); @@ -102,16 +100,16 @@ public: virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException); sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException); void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XControl sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 8f400ff1945c..556acbf5d0d2 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -165,7 +165,7 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro // ============================================================================ UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :ControlContainerBase( i_factory ) + :UnoDialogControl_Base( i_factory ) ,maTopWindowListeners( *this ) ,mbWindowListener(false) { @@ -188,25 +188,6 @@ UnoDialogControl::~UnoDialogControl() return ::rtl::OUString::createFromAscii( "TabPage" ); } -// XInterface -Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XTopWindow*, this ) ); - if ( !aRet.hasValue() ) - aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XDialog*, this ) ); - if ( !aRet.hasValue() ) - aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) ); - return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType )); -} - - //lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( UnoDialogControl) - getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ), - getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ), - getCppuType( ( uno::Reference< awt::XWindowListener>* ) NULL ), - ControlContainerBase::getTypes() -IMPL_XTYPEPROVIDER_END - void UnoDialogControl::dispose() throw(RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -409,18 +390,30 @@ throw (::com::sun::star::uno::RuntimeException) } } -void SAL_CALL UnoDialogControl::windowShown( const ::com::sun::star::lang::EventObject& e ) -throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoDialogControl::windowShown( const EventObject& e ) throw (RuntimeException) { (void)e; } -void SAL_CALL UnoDialogControl::windowHidden( const ::com::sun::star::lang::EventObject& e ) -throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoDialogControl::windowHidden( const EventObject& e ) throw (RuntimeException) { (void)e; } +void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->endDialog( i_result ); +} + +void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->setHelpId( i_id ); +} + void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); -- cgit From 1e65d22b7ce7d3f65f730dbd788fc4423b707a5e Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 21 Feb 2011 15:37:12 +0100 Subject: jl164 #i109096# folders in configuration and help registry folders are now created with unotools::TempFile. --- desktop/source/deployment/manager/dp_manager.cxx | 2 +- desktop/source/deployment/registry/dp_backend.cxx | 59 ++++++++++++----------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index ad01a9dbb79e..0339cf599b34 100755 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -647,7 +647,7 @@ OUString PackageManagerImpl::insertToActivationLayer( // OUSTR("::osl::File::createTempFile() failed!"), 0 ); //::utl::TempFile::SetTempNameBaseDirectory(m_activePackages_expanded); String baseDir(m_activePackages_expanded); - ::utl::TempFile aTemp(OUSTR("jl123"), NULL, &baseDir, sal_False); + ::utl::TempFile aTemp(&baseDir, sal_False); if (m_activePackages_expanded.getLength() == 0) { // destFolder = tempEntry; destFolder = aTemp.GetFileName(); diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 266d4406cfde..32413f3d11ba 100755 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -45,6 +45,7 @@ #include "com/sun/star/beans/StringPair.hpp" #include "com/sun/star/sdbc/XResultSet.hpp" #include "com/sun/star/sdbc/XRow.hpp" +#include "unotools/tempfile.hxx" using namespace ::dp_misc; @@ -225,42 +226,43 @@ OUString PackageRegistryBackend::createFolder( OUString const & relUrl, Reference const & xCmdEnv) { - OUString sDataFolder = makeURL(getCachePath(), relUrl); + const OUString sDataFolder = makeURL(getCachePath(), relUrl); //make sure the folder exist ucbhelper::Content dataContent; ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv); - OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder); - - OUString tempEntry; - if (::osl::File::createTempFile( - &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None) - throw RuntimeException( - OUSTR("::osl::File::createTempFile() failed!"), 0 ); - tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); - OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_"); - ::ucbhelper::Content destFolderContent; - dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv ); - - return destFolder; + const OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder); + const String baseDir(sDataFolder); + const ::utl::TempFile aTemp(&baseDir, sal_True); + const OUString url = aTemp.GetURL(); + return sDataFolder + url.copy(url.lastIndexOf('/')); } +//folderURL can have the extension .tmp or .tmp_ +//Before OOo 3.4 the created a tmp file with osl_createTempFile and +//then created a Folder with a same name and a trailing '_' +//If the folderURL has no '_' then there is no corresponding tmp file. void PackageRegistryBackend::deleteTempFolder( OUString const & folderUrl) { - OSL_ASSERT(folderUrl.getLength() - && folderUrl[folderUrl.getLength() - 1] == '_'); - if (folderUrl.getLength() - && folderUrl[folderUrl.getLength() - 1] == '_') + if (folderUrl.getLength()) { - const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1); erase_path( folderUrl, Reference(), false /* no throw: ignore errors */ ); - erase_path( tempFile, Reference(), - false /* no throw: ignore errors */ ); + + if (folderUrl[folderUrl.getLength() - 1] == '_') + { + const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1); + erase_path( tempFile, Reference(), + false /* no throw: ignore errors */ ); + } } } +//usedFolders can contain folder names which have the extension .tmp or .tmp_ +//Before OOo 3.4 we created a tmp file with osl_createTempFile and +//then created a Folder with a same name and a trailing '_' +//If the folderURL has no '_' then there is no corresponding tmp file. void PackageRegistryBackend::deleteUnusedFolders( OUString const & relUrl, ::std::list< OUString> const & usedFolders) @@ -273,12 +275,14 @@ void PackageRegistryBackend::deleteUnusedFolders( Reference xResultSet( tempFolder.createCursor( Sequence( &StrTitle::get(), 1 ), - ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); + ::ucbhelper::INCLUDE_FOLDERS_ONLY ) ); // get all temp directories: ::std::vector tempEntries; char tmp[] = ".tmp"; + //Check for ".tmp_" can be removed after OOo 4.0 + char tmp_[] = ".tmp_"; while (xResultSet->next()) { OUString title( @@ -286,21 +290,18 @@ void PackageRegistryBackend::deleteUnusedFolders( xResultSet, UNO_QUERY_THROW )->getString( 1 /* Title */ ) ); - if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1)) + if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1) + || title.endsWithAsciiL(tmp_, sizeof(tmp_) - 1)) tempEntries.push_back( makeURLAppendSysPathSegment(sDataFolder, title)); } for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos ) { - //usedFolders contains the urls to the folders which have - //a trailing underscore - const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_"); - - if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) == + if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) == usedFolders.end()) { - deleteTempFolder(tempFolderName); + deleteTempFolder(tempEntries[pos]); } } } -- cgit From 1653b95634d31f76a9511f91970d14dfef559acb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 23 Feb 2011 21:24:55 +0100 Subject: debuglevels: #i116845# temporarily disable the 'OnTitleChanged notified for an unknown document' assertion --- ucb/source/ucp/tdoc/tdoc_docmgr.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 1e24940e5ecd..c78ce26dd39a 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -427,8 +427,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( ++it; } - OSL_ENSURE( it != m_aDocs.end(), - "TitleChanged event notified for unknown document!" ); +// OSL_ENSURE( it != m_aDocs.end(), +// "TitleChanged event notified for unknown document!" ); + // TODO: re-enable this assertion. It has been disabled for now, since it breaks the assertion-free smoketest, + // and the fix is more difficult than what can be done now. + // The problem is that at the moment, when you close a SFX-based document via API, it will first + // fire the notifyClosing event, which will make the OfficeDocumentsManager remove the doc from its list. + // Then, it will notify an OnTitleChanged, then an OnUnload. Documents closed via call the notifyClosing + // *after* OnUnload and all other On* events. + // In agreement with MBA, the implementation for SfxBaseModel::Close should be changed to also send notifyClosing + // as last event. When this happens, the assertion here must be enabled, again. + // There is no bug for this, yet - IZ is currently down due to the Kenai migration. + // 2011-02-23 / frank.schoenheit@sun.com } } } -- cgit From 5ef36f28c6c5eaf36c7be814b975d4c6ce9224ea Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 10:10:38 +0100 Subject: debuglevels: do not iterate over a directory whose 'open' returned a failure - prevents later assertions from the OSL implementation --- desktop/source/app/app.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index a2f602082fe4..9e39ba126b12 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -633,7 +633,9 @@ throw() else if( TypeToCopy == +1 ) // Folder { osl::Directory aDir( srcUnqPath ); - aDir.open(); + err = aDir.open(); + if ( err != osl::FileBase::E_None ) + return err; err = osl::Directory::create( dstUnqPath ); osl::FileBase::RC next = err; -- cgit From df2a51edb0119d25465117c7a21baa75c34f99cb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 23 Feb 2011 09:43:22 +0100 Subject: dba34d: fixed attemptListenerCreation (transplanted from ee617dd09545040933f21b8333864f70bd8f8d52) --- svx/source/form/fmundo.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 8a72cb768d5f..ecbfc8afbe1a 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -129,7 +129,7 @@ private: { ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() ); Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW ); - Reference< XPropertySet > const xListenerProps( m_vbaListener, UNO_QUERY_THROW ); + Reference< XPropertySet > const xListenerProps( xScriptListener, UNO_QUERY_THROW ); // SfxObjectShellRef is good here since the model controls the lifetime of the shell SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell(); ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" ); -- cgit From c32a04b6b8c5385413107f8880281abf3fa8309b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 23 Feb 2011 10:46:57 +0100 Subject: debuglevels: fixed index access in StartTestWithDefaultOptions --- smoketestdoc/data/Global.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smoketestdoc/data/Global.xml b/smoketestdoc/data/Global.xml index 53f913234227..05e9eb50bfcd 100755 --- a/smoketestdoc/data/Global.xml +++ b/smoketestdoc/data/Global.xml @@ -658,10 +658,11 @@ Function StartTestWithDefaultOptions component(cStJava) = "Java" component(cStDataBase) = "Base" component(cStExtension) = "Extensions" - dim action(2) as string + dim action(3) as string action(cDocNew) = "new" action(cDocSaveOpen8) = "V8.0" action(cDocSaveOpenXML) = "XML" + action(cDocClose) = "close" dim baseAction(5) as string baseAction(cDBService) = "services" baseAction(cDBOpen) = "open" -- cgit From a3cef22c9f2a47486cd1c3df2250b72efa15cd87 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Wed, 23 Feb 2011 11:51:24 +0100 Subject: chart51: #i112773# ensure correct position for equation --- chart2/source/view/charttypes/VSeriesPlotter.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index c37842e19888..a45c97e8513e 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1151,9 +1151,19 @@ void VSeriesPlotter::createRegressionCurveEquationShapes( if( xTextShape.is()) { ShapeFactory::setShapeName( xTextShape, rEquationCID ); - xTextShape->setPosition( - RelativePositionHelper::getUpperLeftCornerOfAnchoredObject( - aScreenPosition2D, xTextShape->getSize(), aRelativePosition.Anchor )); + awt::Size aSize( xTextShape->getSize() ); + awt::Point aPos( RelativePositionHelper::getUpperLeftCornerOfAnchoredObject( + aScreenPosition2D, aSize, aRelativePosition.Anchor ) ); + //ensure that the equation is fully placed within the page (if possible) + if( (aPos.X + aSize.Width) > m_aPageReferenceSize.Width ) + aPos.X = m_aPageReferenceSize.Width - aSize.Width; + if( aPos.X < 0 ) + aPos.X = 0; + if( (aPos.Y + aSize.Height) > m_aPageReferenceSize.Height ) + aPos.Y = m_aPageReferenceSize.Height - aSize.Height; + if( aPos.Y < 0 ) + aPos.Y = 0; + xTextShape->setPosition(aPos); } } } -- cgit From 64c6484120861729e56ed9259084cde5ad6dd7c4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 23 Feb 2011 21:05:20 +0100 Subject: debuglevels: removed unreachable code (unxsol* WaE) --- tools/source/debug/debug.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index acdb7a291026..b15c3fe3604f 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -1717,7 +1717,6 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa if ( pData->pDbgAbort != NULL ) pData->pDbgAbort( aBufOut ); abort(); - nOut = DBG_OUT_DEBUGGER; } if ( nOut == DBG_OUT_DEBUGGER ) -- cgit From 134976990b5733b691883020f1ed98329f9b4921 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 10:20:11 +0100 Subject: debuglevels: #i116860# add annotation.src, prevents assertions 'bout missing resources --- sw/AllLangResTarget_sw.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index d59ddd700a92..271e7577e6c7 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -107,6 +107,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/dialog/wordcountdialog.src \ sw/source/ui/dochdl/dochdl.src \ sw/source/ui/dochdl/selglos.src \ + sw/source/ui/docvw/annotation.src \ sw/source/ui/docvw/access.src \ sw/source/ui/docvw/docvw.src \ sw/source/ui/envelp/envelp.src \ -- cgit From 7eb98986f55c1eda30442a2fae60bc422f47861d Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 10:37:10 +0100 Subject: jl164 #i109096# java help indexer service did not work with long file paths --- xmlhelp/source/com/sun/star/help/HelpIndexer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java index bd09982daa3e..abb866804b43 100644 --- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java +++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java @@ -40,6 +40,14 @@ import java.io.IOException; import java.util.Date; import java.util.zip.ZipOutputStream; +/** + When this tool is used with long path names on Windows, that is paths which start + with \\?\, then the caller must make sure that the path is unique. This is achieved + by removing '.' and '..' from the path. Paths which are created by + osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because + lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene + module. + */ public class HelpIndexer extends WeakBase implements XServiceInfo, XInvocation { -- cgit From b2a5985ba263eb1c2ce567c5ecadfdfbe8f2c9d0 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 10:37:10 +0100 Subject: jl164 #i109096# java help indexer service did not work with long file paths --- l10ntools/source/help/HelpIndexerTool.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index a39b5399e38d..c20d9f108ced 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -45,6 +45,15 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; + +/** + When this tool is used with long path names on Windows, that is paths which start + with \\?\, then the caller must make sure that the path is unique. This is achieved + by removing '.' and '..' from the path. Paths which are created by + osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because + lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene + module. + */ public class HelpIndexerTool { public HelpIndexerTool() -- cgit From 61fa967bf3a8ab86f66d12ce0eca1c23a429420f Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 10:37:10 +0100 Subject: jl164 #i109096# java help indexer service did not work with long file paths --- lucene/long_path.patch | 37 +++++++++++++++++++++++++++++++++++++ lucene/makefile.mk | 7 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 lucene/long_path.patch diff --git a/lucene/long_path.patch b/lucene/long_path.patch new file mode 100644 index 000000000000..d3ab8e3ddb91 --- /dev/null +++ b/lucene/long_path.patch @@ -0,0 +1,37 @@ +--- misc/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java 2008-05-01 22:27:58.000000000 +0200 ++++ misc/build/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java 2011-02-23 16:36:26.249515000 +0100 +@@ -165,7 +165,15 @@ + public static FSDirectory getDirectory(File file, LockFactory lockFactory) + throws IOException + { +- file = new File(file.getCanonicalPath()); ++ String path = file.getPath(); ++ //File.getCanonicalPath fails on Windows with long path names ++ //Tested with Java SE 6u23 ++ //Long path names created by osl_getSystemPathFromFileURL are already ++ //unique because its implementation replaces the occurrences of .. and . ++ //That is using the com.sun.star.help.HelpIndexer service from c++ is ++ //relatively safe. ++ if (!path.startsWith("\\\\?\\")) ++ file = new File(file.getCanonicalPath()); + + if (file.exists() && !file.isDirectory()) + throw new IOException(file + " not a directory"); +@@ -455,7 +463,16 @@ + public String getLockID() { + String dirName; // name to be hashed + try { +- dirName = directory.getCanonicalPath(); ++ //File.getCanonicalPath fails on Windows with long path names ++ //Tested with Java SE 6u23 ++ //Long path names created by osl_getSystemPathFromFileURL are already ++ //unique because its implementation replaces the occurrences of .. and . ++ //That is using the com.sun.star.help.HelpIndexer service from c++ is ++ //relatively safe. ++ if (!directory.getPath().startsWith("\\\\?\\")) ++ dirName = directory.getCanonicalPath(); ++ else ++ dirName = directory.getPath(); + } catch (IOException e) { + throw new RuntimeException(e.toString(), e); + } diff --git a/lucene/makefile.mk b/lucene/makefile.mk index 3ce8f058c942..98fab3f9a363 100644 --- a/lucene/makefile.mk +++ b/lucene/makefile.mk @@ -50,7 +50,12 @@ LUCENE_ANALYZERS_JAR=lucene-analyzers-$(LUCENE_MAJOR).$(LUCENE_MINOR).jar TARFILE_NAME=$(LUCENE_NAME) TARFILE_MD5=48d8169acc35f97e05d8dcdfd45be7f2 -PATCH_FILES=lucene.patch +PATCH_FILES=lucene.patch + +.IF "$(OS)" == "WNT" +PATCH_FILES+= long_path.patch +.ENDIF + BUILD_DIR=. BUILD_ACTION= ${ANT} -buildfile .$/contrib$/analyzers$/build.xml -- cgit From 9d71aa84b44924c592085909bf0f2c38de0a2df4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 12:31:22 +0100 Subject: debuglevels: reintroduced lost row headers in first status table --- smoketestdoc/data/Global.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/smoketestdoc/data/Global.xml b/smoketestdoc/data/Global.xml index 05e9eb50bfcd..99c7bf1fe9af 100755 --- a/smoketestdoc/data/Global.xml +++ b/smoketestdoc/data/Global.xml @@ -250,19 +250,20 @@ Sub CreateStatusTable xCursor.GoRight (1, False) table = aDoc.createInstance("com.sun.star.text.TextTable") - table.initialize(6,9) + table.initialize(5,9) table.Name = "StTab1" table.BackColor = cCoGrey xText.insertTextContent(xCursor, table, FALSE) - tableCursor = table.createCursorByCellName(table.CellNames(0)) - tableCursor.gotoStart(FALSE) - tableCursor.goRight(1,FALSE) - for i% = 0 to 7 tableCell = table.getCellByPosition( i% + 1, 0 ) tableCell.String = tableHeaders( i% ) next i% + + for i% = LBound( tableRows ) to UBound( tableRows ) + tableCell = table.getCellByPosition( 0, i% + 1 ) + tableCell.String=tableRows(i%) + next i% end Sub Sub CreateStatusTable2 @@ -335,7 +336,7 @@ Sub CreateDocState table = aDoc.TextTables.GetByIndex (1) for j% = 0 to 7 - for i% = 0 to 4 + for i% = 0 to 3 sRangeName = GetRangeName(j%, i%+1) tableCursor = table.createCursorByCellName(sRangeName) -- cgit From 322ffc5c4534e935c86a1814ee55268e7a9a5c4b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 13:26:56 +0100 Subject: debuglevels: fixed file permissions --- smoketestdoc/data/Events.xml | 0 smoketestdoc/data/Global.xml | 0 smoketestdoc/data/OptionsDlg.xml | 0 smoketestdoc/data/Test_10er.xml | 0 smoketestdoc/data/Test_DB.xml | 0 smoketestdoc/data/Test_Ext.xml | 0 smoketestdoc/data/content.xml | 0 smoketestdoc/data/dialog-lb.xml | 0 smoketestdoc/data/dialog-lc.xml | 0 smoketestdoc/data/makefile.mk | 0 smoketestdoc/data/manifest.xml | 0 smoketestdoc/data/meta.xml | 0 smoketestdoc/data/script-lb.xml | 0 smoketestdoc/data/script-lc.xml | 0 smoketestdoc/data/settings.xml | 0 smoketestdoc/data/styles.xml | 0 16 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 smoketestdoc/data/Events.xml mode change 100755 => 100644 smoketestdoc/data/Global.xml mode change 100755 => 100644 smoketestdoc/data/OptionsDlg.xml mode change 100755 => 100644 smoketestdoc/data/Test_10er.xml mode change 100755 => 100644 smoketestdoc/data/Test_DB.xml mode change 100755 => 100644 smoketestdoc/data/Test_Ext.xml mode change 100755 => 100644 smoketestdoc/data/content.xml mode change 100755 => 100644 smoketestdoc/data/dialog-lb.xml mode change 100755 => 100644 smoketestdoc/data/dialog-lc.xml mode change 100755 => 100644 smoketestdoc/data/makefile.mk mode change 100755 => 100644 smoketestdoc/data/manifest.xml mode change 100755 => 100644 smoketestdoc/data/meta.xml mode change 100755 => 100644 smoketestdoc/data/script-lb.xml mode change 100755 => 100644 smoketestdoc/data/script-lc.xml mode change 100755 => 100644 smoketestdoc/data/settings.xml mode change 100755 => 100644 smoketestdoc/data/styles.xml diff --git a/smoketestdoc/data/Events.xml b/smoketestdoc/data/Events.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/Global.xml b/smoketestdoc/data/Global.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/OptionsDlg.xml b/smoketestdoc/data/OptionsDlg.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/Test_10er.xml b/smoketestdoc/data/Test_10er.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/Test_DB.xml b/smoketestdoc/data/Test_DB.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/Test_Ext.xml b/smoketestdoc/data/Test_Ext.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/content.xml b/smoketestdoc/data/content.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/dialog-lb.xml b/smoketestdoc/data/dialog-lb.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/dialog-lc.xml b/smoketestdoc/data/dialog-lc.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/makefile.mk b/smoketestdoc/data/makefile.mk old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/manifest.xml b/smoketestdoc/data/manifest.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/meta.xml b/smoketestdoc/data/meta.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/script-lb.xml b/smoketestdoc/data/script-lb.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/script-lc.xml b/smoketestdoc/data/script-lc.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/settings.xml b/smoketestdoc/data/settings.xml old mode 100755 new mode 100644 diff --git a/smoketestdoc/data/styles.xml b/smoketestdoc/data/styles.xml old mode 100755 new mode 100644 -- cgit From 88eda2548e9b4d7a7a90e2f128f17d585250278b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 13:46:59 +0100 Subject: debuglevels: let DIAGNOSTICS_CONTROL_FILE depend on , to make it unique when multiple tests are running in parallel --- solenv/inc/installationtest.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index 13f8867df5e8..f32400a593ec 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -24,7 +24,7 @@ #***********************************************************************/ # relevant for non-product builds only, but built unconditionally -DIAGNOSTICS_CONTROL_FILE=$(MISC)/dbgsvrc +DIAGNOSTICS_CONTROL_FILE=$(MISC)/$(TARGET)/dbgsvrc DBGSV_INIT:=$(MAKEDIR)/$(DIAGNOSTICS_CONTROL_FILE) .EXPORT: DBGSV_INIT @@ -151,6 +151,7 @@ javatest .PHONY : # relevant for non-product builds only, but built unconditionally $(DIAGNOSTICS_CONTROL_FILE): + $(COMMAND_ECHO)$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)echo [output] > $@ .IF "$(ABORT_ON_ASSERTION)" != "" $(COMMAND_ECHO)echo error=abort >> $@ -- cgit From fd2597bbeb3f9ef2a803615ff4df1aea10242283 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 15:28:48 +0100 Subject: jl164 #i109096# libxml2 fails when using long paths on windows --- desktop/source/deployment/manager/dp_manager.cxx | 25 ++++-------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 0339cf599b34..89ab4d0b7199 100755 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -637,29 +637,12 @@ OUString PackageManagerImpl::insertToActivationLayer( ::ucbhelper::Content sourceContent(sourceContent_); Reference xCmdEnv( sourceContent.getCommandEnvironment() ); - OUString destFolder; - OUString tempEntry; - // if (::osl::File::createTempFile( - // m_activePackages_expanded.getLength() == 0 - // ? 0 : &m_activePackages_expanded, - // 0, &tempEntry ) != ::osl::File::E_None) - // throw RuntimeException( - // OUSTR("::osl::File::createTempFile() failed!"), 0 ); - //::utl::TempFile::SetTempNameBaseDirectory(m_activePackages_expanded); + String baseDir(m_activePackages_expanded); ::utl::TempFile aTemp(&baseDir, sal_False); - if (m_activePackages_expanded.getLength() == 0) { -// destFolder = tempEntry; - destFolder = aTemp.GetFileName(); - } - else { -// tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 ); - // tweak user|share to macrofied url: -// destFolder = makeURL( m_activePackages, tempEntry ); - tempEntry = aTemp.GetURL(); - tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1); - destFolder = makeURL( m_activePackages, tempEntry); - } + OUString tempEntry = aTemp.GetURL(); + tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1); + OUString destFolder = makeURL( m_activePackages, tempEntry); destFolder += OUSTR("_"); // prepare activation folder: -- cgit From 471f8022c9c800a1428bdcae110fe4152db351b1 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 15:28:48 +0100 Subject: jl164 #i109096# libxml2 fails when using long paths on windows --- libxml2/libxml2-long-path.patch | 34 ++++++++++++++++++++++++++++++++++ libxml2/makefile.mk | 3 +++ 2 files changed, 37 insertions(+) create mode 100644 libxml2/libxml2-long-path.patch mode change 100644 => 100755 libxml2/makefile.mk diff --git a/libxml2/libxml2-long-path.patch b/libxml2/libxml2-long-path.patch new file mode 100644 index 000000000000..bd888d99e183 --- /dev/null +++ b/libxml2/libxml2-long-path.patch @@ -0,0 +1,34 @@ +--- misc/libxml2-2.7.6/uri.c 2009-10-02 17:28:55.000000000 +0200 ++++ misc/build/libxml2-2.7.6/uri.c 2011-02-24 13:47:19.349299000 +0100 +@@ -2479,7 +2479,16 @@ + if (path == NULL) + return(NULL); + +- /* sanitize filename starting with // so it can be used as URI */ ++#if defined(_WIN32) ++ //We must not change the backslashes to slashes if the the path starts with ++ // \\?\ ++ //Those pathes can be up to 32k characters long. ++ len = xmlStrlen(path); ++ if ((len > 3) && (path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && (path[3] == '\\') ) ++ return xmlStrdup((const xmlChar *) path); ++#endif ++ ++ /* sanitize filename starting with // so it can be used as URI */ + if ((path[0] == '/') && (path[1] == '/') && (path[2] != '/')) + path++; + +--- misc/libxml2-2.7.6/xmlIO.c 2009-09-24 17:32:00.000000000 +0200 ++++ misc/build/libxml2-2.7.6/xmlIO.c 2011-02-24 13:47:26.163762000 +0100 +@@ -772,6 +772,11 @@ + + #ifdef HAVE_STAT + #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) ++ //On Windows stat and wstat do not work with long pathname, ++ //which start with '\\?\' ++ if ((xmlStrlen(path) > 3) && (path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && (path[3] == '\\') ) ++ return 1; ++ + if (xmlWrapStat(path, &stat_buffer) == -1) + return 0; + #else diff --git a/libxml2/makefile.mk b/libxml2/makefile.mk old mode 100644 new mode 100755 index 20a22e46fe0f..6fd231f72470 --- a/libxml2/makefile.mk +++ b/libxml2/makefile.mk @@ -54,6 +54,9 @@ PATCH_FILES=libxml2-configure.patch \ libxml2-xpath.patch \ libxml2-global-symbols.patch \ +.IF "$(OS)" == "WNT" +PATCH_FILES+= libxml2-long-path.patch +.ENDIF # This is only for UNX environment now -- cgit From ef0e02dd736111d3641c813ccbda5021e38fd14b Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Thu, 24 Feb 2011 16:29:02 +0100 Subject: chart51: #i116037# backout --- sfx2/inc/sfx2/childwin.hxx | 1 - sfx2/source/appl/childwin.cxx | 3 +++ sfx2/source/appl/workwin.cxx | 27 ++++----------------------- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx index 6df820a08b2c..fd1eb65d54df 100644 --- a/sfx2/inc/sfx2/childwin.hxx +++ b/sfx2/inc/sfx2/childwin.hxx @@ -60,7 +60,6 @@ class SfxChildWinContextArr_Impl; #define SFX_CHILDWIN_CANTGETFOCUS 0x20 // ChildWindow kann keinen Focus bekommen #define SFX_CHILDWIN_ALWAYSAVAILABLE 0x40 // ChildWindow is never disabled #define SFX_CHILDWIN_NEVERHIDE 0x80 // ChildWindow is can always made visible/is visible -#define SFX_CHILDWIN_NEVERHIDEACTIVEOLE 0x0100 // ChildWindow is visible with active inplace client #define CHILDWIN_NOPOS USHRT_MAX // Konfiguration eines ChildWindows diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 40726b96d77b..b8e8a92da1b8 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -467,9 +467,12 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin if ( nNextPos != STRING_NOTFOUND ) { // es gibt noch Extra-Information + rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1, nNextPos - nPos - 1 ).ToInt32(); aWinData.Erase( nPos, nNextPos-nPos+1 ); rInfo.aExtraString = aWinData; } + else + rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1 ).ToInt32(); } } } diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index b50192e9281c..f9a388deee5c 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -822,19 +822,7 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) if ( pF && pF->GetViewShell() ) pClient = pF->GetViewShell()->GetIPClient(); - bool bForceArrange( false ); - for ( USHORT n = 0; n < pChildWins->Count(); ++n ) - { - SfxChildWin_Impl* pCW = (*pChildWins)[ n ]; - SfxChildWindow* pChild = pCW->pWin; - if ( pChild && ( pCW->aInfo.nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) && pCW->aInfo.bVisible ) - { - bForceArrange = true; - break; - } - } - - if ( pClient && !bForceArrange ) + if ( pClient ) return; aClientArea = GetTopRect_Impl(); @@ -844,7 +832,7 @@ void SfxFrameWorkWin_Impl::ArrangeChilds_Impl( BOOL bForce ) SvBorder aBorder; if ( nChilds ) { - if ( IsVisible_Impl() || bForceArrange ) + if ( IsVisible_Impl() ) aBorder = Arrange_Impl(); } @@ -1156,13 +1144,6 @@ void SfxWorkWindow::ShowChilds_Impl() bool bInvisible = ( !IsVisible_Impl() || ( !pWorkWin->IsReallyVisible() && !pWorkWin->IsReallyShown() )); - SfxInPlaceClient* pClient = 0; - SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); - if ( pViewFrame && pViewFrame->GetViewShell() ) - { - pClient = pViewFrame->GetViewShell()->GetIPClient(); - } - SfxChild_Impl *pCli = 0; for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos ) { @@ -1192,7 +1173,6 @@ void SfxWorkWindow::ShowChilds_Impl() // visible. sal_uInt16 nFlags = pCW->aInfo.nFlags; bVisible = !bInvisible || ( bInvisible & (( nFlags & SFX_CHILDWIN_NEVERHIDE ) != 0 )); - bVisible = bVisible || ( pClient && ( nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) ); } if ( CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) && bVisible ) @@ -1665,7 +1645,8 @@ void SfxWorkWindow::UpdateChildWindows_Impl() void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) { - pCW->aInfo.bVisible = TRUE; + if ( pCW->aInfo.bVisible != 42 ) + pCW->aInfo.bVisible = TRUE; SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo); if (pChildWin) -- cgit From 8e72893ce940e2083cc03ffcc4ec3e4af3c67d73 Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Thu, 24 Feb 2011 16:29:02 +0100 Subject: chart51: #i116037# backout --- sc/source/ui/app/client.cxx | 10 ---------- sc/source/ui/app/scdll.cxx | 3 ++- sc/source/ui/drawfunc/fusel.cxx | 12 +++++------- sc/source/ui/inc/client.hxx | 1 - sc/source/ui/view/drawview.cxx | 2 +- sc/source/ui/view/tabvwshb.cxx | 9 +-------- 6 files changed, 9 insertions(+), 28 deletions(-) diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index 2ca326c4acf9..b1cb325ceb69 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -254,13 +254,3 @@ void __EXPORT ScClient::MakeVisible() } } -void ScClient::DeactivateObj() -{ - DeactivateObject(); - - ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( GetViewShell() ); - if ( pViewSh ) - { - pViewSh->UpdateInputHandler(); - } -} diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 00c0734b26a6..8051399d06fa 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -287,7 +287,8 @@ void ScDLL::Init() // Child-Windows - ScInputWindowWrapper ::RegisterChildWindow( TRUE, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK|SFX_CHILDWIN_NEVERHIDEACTIVEOLE ); + // Hack: Eingabezeile mit 42 registrieren, damit sie im PlugIn immer sichtbar ist + ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK); ScNavigatorDialogWrapper ::RegisterChildWindowContext( sal::static_int_cast(ScTabViewShell::GetInterfaceId()), pMod); ScSolverDlgWrapper ::RegisterChildWindow(FALSE, pMod); diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index d17726ad3cb3..4a456522003c 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -56,7 +56,6 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "scmod.hxx" -#include "client.hxx" // ----------------------------------------------------------------------- @@ -463,16 +462,15 @@ BOOL __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt) /************************************************************************** * Ggf. OLE-Objekt beruecksichtigen **************************************************************************/ + SfxInPlaceClient* pIPClient = pViewShell->GetIPClient(); - ScClient* pClient = static_cast< ScClient* >( pViewShell->GetIPClient() ); - if ( pClient ) + if (pIPClient) { ScModule* pScMod = SC_MOD(); bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF; - if ( pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - { - pClient->DeactivateObj(); - } + + if ( pIPClient->IsObjectInPlaceActive() && !bUnoRefDialog ) + pIPClient->DeactivateObject(); } USHORT nClicks = rMEvt.GetClicks(); diff --git a/sc/source/ui/inc/client.hxx b/sc/source/ui/inc/client.hxx index c8373e6b0bcd..1b13ee224d77 100644 --- a/sc/source/ui/inc/client.hxx +++ b/sc/source/ui/inc/client.hxx @@ -56,7 +56,6 @@ public: SdrGrafObj* GetGrafEdit() const { return pGrafEdit; } void SetGrafEdit(SdrGrafObj* pNew) { pGrafEdit = pNew; } SdrOle2Obj* GetDrawObj(); - void DeactivateObj(); }; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 2b913d0ffb73..489da0cc4899 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -416,7 +416,7 @@ void ScDrawView::MarkListHasChanged() { // #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen //HMHbDisableHdl = TRUE; - pClient->DeactivateObj(); + pClient->DeactivateObject(); //HMHbDisableHdl = FALSE; // Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 67ab19d6cdce..c6d9b004b9ba 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -76,7 +76,6 @@ #include "chartarr.hxx" #include "drawview.hxx" #include "ChartRangeSelectionListener.hxx" -#include "inputhdl.hxx" using namespace com::sun::star; @@ -180,12 +179,6 @@ BOOL ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) bErrorShown = TRUE; // SfxViewShell::DoVerb zeigt seine Fehlermeldungen selber an - ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl( this ); - if ( pInputHdl ) - { - pInputHdl->NotifyChange( NULL ); - } - // attach listener to selection changes in chart that affect cell // ranges, so those can be highlighted // note: do that after DoVerb, so that the chart controller exists @@ -270,7 +263,7 @@ void ScTabViewShell::DeactivateOle() ScClient* pClient = (ScClient*) GetIPClient(); if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - pClient->DeactivateObj(); + pClient->DeactivateObject(); } void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) -- cgit From 836a9c057b71dfea52524e2387a2cc0a73479660 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 24 Feb 2011 17:12:55 +0100 Subject: jl164 #i109096# HelpLinker does not work with long path on Windows XP because of fopen --- l10ntools/source/help/HelpCompiler.hxx | 7 ++++++ l10ntools/source/help/HelpLinker.cxx | 41 ++++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 7 deletions(-) mode change 100644 => 100755 l10ntools/source/help/HelpLinker.cxx diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index e300fe26f16d..3426f914d2e6 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -102,6 +102,13 @@ namespace fs HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); return std::string(tmp.getStr()); } + wchar_t const * native_file_string_w() const + { + ::rtl::OUString ustrSystemPath; + osl::File::getSystemPathFromFileURL(data, ustrSystemPath); + return ustrSystemPath.getStr(); + } + std::string native_directory_string() const { return native_file_string(); } std::string toUTF8() const { diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx old mode 100644 new mode 100755 index 4e3a4cedbe6f..2c7fa51657e8 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -118,7 +118,13 @@ void IndexerPreProcessor::processDocument { fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL; std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsCaptionPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsCaptionPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeCaption->content ); @@ -135,8 +141,13 @@ void IndexerPreProcessor::processDocument if( pResNodeContent ) { fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL; - std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsContentPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsContentPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); @@ -226,9 +237,13 @@ public: } } - void dump_DBHelp( const std::string& rFileName ) + void dump_DBHelp( const fs::path& rFileName ) { - FILE* pFile = fopen( rFileName.c_str(), "wb" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile = _wfopen( rFileName.native_file_string_w(), L"wb" ); +#else + FILE* pFile = fopen( rFileName.native_file_string_w().c_str(), "wb" ); +#endif if( pFile == NULL ) return; @@ -430,9 +445,15 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileHelpText_DBHelp = _wfopen + ( helpTextFileName_DBHelp.native_file_string_w(), L"wb" ); +#else + FILE* pFileHelpText_DBHelp = fopen ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" ); - +#endif DB* dbBase(0); #ifndef DBHELP_ONLY fs::path dbBaseFileName(indexDirParentName / (mod + ".db")); @@ -442,8 +463,14 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileDbBase_DBHelp = _wfopen + ( dbBaseFileName_DBHelp.native_file_string_w(), L"wb" ); +#else FILE* pFileDbBase_DBHelp = fopen ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" ); +#endif #ifndef DBHELP_ONLY DB* keyWord(0); @@ -692,7 +719,7 @@ void HelpLinker::link() throw( HelpProcessingException ) if( pFileDbBase_DBHelp != NULL ) fclose( pFileDbBase_DBHelp ); - helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() ); + helpKeyword.dump_DBHelp( keyWordFileName_DBHelp); if( !bExtensionMode ) { -- cgit From 86f4a96d8cfe217ca5547174a8b0dff4e9fe5594 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 17:39:47 +0100 Subject: debuglevels: simplify the build system, by complicating the OOo code ;) Introduce DBGSV_(TRACE/WARNING/ERROR)_OUT, which controls the output channel for tools-level traces/warnings/assertions, when no dbgsv.ini file is found (this is the increased OOo complexity). Use this in installationtest.mk, instead of creating a dedicated dbgsv.ini file. Yet to come: add support for DBGSV_ERROR_OUT to the GNU make build system. Which is the reason why DBGSV_ERROR_OUT was introduced: Currently, running a GNU make based test pops up assertions as message boxes. Before the change here, we would have needed to add dbgsv.ini support to the GNU make build system, which sounds not like a funny a reasonable thing to do. So, instead, we will simply set DBGSV_ERROR_OUT, which is much simpler and less error prone. --- solenv/inc/installationtest.mk | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index f32400a593ec..96b09edebeff 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -24,14 +24,20 @@ #***********************************************************************/ # relevant for non-product builds only, but built unconditionally -DIAGNOSTICS_CONTROL_FILE=$(MISC)/$(TARGET)/dbgsvrc -DBGSV_INIT:=$(MAKEDIR)/$(DIAGNOSTICS_CONTROL_FILE) -.EXPORT: DBGSV_INIT - .IF "$(ABORT_ON_ASSERTION)" != "" - SAL_DIAGNOSE_ABORT:=TRUE + DBGSV_ERROR_OUT=abort + SAL_DIAGNOSE_ABORT=TRUE .EXPORT: SAL_DIAGNOSE_ABORT +.ELSE + DBGSV_ERROR_OUT=shell .ENDIF +.EXPORT: DBGSV_ERROR_OUT + +# don't allow to overwrite DBGSV_ERROR_OUT with an INI file. Otherwise, people +# might be tempted to put an DBGSV_INIT into their .bash_profile which points to a file +# delcaring to ignore all assertions completely ... +DBGSV_INIT= +.EXPORT: DBGSV_INIT .IF "$(OS)" == "WNT" my_file = file:/// @@ -98,7 +104,7 @@ $(MISC)/$(TARGET)/installation.flag : $(shell \ $(COMMAND_ECHO)echo "$(OOO_EXTRACT_TO)" > $@ .END -cpptest .PHONY : $(DIAGNOSTICS_CONTROL_FILE) +cpptest .PHONY : $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(CPPUNITTESTER) \ @@ -114,7 +120,7 @@ cpptest : $(MISC)/$(TARGET)/installation.flag .END .IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != "" -javatest_% .PHONY : $(JAVATARGET) $(DIAGNOSTICS_CONTROL_FILE) +javatest_% .PHONY : $(JAVATARGET) $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \ @@ -129,7 +135,7 @@ javatest_% .PHONY : $(JAVATARGET) $(DIAGNOSTICS_CONTROL_FILE) $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag javatest : $(MISC)/$(TARGET)/installation.flag .END -javatest .PHONY : $(JAVATARGET) $(DIAGNOSTICS_CONTROL_FILE) +javatest .PHONY : $(JAVATARGET) $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \ @@ -148,13 +154,3 @@ javatest : $(MISC)/$(TARGET)/installation.flag javatest .PHONY : @echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR' .END - -# relevant for non-product builds only, but built unconditionally -$(DIAGNOSTICS_CONTROL_FILE): - $(COMMAND_ECHO)$(MKDIRHIER) $(@:d) - $(COMMAND_ECHO)echo [output] > $@ -.IF "$(ABORT_ON_ASSERTION)" != "" - $(COMMAND_ECHO)echo error=abort >> $@ -.ELSE - $(COMMAND_ECHO)echo error=shell >> $@ -.ENDIF -- cgit From 5342a87464932ce062004e3587bd4339a10035db Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Feb 2011 17:39:47 +0100 Subject: debuglevels: simplify the build system, by complicating the OOo code ;) Introduce DBGSV_(TRACE/WARNING/ERROR)_OUT, which controls the output channel for tools-level traces/warnings/assertions, when no dbgsv.ini file is found (this is the increased OOo complexity). Use this in installationtest.mk, instead of creating a dedicated dbgsv.ini file. Yet to come: add support for DBGSV_ERROR_OUT to the GNU make build system. Which is the reason why DBGSV_ERROR_OUT was introduced: Currently, running a GNU make based test pops up assertions as message boxes. Before the change here, we would have needed to add dbgsv.ini support to the GNU make build system, which sounds not like a funny a reasonable thing to do. So, instead, we will simply set DBGSV_ERROR_OUT, which is much simpler and less error prone. --- tools/source/debug/debug.cxx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index b15c3fe3604f..bbde4efe6d9e 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -473,26 +473,30 @@ namespace if ( nValueLen ) *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False; } - void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + void lcl_matchOutputChannel( sal_Char const * i_buffer, sal_uIntPtr* o_value ) { + if ( i_buffer == NULL ) + return; const sal_Char* names[ DBG_OUT_COUNT ] = { "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; - sal_Char aBuf[20]; - size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); - if ( nValueLen ) + for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) { - for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) + if ( strcmp( i_buffer, names[ name ] ) == 0 ) { - if ( strcmp( aBuf, names[ name ] ) == 0 ) - { - *_out_pnValue = name; - return; - } + *o_value = name; + return; } } } + void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + { + sal_Char aBuf[20]; + size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); + if ( nValueLen ) + lcl_matchOutputChannel( aBuf, _out_pnValue ); + } void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag ) { sal_Char aBuf[2]; @@ -813,6 +817,13 @@ static DebugData* GetDebugData() FileClose( pIniFile ); } + else + { + lcl_matchOutputChannel( getenv( "DBGSV_TRACE_OUT" ), &aDebugData.aDbgData.nTraceOut ); + lcl_matchOutputChannel( getenv( "DBGSV_WARNING_OUT" ), &aDebugData.aDbgData.nWarningOut ); + lcl_matchOutputChannel( getenv( "DBGSV_ERROR_OUT" ), &aDebugData.aDbgData.nErrorOut ); + + } getcwd( aCurPath, sizeof( aCurPath ) ); -- cgit From d3dfac3e375a996966d934b31aad9ad77ad4f63b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 10:17:28 +0100 Subject: debuglevels: export DBGSV_ERROR_OUT=shell, so that tools-based assertions in non-product test do not pop up as message boxes (which was a regression introduced with the removal of DBGSV_INIT from the build env) --- solenv/gbuild/CppunitTest.mk | 4 ++++ solenv/gbuild/JunitTest.mk | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index a3b18a4a0bbd..c44ad5947010 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -28,6 +28,10 @@ # CppunitTest class +# in non-product builds, ensure that tools-based assertions do not pop up as message box, but are routed to the shell +DBGSV_ERROR_OUT := shell +export DBGSV_ERROR_OUT + # defined by platform # gb_CppunitTest_TARGETTYPE # gb_CppunitTest_get_filename diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index afc9486fd5a4..5699398241ca 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -30,6 +30,10 @@ gb_JunitTest_JAVACOMMAND := $(JAVAINTERPRETER) $(JAVAIFLAGS) +# in non-product builds, ensure that tools-based assertions do not pop up as message box, but are routed to the shell +DBGSV_ERROR_OUT := shell +export DBGSV_ERROR_OUT + .PHONY : $(call gb_JunitTest_get_clean_target,%) $(call gb_JunitTest_get_clean_target,%) : $(call gb_JavaClassSet_get_clean_target,$(call gb_JunitTest_get_classsetname,%)) $(call gb_Helper_abbreviate_dirs,\ -- cgit From 9f6e95523b0e65f415afd41a5629a4717c062430 Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Fri, 25 Feb 2011 11:01:18 +0100 Subject: chart51: #i116037# backout --- sfx2/source/appl/workwin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index d8acd3c4a970..0692b85afcda 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1646,7 +1646,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, sal_Bool bSetFocus ) { if ( pCW->aInfo.bVisible != 42 ) - pCW->aInfo.bVisible = TRUE; + pCW->aInfo.bVisible = sal_True; SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo); if (pChildWin) -- cgit From fd37636ef1253a46ee1834bdb9588a99fbc96b86 Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Fri, 25 Feb 2011 11:01:18 +0100 Subject: chart51: #i116037# backout --- sc/source/ui/view/drawview.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 6b8ecad11e09..cc63f9b97a62 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -415,9 +415,9 @@ void ScDrawView::MarkListHasChanged() if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) { // #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen - //HMHbDisableHdl = TRUE; + //HMHbDisableHdl = sal_True; pClient->DeactivateObject(); - //HMHbDisableHdl = FALSE; + //HMHbDisableHdl = sal_False; // Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate } -- cgit From e2cb37ffec3734ab7894af5cf52a97639630cedd Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 25 Feb 2011 11:32:55 +0100 Subject: debuglevels: #i117073# added cppunittester --protector support; added unoexceptionprotector and use it in installationtest.mk; reverted changes to smoketest.cxx obsoleted by these additions --- smoketestoo_native/smoketest.cxx | 39 ++------- test/prj/build.lst | 3 +- test/prj/d.lst | 3 + test/source/cpp/makefile.mk | 11 +-- test/source/cpp/unoexceptionprotector/makefile.mk | 56 +++++++++++++ .../unoexceptionprotector.cxx | 95 ++++++++++++++++++++++ 6 files changed, 165 insertions(+), 42 deletions(-) create mode 100644 test/source/cpp/unoexceptionprotector/makefile.mk create mode 100644 test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index 002967823e00..a4e532123456 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -48,7 +48,6 @@ #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/util/URL.hpp" #include -#include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" #include "cppunit/TestAssert.h" #include "cppunit/TestFixture.h" @@ -57,7 +56,6 @@ #include #include "osl/conditn.hxx" #include "osl/diagnose.h" -#include "rtl/strbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "test/gettestargument.hxx" @@ -132,46 +130,23 @@ public: private: CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(runSmoketestDoc); + CPPUNIT_TEST(test); CPPUNIT_TEST_SUITE_END(); - void runSmoketestDoc(); - - ::rtl::OString getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ); + void test(); test::OfficeConnection connection_; }; -::rtl::OString Test::getFailMessage( sal_Char const * i_context, css::uno::Any const & i_exception ) -{ - ::rtl::OStringBuffer failMessage; - failMessage.append( i_context ); - failMessage.append( ": caught a " ); - failMessage.append( ::rtl::OUStringToOString( i_exception.getValueTypeName(), RTL_TEXTENCODING_ASCII_US ) ); - return failMessage.makeStringAndClear(); -} - void Test::setUp() { - try { - connection_.setUp(); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "setting up the connection failed", ::cppu::getCaughtException() ).getStr() ); - } + connection_.setUp(); } void Test::tearDown() { - try { - connection_.tearDown(); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "tearing down the connection failed", ::cppu::getCaughtException() ).getStr() ); - } + connection_.tearDown(); } -void Test::runSmoketestDoc() { - try - { +void Test::test() { rtl::OUString doc; CPPUNIT_ASSERT( test::getTestArgument( @@ -220,10 +195,6 @@ void Test::runSmoketestDoc() { result.condition.wait(); CPPUNIT_ASSERT(result.success); CPPUNIT_ASSERT_EQUAL(rtl::OUString(), result.result); - } - catch( css::uno::Exception const & ) { - CPPUNIT_FAIL( getFailMessage( "executing the smoketest macro", ::cppu::getCaughtException() ).getStr() ); - } } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/test/prj/build.lst b/test/prj/build.lst index 7adea0c0727b..e22199a5c437 100644 --- a/test/prj/build.lst +++ b/test/prj/build.lst @@ -1,5 +1,6 @@ -te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv unoil NULL +te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv stlport unoil NULL te test\inc nmake - all inc NULL te test\source\cpp nmake - all source_cpp inc NULL +te test\source\cpp\unoexceptionprotector nmake - all source_cpp_unoexceptionprotector inc NULL te test\source\java\org\openoffice\test nmake - all source_java NULL te test\source\java\org\openoffice\test\tools nmake - all source_java_tools NULL diff --git a/test/prj/d.lst b/test/prj/d.lst index 54da2062a511..18a599fd5849 100644 --- a/test/prj/d.lst +++ b/test/prj/d.lst @@ -1,9 +1,12 @@ mkdir: %_DEST%\inc%_EXT%\test mkdir: %_DEST%\inc%_EXT%\test\detail ..\%__SRC%\bin\test.dll %_DEST%\bin%_EXT%\test.dll +..\%__SRC%\bin\unoexceptionprotector.dll %_DEST%\bin%_EXT%\unoexceptionprotector.dll ..\%__SRC%\lib\itest.lib %_DEST%\lib%_EXT%\itest.lib ..\%__SRC%\lib\libtest.dylib %_DEST%\lib%_EXT%\libtest.dylib ..\%__SRC%\lib\libtest.so %_DEST%\lib%_EXT%\libtest.so +..\%__SRC%\lib\unoexceptionprotector.dylib %_DEST%\lib%_EXT%\unoexceptionprotector.dylib +..\%__SRC%\lib\unoexceptionprotector.so %_DEST%\lib%_EXT%\unoexceptionprotector.so ..\inc\test\detail\testdllapi.hxx %_DEST%\inc%_EXT%\test\detail\testdllapi.hxx ..\inc\test\gettestargument.hxx %_DEST%\inc%_EXT%\test\gettestargument.hxx ..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx diff --git a/test/source/cpp/makefile.mk b/test/source/cpp/makefile.mk index 4c90dc678959..2073f1500c07 100644 --- a/test/source/cpp/makefile.mk +++ b/test/source/cpp/makefile.mk @@ -33,14 +33,11 @@ VISIBILITY_HIDDEN = TRUE .INCLUDE: settings.mk CDEFS += -DOOO_DLLIMPLEMENTATION_TEST -CFLAGSCXX += $(CPPUNIT_CFLAGS) -#building with stlport, but cppunit was not built with stlport -.IF "$(USE_SYSTEM_STL)"!="YES" -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGSCXX+=-DADAPT_EXT_STL -.ENDIF -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) +.IF "$(USE_SYSTEM_STL)" != "YES" && "$(SYSTEM_CPPUNIT)" == "YES" +CFLAGSCXX += -DADAPT_EXT_STL +.END SLOFILES = \ $(SLO)/getargument.obj \ diff --git a/test/source/cpp/unoexceptionprotector/makefile.mk b/test/source/cpp/unoexceptionprotector/makefile.mk new file mode 100644 index 000000000000..7f62199f46dc --- /dev/null +++ b/test/source/cpp/unoexceptionprotector/makefile.mk @@ -0,0 +1,56 @@ +#************************************************************************* +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +#***********************************************************************/ + +PRJ = ../../.. +PRJNAME = test +TARGET = unoexceptionprotector + +ENABLE_EXCEPTIONS = TRUE +VISIBILITY_HIDDEN = TRUE + +.INCLUDE: settings.mk + +DLLPRE = + +CFLAGSCXX += $(CPPUNIT_CFLAGS) +.IF "$(USE_SYSTEM_STL)" != "YES" && "$(SYSTEM_CPPUNIT)" == "YES" +CFLAGSCXX += -DADAPT_EXT_STL +.END + +SLOFILES = $(SLO)/unoexceptionprotector.obj + +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLOFILES) +SHL1RPATH = NONE +SHL1STDLIBS = \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(CPPUNITLIB) \ + $(SALLIB) +SHL1TARGET = unoexceptionprotector +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) + +.INCLUDE: target.mk diff --git a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx new file mode 100644 index 000000000000..28a0462c3ef1 --- /dev/null +++ b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx @@ -0,0 +1,95 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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. +************************************************************************/ + +#include "sal/config.h" + +#include +#include + +#include "boost/noncopyable.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Exception.hpp" +#include "cppuhelper/exc_hlp.hxx" +#include "osl/thread.h" +#include "rtl/string.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "preextstl.h" +#include "cppunit/Message.h" +#include "cppunit/Protector.h" +#include "postextstl.h" + +namespace { + +namespace css = com::sun::star; + +// Best effort conversion: +std::string convert(rtl::OUString const & s16) { + rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding())); + return std::string( + s8.getStr(), + (s8.getLength() > std::numeric_limits< std::string::size_type >::max() + ? std::numeric_limits< std::string::size_type >::max() + : static_cast< std::string::size_type >(s8.getLength()))); +} + +class Prot: public CppUnit::Protector, private boost::noncopyable { +public: + Prot() {} + + virtual ~Prot() {} + + virtual bool protect( + CppUnit::Functor const & functor, + CppUnit::ProtectorContext const & context); +}; + +bool Prot::protect( + CppUnit::Functor const & functor, CppUnit::ProtectorContext const & context) +{ + try { + return functor(); + } catch (css::uno::Exception & e) { + css::uno::Any a(cppu::getCaughtException()); + reportError( + context, + CppUnit::Message( + convert( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "uncaught exception of type ")) + + a.getValueTypeName()), + convert(e.Message))); + } +} + +} + +extern "C" SAL_DLLPUBLIC_EXPORT CppUnit::Protector * SAL_CALL +unoexceptionprotector() { + return new Prot; +} -- cgit From 58eb3fb273f12dc632536366c9867d5bd952151c Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 25 Feb 2011 11:32:55 +0100 Subject: debuglevels: #i117073# added cppunittester --protector support; added unoexceptionprotector and use it in installationtest.mk; reverted changes to smoketest.cxx obsoleted by these additions --- sal/cppunittester/cast.c | 36 +++++++++++++ sal/cppunittester/cast.h | 46 ++++++++++++++++ sal/cppunittester/cppunittester.cxx | 87 +++++++++++++++++++++++++----- sal/cppunittester/makefile.mk | 2 +- sal/inc/cppunittester/protectorfactory.hxx | 45 ++++++++++++++++ sal/prj/d.lst | 2 + 6 files changed, 204 insertions(+), 14 deletions(-) create mode 100644 sal/cppunittester/cast.c create mode 100644 sal/cppunittester/cast.h create mode 100644 sal/inc/cppunittester/protectorfactory.hxx diff --git a/sal/cppunittester/cast.c b/sal/cppunittester/cast.c new file mode 100644 index 000000000000..38c081a60708 --- /dev/null +++ b/sal/cppunittester/cast.c @@ -0,0 +1,36 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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. +* +************************************************************************/ + +#include "sal/config.h" + +#include "osl/module.h" + +#include "cast.h" + +oslGenericFunction cast(void * fn) { + return (oslGenericFunction) fn; +} diff --git a/sal/cppunittester/cast.h b/sal/cppunittester/cast.h new file mode 100644 index 000000000000..4cfd411da930 --- /dev/null +++ b/sal/cppunittester/cast.h @@ -0,0 +1,46 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 INCLUDED_SAL_CPPUNITTESTER_CAST_H +#define INCLUDED_SAL_CPPUNITTESTER_CAST_H + +#include "sal/config.h" + +#include "osl/module.h" + +#if defined __cplusplus +extern "C" { +#endif + +/* C++ compilers would warn about that cast, so it is done in C: */ +oslGenericFunction cast(void * fn); + +#if defined __cplusplus +} +#endif + +#endif diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index ac99601f5ce5..e3ced7253e47 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -30,6 +30,16 @@ #include #include +#include +#include + +#include "cppunittester/protectorfactory.hxx" +#include "osl/thread.h" +#include "rtl/process.h" +#include "rtl/string.hxx" +#include "rtl/textcvt.h" +#include "rtl/ustring.hxx" +#include "sal/main.h" #include "preextstl.h" #include "cppunit/CompilerOutputter.h" @@ -37,28 +47,79 @@ #include "cppunit/TestResultCollector.h" #include "cppunit/TestRunner.h" #include "cppunit/extensions/TestFactoryRegistry.h" +#include "cppunit/plugin/DynamicLibraryManager.h" +#include "cppunit/plugin/DynamicLibraryManagerException.h" #include "cppunit/plugin/PlugInManager.h" #include "cppunit/portability/Stream.h" #include "postextstl.h" -#include "osl/thread.h" -#include "rtl/process.h" -#include "rtl/string.hxx" -#include "rtl/ustring.hxx" -#include "sal/main.h" + +#include "cast.h" + +namespace { + +void usageFailure() { + std::cerr + << ("Usage: cppunittester (--protector " + " )* ") + << std::endl; + std::exit(EXIT_FAILURE); +} + +std::string getArgument(sal_uInt32 index) { + rtl::OUString s16; + rtl_getAppCommandArg(index, &s16.pData); + rtl::OString s8; + if (!s16.convertToString( + &s8, osl_getThreadTextEncoding(), + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR + | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)) + || (s8.getLength() + > std::numeric_limits< std::string::size_type >::max())) + { + std::cerr + << "Failure converting argument from UTF-16 back to system encoding" + << std::endl; + std::exit(EXIT_FAILURE); + } + return std::string( + s8.getStr(), static_cast< std::string::size_type >(s8.getLength())); +} + +} SAL_IMPLEMENT_MAIN() { - if (rtl_getAppCommandArgCount() != 1) { - std::cerr << "Usage: cppunittester " << std::endl; - return EXIT_FAILURE; + CppUnit::TestResult result; + sal_uInt32 index = 0; + for (; index < rtl_getAppCommandArgCount(); index += 3) { + std::string arg(getArgument(index)); + if (arg.compare("--protector") != 0) { + break; + } + if (rtl_getAppCommandArgCount() - index < 3) { + usageFailure(); + } + try { + result.pushProtector( + (*reinterpret_cast< cppunittester::ProtectorFactory * >( + cast( + (new CppUnit::DynamicLibraryManager( + getArgument(index + 1))) + ->findSymbol(getArgument(index + 2)))))()); + } catch (CppUnit::DynamicLibraryManagerException & e) { + std::cerr + << "Failure instantiating protector \"" + << getArgument(index + 1) << "\", \"" << getArgument(index + 2) + << "\": " << e.what() << std::endl; + std::exit(EXIT_FAILURE); + } + } + if (rtl_getAppCommandArgCount() - index != 1) { + usageFailure(); } - rtl::OUString path; - rtl_getAppCommandArg(0, &path.pData); CppUnit::PlugInManager manager; - manager.load( - rtl::OUStringToOString(path, osl_getThreadTextEncoding()).getStr()); + manager.load(getArgument(index)); CppUnit::TestRunner runner; runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - CppUnit::TestResult result; CppUnit::TestResultCollector collector; result.addListener(&collector); runner.run(result); diff --git a/sal/cppunittester/makefile.mk b/sal/cppunittester/makefile.mk index 61fe7868c9f3..657b8f804504 100644 --- a/sal/cppunittester/makefile.mk +++ b/sal/cppunittester/makefile.mk @@ -44,7 +44,7 @@ CFLAGSCXX += $(CPPUNIT_CFLAGS) OBJFILES = $(APP1OBJS) -APP1OBJS = $(OBJ)/cppunittester.obj +APP1OBJS = $(OBJ)/cast.obj $(OBJ)/cppunittester.obj APP1RPATH = NONE APP1STDLIBS = $(CPPUNITLIB) $(SALLIB) APP1TARGET = cppunittester diff --git a/sal/inc/cppunittester/protectorfactory.hxx b/sal/inc/cppunittester/protectorfactory.hxx new file mode 100644 index 000000000000..c309dbe8aa85 --- /dev/null +++ b/sal/inc/cppunittester/protectorfactory.hxx @@ -0,0 +1,45 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2011 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* 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 INCLUDED_CPPUNITTESTER_PROTECTORFACTORY_HXX +#define INCLUDED_CPPUNITTESTER_PROTECTORFACTORY_HXX + +#include "sal/config.h" + +#include "sal/types.h" + +namespace CppUnit { class Protector; } + +namespace cppunittester { + +// The type of CppUnit::Protector factory functions that can be plugged into +// cppunittester: +extern "C" typedef CppUnit::Protector * SAL_CALL ProtectorFactory(); + +} + +#endif diff --git a/sal/prj/d.lst b/sal/prj/d.lst index 3ce270bbbfc4..253d7ea7f718 100644 --- a/sal/prj/d.lst +++ b/sal/prj/d.lst @@ -1,9 +1,11 @@ +mkdir: %_DEST%\inc%_EXT%\cppunittester mkdir: %_DEST%\inc%_EXT%\sal mkdir: %_DEST%\inc%_EXT%\osl mkdir: %_DEST%\inc%_EXT%\rtl mkdir: %_DEST%\inc%_EXT%\systools mkdir: %_DEST%\inc%_EXT%\systools\win32 +..\inc\cppunittester\protectorfactory.hxx %_DEST%\inc%_EXT%\protectorfactory.hxx ..\%__SRC%\inc\rtlbootstrap.mk %_DEST%\inc%_EXT%\rtlbootstrap.mk ..\inc\sal\*.h %_DEST%\inc%_EXT%\sal\*.h ..\%__SRC%\inc\sal\typesizes.h %_DEST%\inc%_EXT%\sal\typesizes.h -- cgit From a788821b83eb68decaf53cdbeaed042dd3d697b3 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 25 Feb 2011 11:32:55 +0100 Subject: debuglevels: #i117073# added cppunittester --protector support; added unoexceptionprotector and use it in installationtest.mk; reverted changes to smoketest.cxx obsoleted by these additions --- solenv/inc/installationtest.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index 96b09edebeff..8553a739d5d1 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -111,7 +111,9 @@ cpptest .PHONY : -env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb \ -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb \ -env:arg-soffice=$(my_soffice) -env:arg-user=$(MISC)/$(TARGET)/user \ - $(my_cppenv) $(TEST_ARGUMENTS:^"-env:arg-testarg.") $(CPPTEST_LIBRARY) + $(my_cppenv) $(TEST_ARGUMENTS:^"-env:arg-testarg.") --protector \ + $(SOLARSHAREDBIN)/unoexceptionprotector$(DLLPOST) \ + unoexceptionprotector $(CPPTEST_LIBRARY) # As a workaround for #i111400#, ignore failure of $(RM): $(COMMAND_ECHO)- $(RM) -r $(MISC)/$(TARGET)/user .IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == "" -- cgit From 0842ba3f843a98e189fbf7e2d39cb612b4ea5e3d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 11:35:19 +0100 Subject: debuglevels: fixed module dependencies --- smoketestdoc/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst index 4fd727fe2e6c..f76d81540abe 100755 --- a/smoketestdoc/prj/build.lst +++ b/smoketestdoc/prj/build.lst @@ -1,4 +1,4 @@ -smdoc smoketestdoc :: NULL +smdoc smoketestdoc :: soltools idlc NULL smdoc smoketestdoc usr1 - all smdoc_mkout NULL smdoc smoketestdoc\data nmake - all smdoc_data NULL smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL -- cgit From 8616248aff09ecfcdf1e140cc9e3ac53e00a7049 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 14:37:23 +0100 Subject: debuglevels: yet another module dependency fix :-\ --- smoketestdoc/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst index f76d81540abe..57eb373dca9c 100755 --- a/smoketestdoc/prj/build.lst +++ b/smoketestdoc/prj/build.lst @@ -1,4 +1,4 @@ -smdoc smoketestdoc :: soltools idlc NULL +smdoc smoketestdoc :: soltools codemaker unoil javaunohelper NULL smdoc smoketestdoc usr1 - all smdoc_mkout NULL smdoc smoketestdoc\data nmake - all smdoc_data NULL smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL -- cgit From 9d42fad78d95f71c468f4ce874bd529e17225c1b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 25 Feb 2011 15:46:46 +0100 Subject: jl164 #i109096# Displaying help content fails for extensions when user installation has a long path on windows --- xmlhelp/source/cxxhelp/provider/databases.cxx | 52 +++++++++++---------------- xmlhelp/source/cxxhelp/provider/databases.hxx | 2 +- xmlhelp/source/cxxhelp/provider/db.cxx | 45 ++++++++++++++++------- xmlhelp/source/cxxhelp/provider/db.hxx | 21 ++++++++--- 4 files changed, 69 insertions(+), 51 deletions(-) mode change 100644 => 100755 xmlhelp/source/cxxhelp/provider/databases.cxx mode change 100644 => 100755 xmlhelp/source/cxxhelp/provider/db.cxx mode change 100644 => 100755 xmlhelp/source/cxxhelp/provider/db.hxx diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx old mode 100644 new mode 100755 index d798f6c42f81..e3749fc1f694 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -416,9 +416,6 @@ rtl::OUString Databases::getInstallPathAsSystemPath() return m_aInstallDirectoryAsSystemPath; } - - - rtl::OUString Databases::getInstallPathAsURL() { osl::MutexGuard aGuard( m_aMutex ); @@ -642,22 +639,18 @@ Db* Databases::getBerkeley( const rtl::OUString& Database, { Db* table = new Db(); - rtl::OUString fileNameOU; + rtl::OUString fileURL; if( pExtensionPath ) - { - rtl::OUString aExpandedURL = expandURL( *pExtensionPath ); - aExpandedURL += Language + dbFileName; - osl::FileBase::getSystemPathFromFileURL( aExpandedURL, fileNameOU ); - } + fileURL = expandURL(*pExtensionPath) + Language + dbFileName; else - fileNameOU = getInstallPathAsSystemPath() + key; - + fileURL = getInstallPathAsURL() + key; - rtl::OString fileName( fileNameOU.getStr(),fileNameOU.getLength(),osl_getThreadTextEncoding() ); - - rtl::OUString fileNameDBHelp( fileNameOU ); + rtl::OUString fileNameDBHelp( fileURL ); + //Extensions always use the new format if( pExtensionPath != NULL ) fileNameDBHelp += rtl::OUString::createFromAscii( "_" ); + //SimpleFileAccess takes file URLs as arguments!!! Using filenames works accidentally but + //fails for example when using long path names on Windows (starting with \\?\) if( m_xSFA->exists( fileNameDBHelp ) ) { DBHelp* pDBHelp = new DBHelp( fileNameDBHelp, m_xSFA ); @@ -666,13 +659,13 @@ Db* Databases::getBerkeley( const rtl::OUString& Database, #ifdef TEST_DBHELP bool bSuccess; bool bOldDbAccess = false; - bSuccess = pDBHelp->testAgainstDb( fileName, bOldDbAccess ); + bSuccess = pDBHelp->testAgainstDb( fileURL, bOldDbAccess ); bOldDbAccess = true; - bSuccess = pDBHelp->testAgainstDb( fileName, bOldDbAccess ); + bSuccess = pDBHelp->testAgainstDb( fileURL, bOldDbAccess ); #endif } - else if( table->open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + else if( table->open( 0,fileURL, DB_BTREE,DB_RDONLY,0644 ) ) { table->close( 0 ); delete table; @@ -950,17 +943,13 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database, std::vector aVector; KeyDataBaseFileIterator aDbFileIt( m_xContext, *this, Database, Language ); - rtl::OUString fileNameOU; + rtl::OUString fileURL; bool bExtension = false; - while( (fileNameOU = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 ) + while( (fileURL = aDbFileIt.nextDbFile( bExtension )).getLength() > 0 ) { - rtl::OString fileName( fileNameOU.getStr(), - fileNameOU.getLength(), - osl_getThreadTextEncoding() ); - Db table; - rtl::OUString fileNameDBHelp( fileNameOU ); + rtl::OUString fileNameDBHelp( fileURL ); if( bExtension ) fileNameDBHelp += rtl::OUString::createFromAscii( "_" ); if( m_xSFA->exists( fileNameDBHelp ) ) @@ -1009,16 +998,16 @@ KeywordInfo* Databases::getKeyword( const rtl::OUString& Database, #ifdef TEST_DBHELP bool bSuccess; bool bOldDbAccess = false; - bSuccess = aDBHelp.testAgainstDb( fileName, bOldDbAccess ); + bSuccess = aDBHelp.testAgainstDb( fileURL, bOldDbAccess ); bOldDbAccess = true; - bSuccess = aDBHelp.testAgainstDb( fileName, bOldDbAccess ); + bSuccess = aDBHelp.testAgainstDb( fileURL, bOldDbAccess ); int nDummy = 0; #endif } - else if( 0 == table.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + else if( 0 == table.open( 0,fileURL,DB_BTREE,DB_RDONLY,0644 ) ) { Db* idmap = getBerkeley( Database,Language ); @@ -1867,6 +1856,7 @@ Db* DataBaseIterator::implGetDbFromPackage( Reference< deployment::XPackage > xP //=================================================================== // class KeyDataBaseFileIterator +//returns a file URL rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) { rtl::OUString aRetFile; @@ -1877,7 +1867,7 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) { case INITIAL_MODULE: aRetFile = - m_rDatabases.getInstallPathAsSystemPath() + + m_rDatabases.getInstallPathAsURL() + m_rDatabases.processLang( m_aLanguage ) + aSlash + m_aInitialModule + rtl::OUString::createFromAscii( ".key" ); @@ -1935,16 +1925,14 @@ rtl::OUString KeyDataBaseFileIterator::nextDbFile( bool& o_rbExtension ) return aRetFile; } +//Returns a file URL, that does not contain macros rtl::OUString KeyDataBaseFileIterator::implGetDbFileFromPackage ( Reference< deployment::XPackage > xPackage ) { rtl::OUString aExpandedURL = implGetFileFromPackage( rtl::OUString::createFromAscii( ".key" ), xPackage ); - rtl::OUString aRetFile; - osl::FileBase::getSystemPathFromFileURL( aExpandedURL, aRetFile ); - - return aRetFile; + return aExpandedURL; } diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index aa80bf27405b..793edafb480f 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -506,7 +506,7 @@ namespace chelp { Databases& rDatabases, const rtl::OUString& aInitialModule, const rtl::OUString& aLanguage ) : ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage ) {} - + //Returns a file URL rtl::OUString nextDbFile( bool& o_rbExtension ); private: diff --git a/xmlhelp/source/cxxhelp/provider/db.cxx b/xmlhelp/source/cxxhelp/provider/db.cxx old mode 100644 new mode 100755 index abc5acc6381c..3db8f5a3da87 --- a/xmlhelp/source/cxxhelp/provider/db.cxx +++ b/xmlhelp/source/cxxhelp/provider/db.cxx @@ -35,6 +35,8 @@ #include "com/sun/star/io/XSeekable.hpp" +#include "osl/file.hxx" +#include "osl/thread.hxx" #ifdef TEST_DBHELP #include #endif @@ -115,21 +117,25 @@ void testWriteKeyValue( FILE* pFile, const KeyValPair& rKeyValPair ) fprintf( pFile, "%c", cLF ); } -bool DBHelp::testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess ) +bool DBHelp::testAgainstDb( const rtl::OUString& fileURL, bool bOldDbAccess ) { bool bSuccess = true; KeyValPairVector avKeyValPair; - rtl::OString aOutFileName = fileName; - aOutFileName += "_TestOut"; + rtl::OUString aOutFileName = fileURL; + aOutFileName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_TestOut")); if( bOldDbAccess ) - aOutFileName += "_Old"; - FILE* pFile = fopen( aOutFileName.getStr(), "wb" ); - + aOutFileName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_Old")); +#ifdef WNT + FILE* pFile = _wfopen( aOutFileName.getStr(), L"wb" ); +#else + rtl::OString sFile = rtl::OUStringToOString(aOutFileName, osl_getThreadTextEncoding()); + FILE* pFile = fopen( sFile.getStr(), "wb" ); +#endif // Get all values Db table; - if( 0 == table.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + if( 0 == table.open( 0,fileURL,DB_BTREE,DB_RDONLY,0644 ) ) { bool first = true; @@ -206,7 +212,7 @@ bool DBHelp::testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess ) { if( bFirst ) { - if( tableTest.open( 0,fileName.getStr(),0,DB_BTREE,DB_RDONLY,0644 ) ) + if( tableTest.open( 0,fileURL, DB_BTREE,DB_RDONLY,0644 ) ) { if( pFile != NULL ) fprintf( pFile, "Cannot open database\n" ); @@ -305,11 +311,11 @@ void DBHelp::createHashMap( bool bOptimizeForPerformance ) m_pStringToValPosMap = new StringToValPosMap(); } - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { Sequence< sal_Int8 > aData; - sal_Int32 nSize = m_xSFA->getSize( m_aFileName ); + sal_Int32 nSize = m_xSFA->getSize( m_aFileURL ); sal_Int32 nRead = xIn->readBytes( aData, nSize ); const char* pData = (const char*)aData.getConstArray(); @@ -388,7 +394,7 @@ bool DBHelp::getValueForKey( const rtl::OString& rKey, DBData& rValue ) int iValuePos = rValPair.first; int nValueLen = rValPair.second; - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { Reference< XSeekable > xXSeekable( xIn, UNO_QUERY ); @@ -436,9 +442,9 @@ bool DBHelp::startIteration( void ) { bool bSuccess = false; - sal_Int32 nSize = m_xSFA->getSize( m_aFileName ); + sal_Int32 nSize = m_xSFA->getSize( m_aFileURL ); - Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileName ); + Reference< XInputStream > xIn = m_xSFA->openFileRead( m_aFileURL ); if( xIn.is() ) { m_nItRead = xIn->readBytes( m_aItData, nSize ); @@ -519,6 +525,19 @@ int Db::open(DB_TXN *txnid, return db_internal::check_error( err,"Db::open" ); } +int Db::open(DB_TXN *txnid, + ::rtl::OUString const & fileURL, + DBTYPE type, + u_int32_t flags, + int mode) +{ + ::rtl::OUString ouPath; + ::osl::FileBase::getSystemPathFromFileURL(fileURL, ouPath); + const ::rtl::OString sPath = ::rtl::OUStringToOString(ouPath, osl_getThreadTextEncoding()); + return open(txnid, sPath.getStr(), 0, type, flags, mode); +} + + int Db::get(DB_TXN *txnid, Dbt *key, Dbt *data, u_int32_t flags) { diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx old mode 100644 new mode 100755 index eb867c0426d3..1e25ab1f579b --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -118,7 +118,7 @@ namespace berkeleydbproxy { class DBHelp { - rtl::OUString m_aFileName; + rtl::OUString m_aFileURL; StringToDataMap* m_pStringToDataMap; StringToValPosMap* m_pStringToValPosMap; com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > @@ -133,16 +133,21 @@ namespace berkeleydbproxy { bool implReadLenAndData( const char* pData, int& riPos, DBData& rValue ); public: - DBHelp( const rtl::OUString& rFileName, + //DBHelp must get a fileURL which can then directly be used by simple file access. + //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails + //for example when using long file paths on Windows, which start with "\\?\" + DBHelp( const rtl::OUString& rFileURL, com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > xSFA ) - : m_aFileName( rFileName ) + : m_aFileURL( rFileURL ) , m_pStringToDataMap( NULL ) , m_pStringToValPosMap( NULL ) , m_xSFA( xSFA ) , m_pItData( NULL ) , m_nItRead( -1 ) , m_iItPos( -1 ) - {} + { + OSL_ASSERT(!rFileURL.compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:")), 5)); + } ~DBHelp() { releaseHashMap(); } @@ -150,7 +155,7 @@ namespace berkeleydbproxy { void releaseHashMap( void ); #ifdef TEST_DBHELP - bool testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess ); + bool testAgainstDb( const rtl::OUString& fileURL, bool bOldDbAccess ); #endif bool getValueForKey( const rtl::OString& rKey, DBData& rValue ); @@ -184,6 +189,12 @@ namespace berkeleydbproxy { u_int32_t flags, int mode); + int open(DB_TXN *txnid, + ::rtl::OUString const & fileURL, + DBTYPE type, + u_int32_t flags, + int mode); + int get(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags); -- cgit From df43fd9cd28a12f2e90ae40c163a20005ef2ae20 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 16:01:35 +0100 Subject: debuglevels: GCC WaE / replace cppunit's DynamicLibraryManager (which does not seem to be public API) with osl_loadModule --- sal/cppunittester/cast.c | 36 ---------------------- sal/cppunittester/cast.h | 46 ----------------------------- sal/cppunittester/cppunittester.cxx | 59 +++++++++++++++++++++++-------------- sal/cppunittester/makefile.mk | 2 +- 4 files changed, 38 insertions(+), 105 deletions(-) delete mode 100644 sal/cppunittester/cast.c delete mode 100644 sal/cppunittester/cast.h diff --git a/sal/cppunittester/cast.c b/sal/cppunittester/cast.c deleted file mode 100644 index 38c081a60708..000000000000 --- a/sal/cppunittester/cast.c +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2011 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* 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. -* -************************************************************************/ - -#include "sal/config.h" - -#include "osl/module.h" - -#include "cast.h" - -oslGenericFunction cast(void * fn) { - return (oslGenericFunction) fn; -} diff --git a/sal/cppunittester/cast.h b/sal/cppunittester/cast.h deleted file mode 100644 index 4cfd411da930..000000000000 --- a/sal/cppunittester/cast.h +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2011 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* 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 INCLUDED_SAL_CPPUNITTESTER_CAST_H -#define INCLUDED_SAL_CPPUNITTESTER_CAST_H - -#include "sal/config.h" - -#include "osl/module.h" - -#if defined __cplusplus -extern "C" { -#endif - -/* C++ compilers would warn about that cast, so it is done in C: */ -oslGenericFunction cast(void * fn); - -#if defined __cplusplus -} -#endif - -#endif diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index e3ced7253e47..6aba6dc14b30 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -34,12 +34,16 @@ #include #include "cppunittester/protectorfactory.hxx" +#include "osl/module.h" +#include "osl/module.hxx" #include "osl/thread.h" #include "rtl/process.h" +#include "rtl/string.h" #include "rtl/string.hxx" #include "rtl/textcvt.h" #include "rtl/ustring.hxx" #include "sal/main.h" +#include "sal/types.h" #include "preextstl.h" #include "cppunit/CompilerOutputter.h" @@ -47,14 +51,10 @@ #include "cppunit/TestResultCollector.h" #include "cppunit/TestRunner.h" #include "cppunit/extensions/TestFactoryRegistry.h" -#include "cppunit/plugin/DynamicLibraryManager.h" -#include "cppunit/plugin/DynamicLibraryManagerException.h" #include "cppunit/plugin/PlugInManager.h" #include "cppunit/portability/Stream.h" #include "postextstl.h" -#include "cast.h" - namespace { void usageFailure() { @@ -65,15 +65,29 @@ void usageFailure() { std::exit(EXIT_FAILURE); } -std::string getArgument(sal_uInt32 index) { - rtl::OUString s16; - rtl_getAppCommandArg(index, &s16.pData); +rtl::OUString getArgument(sal_Int32 index) { + rtl::OUString arg; + rtl_getAppCommandArg(index, &arg.pData); + return arg; +} + +std::string convertLazy(rtl::OUString const & s16) { + rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding())); + return std::string( + s8.getStr(), + ((static_cast< sal_uInt32 >(s8.getLength()) + > std::numeric_limits< std::string::size_type >::max()) + ? std::numeric_limits< std::string::size_type >::max() + : static_cast< std::string::size_type >(s8.getLength()))); +} + +std::string convertStrict(rtl::OUString const & s16) { rtl::OString s8; if (!s16.convertToString( &s8, osl_getThreadTextEncoding(), (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)) - || (s8.getLength() + || (static_cast< sal_uInt32 >(s8.getLength()) > std::numeric_limits< std::string::size_type >::max())) { std::cerr @@ -91,38 +105,39 @@ SAL_IMPLEMENT_MAIN() { CppUnit::TestResult result; sal_uInt32 index = 0; for (; index < rtl_getAppCommandArgCount(); index += 3) { - std::string arg(getArgument(index)); - if (arg.compare("--protector") != 0) { + if (!getArgument(index).equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("--protector"))) + { break; } if (rtl_getAppCommandArgCount() - index < 3) { usageFailure(); } - try { - result.pushProtector( - (*reinterpret_cast< cppunittester::ProtectorFactory * >( - cast( - (new CppUnit::DynamicLibraryManager( - getArgument(index + 1))) - ->findSymbol(getArgument(index + 2)))))()); - } catch (CppUnit::DynamicLibraryManagerException & e) { + rtl::OUString lib(getArgument(index + 1)); + rtl::OUString sym(getArgument(index + 2)); + oslGenericFunction fn = (new osl::Module(lib))->getFunctionSymbol(sym); + CppUnit::Protector * p = fn == 0 + ? 0 + : (*reinterpret_cast< cppunittester::ProtectorFactory * >(fn))(); + if (p == 0) { std::cerr - << "Failure instantiating protector \"" - << getArgument(index + 1) << "\", \"" << getArgument(index + 2) - << "\": " << e.what() << std::endl; + << "Failure instantiating protector \"" << convertLazy(lib) + << "\", \"" << convertLazy(sym) << '"' << std::endl; std::exit(EXIT_FAILURE); } + result.pushProtector(p); } if (rtl_getAppCommandArgCount() - index != 1) { usageFailure(); } CppUnit::PlugInManager manager; - manager.load(getArgument(index)); + manager.load(convertStrict(getArgument(index))); CppUnit::TestRunner runner; runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); CppUnit::TestResultCollector collector; result.addListener(&collector); runner.run(result); CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write(); + fprintf( stderr, "-----\n" ); fflush( stderr ); return collector.wasSuccessful() ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/sal/cppunittester/makefile.mk b/sal/cppunittester/makefile.mk index 657b8f804504..61fe7868c9f3 100644 --- a/sal/cppunittester/makefile.mk +++ b/sal/cppunittester/makefile.mk @@ -44,7 +44,7 @@ CFLAGSCXX += $(CPPUNIT_CFLAGS) OBJFILES = $(APP1OBJS) -APP1OBJS = $(OBJ)/cast.obj $(OBJ)/cppunittester.obj +APP1OBJS = $(OBJ)/cppunittester.obj APP1RPATH = NONE APP1STDLIBS = $(CPPUNITLIB) $(SALLIB) APP1TARGET = cppunittester -- cgit From 42ecce229d28c99cca9e80b3d8837cbcfc538b25 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 16:01:35 +0100 Subject: debuglevels: GCC WaE / replace cppunit's DynamicLibraryManager (which does not seem to be public API) with osl_loadModule --- test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx index 28a0462c3ef1..4f9ee9b198e2 100644 --- a/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx +++ b/test/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx @@ -23,6 +23,7 @@ * for a copy of the LGPLv3 License. ************************************************************************/ +#include "precompiled_test.hxx" #include "sal/config.h" #include @@ -52,7 +53,8 @@ std::string convert(rtl::OUString const & s16) { rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding())); return std::string( s8.getStr(), - (s8.getLength() > std::numeric_limits< std::string::size_type >::max() + ((static_cast< sal_uInt32 >(s8.getLength()) + > std::numeric_limits< std::string::size_type >::max()) ? std::numeric_limits< std::string::size_type >::max() : static_cast< std::string::size_type >(s8.getLength()))); } @@ -85,6 +87,7 @@ bool Prot::protect( + a.getValueTypeName()), convert(e.Message))); } + return false; } } -- cgit From 5be612b57e506c2b2de13b29649762595f64b126 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Sat, 26 Feb 2011 13:17:12 +0100 Subject: chart51: #i116961# import shared y values for bubble charts correctly --- xmloff/source/chart/SchXMLSeries2Context.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index d106398a0fcd..a95acf9aa0b5 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -581,6 +581,11 @@ void SchXMLSeries2Context::EndElement() aDomainInfos.push_back( aDomainInfo ); m_rGlobalSeriesImportInfo.nCurrentDataIndex++; } + else if( m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress.getLength() ) + { + DomainInfo aDomainInfo( OUString::createFromAscii("values-y"), m_rGlobalSeriesImportInfo.aFirstFirstDomainAddress, m_rGlobalSeriesImportInfo.nFirstFirstDomainIndex ) ; + aDomainInfos.push_back( aDomainInfo ); + } } if( bDeleteSeries ) -- cgit From af449c28ff331a19768df64d92c94954a64efd70 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Sat, 26 Feb 2011 14:41:27 +0100 Subject: chart51: copy-paste bubbles with text x values correctly --- xmloff/source/chart/SchXMLExport.cxx | 92 ++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 21 deletions(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 3ec6ea2d3006..a65f6b11780f 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -635,46 +635,96 @@ sal_Int32 lcl_getMaxSequenceLength( return nResult; } -double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence > & xSeq, sal_Int32 nIndex ) +uno::Sequence< rtl::OUString > lcl_DataSequenceToStringSequence( + const uno::Reference< chart2::data::XDataSequence >& xDataSequence ) { - double fResult = 0.0; - ::rtl::math::setNan( &fResult ); - Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY ); - if( xNumSeq.is()) + uno::Sequence< rtl::OUString > aResult; + if(!xDataSequence.is()) + return aResult; + + uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY ); + if( xTextualDataSequence.is() ) { - Sequence< double > aValues( xNumSeq->getNumericalData()); - if( nIndex < aValues.getLength() ) - fResult = aValues[nIndex]; + aResult = xTextualDataSequence->getTextualData(); } else { - Sequence< uno::Any > aAnies( xSeq->getData()); - if( nIndex < aAnies.getLength() ) - aAnies[nIndex] >>= fResult; + uno::Sequence< uno::Any > aValues = xDataSequence->getData(); + aResult.realloc(aValues.getLength()); + + for(sal_Int32 nN=aValues.getLength();nN--;) + aValues[nN] >>= aResult[nN]; } - return fResult; -} + return aResult; +} ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) { double fNan = 0.0; ::rtl::math::setNan( &fNan ); ::std::vector< double > aResult; + if(!xSeq.is()) + return aResult; + uno::Sequence< double > aValuesSequence; Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY ); - if( xNumSeq.is()) + if( xNumSeq.is() ) { - Sequence< double > aValues( xNumSeq->getNumericalData()); - ::std::copy( aValues.getConstArray(), aValues.getConstArray() + aValues.getLength(), - ::std::back_inserter( aResult )); + aValuesSequence = xNumSeq->getNumericalData(); } - else if( xSeq.is()) + else { - Sequence< uno::Any > aAnies( xSeq->getData()); - aResult.resize( aAnies.getLength(), fNan ); + Sequence< uno::Any > aAnies( xSeq->getData() ); + aValuesSequence.realloc( aAnies.getLength() ); for( sal_Int32 i=0; i>= aResult[i]; + aAnies[i] >>= aValuesSequence[i]; } + + //special handling for x-values (if x-values do point to categories, indices are used instead ) + Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY ); + if( xProp.is() ) + { + OUString aRole; + xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Role") ) ) >>= aRole; + if( aRole.match( OUString( RTL_CONSTASCII_USTRINGPARAM( "values-x") ) ) ) + { + //lcl_clearIfNoValuesButTextIsContained - replace by indices if the values are not appropriate + bool bHasValue=false; + bool bHasText=false; + sal_Int32 nCount = aValuesSequence.getLength(); + for( sal_Int32 j = 0; j < nCount; ++j ) + { + if( !::rtl::math::isNan( aValuesSequence[j] ) ) + { + bHasValue=true; + break; + } + } + if(!bHasValue) + { + //no double value is countained + //is there any text? + uno::Sequence< rtl::OUString > aStrings( lcl_DataSequenceToStringSequence( xSeq ) ); + sal_Int32 nTextCount = aStrings.getLength(); + for( sal_Int32 j = 0; j < nTextCount; ++j ) + { + if( aStrings[j].getLength() ) + { + bHasText=true; + break; + } + } + } + if( !bHasValue && bHasText ) + { + for( sal_Int32 j = 0; j < nCount; ++j ) + aValuesSequence[j] = j+1; + } + } + } + + ::std::copy( aValuesSequence.getConstArray(), aValuesSequence.getConstArray() + aValuesSequence.getLength(), + ::std::back_inserter( aResult )); return aResult; } -- cgit From e12b6584f9ebcb0397f5965e8297295a27807675 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Sat, 26 Feb 2011 15:04:42 +0100 Subject: chart51: don't switch to internal data if ranges for bubble sizes are missing --- xmloff/source/chart/SchXMLSeries2Context.cxx | 4 ++-- xmloff/source/chart/SchXMLTools.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index a95acf9aa0b5..f45f9a5e5f48 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -423,7 +423,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib // values Reference< chart2::data::XDataSequence > xSeq; - if( bHasRange ) + if( bHasRange && m_aSeriesRange.getLength() ) xSeq = SchXMLTools::CreateDataSequence( m_aSeriesRange, mxNewDoc ); Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY ); @@ -442,7 +442,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq )); // label - if( bHasLabelRange ) + if( bHasLabelRange && m_aSeriesLabelRange.getLength() ) { Reference< chart2::data::XDataSequence > xLabelSequence = SchXMLTools::CreateDataSequence( m_aSeriesLabelRange, mxNewDoc ); diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index a0be5f4ec6a8..2aed07dca617 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -419,7 +419,7 @@ Reference< chart2::data::XDataSequence > CreateDataSequence( DBG_ERROR( "could not create data sequence" ); } - if( !xRet.is() && !xChartDoc->hasInternalDataProvider() ) + if( !xRet.is() && !xChartDoc->hasInternalDataProvider() && rRange.getLength() ) { //#i103911# switch to internal data in case the parent cannot provide the requested data xChartDoc->createInternalDataProvider( sal_True /* bCloneExistingData */ ); -- cgit From 2daf5ba78e26535ca4a2e6b743c0801d1e75c067 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sat, 26 Feb 2011 21:52:40 +0100 Subject: debuglevels: ooops - removed a line of code not intended to be committed --- sal/cppunittester/cppunittester.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index 6aba6dc14b30..ab3f61fcecee 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -138,6 +138,5 @@ SAL_IMPLEMENT_MAIN() { result.addListener(&collector); runner.run(result); CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write(); - fprintf( stderr, "-----\n" ); fflush( stderr ); return collector.wasSuccessful() ? EXIT_SUCCESS : EXIT_FAILURE; } -- cgit From bf5a377913bfb59f7010ad6dbca3e2247f7eff94 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 28 Feb 2011 08:57:47 +0100 Subject: debuglevels: #i117073# Linux/GCC needs SAL_LOADMODULE_GLOBAL for exception handling to work --- sal/cppunittester/cppunittester.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index ab3f61fcecee..c89a350d6708 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -115,7 +115,8 @@ SAL_IMPLEMENT_MAIN() { } rtl::OUString lib(getArgument(index + 1)); rtl::OUString sym(getArgument(index + 2)); - oslGenericFunction fn = (new osl::Module(lib))->getFunctionSymbol(sym); + oslGenericFunction fn = (new osl::Module(lib, SAL_LOADMODULE_GLOBAL)) + ->getFunctionSymbol(sym); CppUnit::Protector * p = fn == 0 ? 0 : (*reinterpret_cast< cppunittester::ProtectorFactory * >(fn))(); -- cgit From fd56d52ca4db7df1b0f148dd5726cfb8e77c3ec4 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 1 Mar 2011 10:55:20 +0100 Subject: jl164 #i109096# osl_loadModules did not work with long paths. --- sal/osl/w32/module.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx index b730bd3347df..e628c8b9614c 100644 --- a/sal/osl/w32/module.cxx +++ b/sal/osl/w32/module.cxx @@ -65,10 +65,31 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod rtl_uString_assign(&Module, strModuleName); hInstance = LoadLibraryW(reinterpret_cast(Module->buffer)); + if (hInstance == NULL) hInstance = LoadLibraryExW(reinterpret_cast(Module->buffer), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + //In case of long path names (\\?\c:\...) try to shorten the filename. + //LoadLibrary cannot handle file names which exceed 260 letters. + if (hInstance == NULL && GetLastError() == ERROR_FILENAME_EXCED_RANGE) + { + wchar_t * buff = new wchar_t[Module->length + 1]; + DWORD len = GetShortPathNameW(reinterpret_cast(Module->buffer), + buff, Module->length + 1); + if (len ) + { + hInstance = LoadLibraryW(buff); + + if (hInstance == NULL) + hInstance = LoadLibraryExW(buff, NULL, + LOAD_WITH_ALTERED_SEARCH_PATH); + + } + delete[] buff; + } + + if (hInstance <= (HINSTANCE)HINSTANCE_ERROR) hInstance = 0; -- cgit From 7fa93a8c4657785b36876495a09d0eec9eeed107 Mon Sep 17 00:00:00 2001 From: iha Date: Tue, 1 Mar 2011 20:33:22 +0100 Subject: chart55: #i116841# crash with stock chart --- xmloff/source/chart/SchXMLExport.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index c74abe953d2f..265c65b1d052 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1769,7 +1769,7 @@ void SchXMLExportHelper_Impl::exportTable() for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin()) ; aRowIt != aData.aDataInRows.end() - ; aRowIt++, nC++, aRowDescriptionsIter++ ) + ; ++aRowIt, ++nC ) { SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True ); @@ -1807,8 +1807,10 @@ void SchXMLExportHelper_Impl::exportTable() if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) { // remind the original range to allow a correct re-association when copying via clipboard - SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ ); + SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter ); + ++aRowDescriptions_RangeIter; } + ++aRowDescriptionsIter; } } -- cgit From 57bc751b0a21acbfc58e0d3cc9165ee1658a8964 Mon Sep 17 00:00:00 2001 From: "Thomas Benisch [tbe]" Date: Wed, 2 Mar 2011 10:55:17 +0100 Subject: chart55: #i112752# missing data change updates from calc to chart --- sc/inc/chart2uno.hxx | 64 ------------- sc/source/ui/unoobj/chart2uno.cxx | 188 ++++++++++---------------------------- 2 files changed, 50 insertions(+), 202 deletions(-) diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx index 44737e711090..8ff1b0e9bd73 100644 --- a/sc/inc/chart2uno.hxx +++ b/sc/inc/chart2uno.hxx @@ -241,70 +241,6 @@ private: }; -// LabeledDataSequence ======================================================= - -class ScChart2LabeledDataSequence : public - ::cppu::WeakImplHelper4< - ::com::sun::star::chart2::data::XLabeledDataSequence, - ::com::sun::star::util::XCloneable, - ::com::sun::star::util::XModifyBroadcaster, - ::com::sun::star::lang::XServiceInfo >, - SfxListener -{ -public: - - explicit ScChart2LabeledDataSequence( ScDocument* pDoc ); - virtual ~ScChart2LabeledDataSequence(); - - // SfxListener ----------------------------------------------------------- - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - - // XLabeledDataSequence -------------------------------------------------- - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getValues() - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setValues( - const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getLabel() - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setLabel( - const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) - throw (::com::sun::star::uno::RuntimeException); - - // XCloneable ------------------------------------------------------------ - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() - throw (::com::sun::star::uno::RuntimeException); - - // XModifyBroadcaster ---------------------------------------------------- - - virtual void SAL_CALL addModifyListener( - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeModifyListener( - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) - 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); - -private: - ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::data::XDataSequence > m_aData; - ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::data::XDataSequence > m_aLabel; - ScDocument* m_pDocument; -}; - // DataSequence ============================================================== class ScChart2DataSequence : public diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 835959e68e3d..7fec2d653ca7 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -62,8 +63,6 @@ SC_SIMPLE_SERVICE_INFO( ScChart2DataProvider, "ScChart2DataProvider", "com.sun.star.chart2.data.DataProvider") SC_SIMPLE_SERVICE_INFO( ScChart2DataSource, "ScChart2DataSource", "com.sun.star.chart2.data.DataSource") -SC_SIMPLE_SERVICE_INFO( ScChart2LabeledDataSequence, "ScChart2LabeledDataSequence", - "com.sun.star.chart2.data.LabeledDataSequence") SC_SIMPLE_SERVICE_INFO( ScChart2DataSequence, "ScChart2DataSequence", "com.sun.star.chart2.data.DataSequence") #if USE_CHART2_EMPTYDATASEQUENCE @@ -1051,27 +1050,40 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint namespace { -ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr< vector > pValueTokens, auto_ptr< vector > pLabelTokens, - ScDocument* pDoc, const uno::Reference < chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells ) +Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFromTokens( + auto_ptr< vector< ScSharedTokenRef > > pValueTokens, auto_ptr< vector< ScSharedTokenRef > > pLabelTokens, + ScDocument* pDoc, const Reference< chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells ) { - ScChart2LabeledDataSequence* pRet = 0; + Reference< chart2::data::XLabeledDataSequence > xResult; bool bHasValues = pValueTokens.get() && !pValueTokens->empty(); bool bHasLabel = pLabelTokens.get() && !pLabelTokens->empty(); if( bHasValues || bHasLabel ) { - pRet = new ScChart2LabeledDataSequence(pDoc); - if(bHasValues) + try { - uno::Reference < chart2::data::XDataSequence > xSeq(new ScChart2DataSequence(pDoc, xDP, pValueTokens.release(), bIncludeHiddenCells)); - pRet->setValues(xSeq); + Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + if ( xContext.is() ) + { + xResult.set( xContext->getServiceManager()->createInstanceWithContext( + ::rtl::OUString::createFromAscii( "com.sun.star.chart2.data.LabeledDataSequence" ), + xContext ), uno::UNO_QUERY_THROW ); + } + if ( bHasValues ) + { + Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( pDoc, xDP, pValueTokens.release(), bIncludeHiddenCells ) ); + xResult->setValues( xSeq ); + } + if ( bHasLabel ) + { + Reference< chart2::data::XDataSequence > xLabelSeq( new ScChart2DataSequence( pDoc, xDP, pLabelTokens.release(), bIncludeHiddenCells ) ); + xResult->setLabel( xLabelSeq ); + } } - if(bHasLabel) + catch( uno::Exception& ex ) { - uno::Reference < chart2::data::XDataSequence > xLabelSeq(new ScChart2DataSequence(pDoc, xDP, pLabelTokens.release(), bIncludeHiddenCells)); - pRet->setLabel(xLabelSeq); } } - return pRet; + return xResult; } //---------------------------------------------------- @@ -1474,7 +1486,7 @@ ScChart2DataProvider::createDataSource( return xResult; ScChart2DataSource* pDS = NULL; - std::list < ScChart2LabeledDataSequence* > aSeqs; + ::std::list< Reference< chart2::data::XLabeledDataSequence > > aSeqs; // Fill Categories if( bCategories ) @@ -1488,9 +1500,12 @@ ScChart2DataProvider::createDataSource( auto_ptr< vector > pLabelTokens(NULL); pLabelTokens.reset(pChartMap->getLeftUpperCornerRanges()); - ScChart2LabeledDataSequence* pCategories = lcl_createScChart2DataSequenceFromTokens( pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells );//ownership of pointers is transfered! - if( pCategories ) - aSeqs.push_back(pCategories); + Reference< chart2::data::XLabeledDataSequence > xCategories = lcl_createLabeledDataSequenceFromTokens( + pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transfered! + if ( xCategories.is() ) + { + aSeqs.push_back( xCategories ); + } } // Fill Serieses (values and label) @@ -1509,42 +1524,47 @@ ScChart2DataProvider::createDataSource( pValueTokens.reset(pChartMap->getDataRowRanges(static_cast(i))); pLabelTokens.reset(pChartMap->getRowHeaderRanges(static_cast(i))); } - ScChart2LabeledDataSequence* pChartSeries = lcl_createScChart2DataSequenceFromTokens( pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transfered! - if( pChartSeries ) - aSeqs.push_back(pChartSeries); + Reference< chart2::data::XLabeledDataSequence > xChartSeries = lcl_createLabeledDataSequenceFromTokens( + pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transfered! + if ( xChartSeries.is() ) + { + aSeqs.push_back( xChartSeries ); + } } pDS = new ScChart2DataSource(m_pDocument); - std::list < ScChart2LabeledDataSequence* >::iterator aItr(aSeqs.begin()); - std::list < ScChart2LabeledDataSequence* >::iterator aEndItr(aSeqs.end()); + ::std::list< Reference< chart2::data::XLabeledDataSequence > >::iterator aItr( aSeqs.begin() ); + ::std::list< Reference< chart2::data::XLabeledDataSequence > >::iterator aEndItr( aSeqs.end() ); //reorder labeled sequences according to aSequenceMapping - std::vector< ScChart2LabeledDataSequence* > aSeqVector; + ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aSeqVector; while(aItr != aEndItr) { aSeqVector.push_back(*aItr); ++aItr; } - std::map< sal_Int32, ScChart2LabeledDataSequence* > aSequenceMap; + ::std::map< sal_Int32, Reference< chart2::data::XLabeledDataSequence > > aSequenceMap; for( sal_Int32 nNewIndex = 0; nNewIndex < aSequenceMapping.getLength(); nNewIndex++ ) { // note: assuming that the values in the sequence mapping are always non-negative - std::vector< ScChart2LabeledDataSequence* >::size_type nOldIndex( static_cast< sal_uInt32 >( aSequenceMapping[nNewIndex] )); + ::std::vector< Reference< chart2::data::XLabeledDataSequence > >::size_type nOldIndex( static_cast< sal_uInt32 >( aSequenceMapping[nNewIndex] ) ); if( nOldIndex < aSeqVector.size() ) { pDS->AddLabeledSequence( aSeqVector[nOldIndex] ); aSeqVector[nOldIndex] = 0; } - } - std::vector< ScChart2LabeledDataSequence* >::iterator aVectorItr(aSeqVector.begin()); - std::vector< ScChart2LabeledDataSequence* >::iterator aVectorEndItr(aSeqVector.end()); + ::std::vector< Reference< chart2::data::XLabeledDataSequence > >::iterator aVectorItr( aSeqVector.begin() ); + ::std::vector< Reference< chart2::data::XLabeledDataSequence > >::iterator aVectorEndItr( aSeqVector.end() ); while(aVectorItr != aVectorEndItr) { - if(*aVectorItr) - pDS->AddLabeledSequence(*aVectorItr); + Reference< chart2::data::XLabeledDataSequence > xSeq( *aVectorItr ); + if ( xSeq.is() ) + { + pDS->AddLabeledSequence( xSeq ); + } ++aVectorItr; } @@ -2321,114 +2341,6 @@ void ScChart2DataSource::AddLabeledSequence(const uno::Reference < chart2::data: m_aLabeledSequences.push_back(xNew); } -// LabeledDataSequence ======================================================= - -ScChart2LabeledDataSequence::ScChart2LabeledDataSequence( - ScDocument* pDoc ) : - m_pDocument( pDoc ) -{ - if ( m_pDocument ) - m_pDocument->AddUnoObject( *this); -} - -ScChart2LabeledDataSequence::~ScChart2LabeledDataSequence() -{ - if ( m_pDocument ) - m_pDocument->RemoveUnoObject( *this); -} - -// SfxListener ----------------------------------------------------------- - -void ScChart2LabeledDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint) -{ - if ( rHint.ISA( SfxSimpleHint ) && - ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING ) - { - ScUnoGuard aGuard; - m_pDocument = NULL; - } -} - -// XLabeledDataSequence -------------------------------------------------- - -uno::Reference< chart2::data::XDataSequence > SAL_CALL ScChart2LabeledDataSequence::getValues() - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard; - return m_aData; -} - -void SAL_CALL ScChart2LabeledDataSequence::setValues( - const uno::Reference< chart2::data::XDataSequence >& xSequence ) - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard; - m_aData = xSequence; -} - -uno::Reference< chart2::data::XDataSequence > SAL_CALL ScChart2LabeledDataSequence::getLabel() - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard; - return m_aLabel; -} - -void SAL_CALL ScChart2LabeledDataSequence::setLabel( - const uno::Reference< chart2::data::XDataSequence >& xSequence ) - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard; - m_aLabel = xSequence; -} - -// XCloneable ================================================================ - -uno::Reference< util::XCloneable > SAL_CALL ScChart2LabeledDataSequence::createClone() - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard; - uno::Reference< util::XCloneable > xToClone(m_aData, uno::UNO_QUERY); - if (xToClone.is()) - { - ScChart2LabeledDataSequence* pRet = new ScChart2LabeledDataSequence(m_pDocument); - uno::Reference< chart2::data::XDataSequence > xSequence(xToClone->createClone(), uno::UNO_QUERY); - pRet->setValues(xSequence); - xToClone.set(m_aLabel, uno::UNO_QUERY); - if(xToClone.is()) - { - xSequence.set(xToClone->createClone(), uno::UNO_QUERY); - pRet->setLabel(xSequence); - } - return pRet; - } - return NULL; -} - -// XModifyBroadcaster ======================================================== - -void SAL_CALL ScChart2LabeledDataSequence::addModifyListener( const uno::Reference< util::XModifyListener >& aListener ) - throw (uno::RuntimeException) -{ - // quick'n dirty: just add the listener to each DataSequence - - uno::Reference xDataBroadcaster( m_aData, uno::UNO_QUERY ); - if ( xDataBroadcaster.is() ) - xDataBroadcaster->addModifyListener( aListener ); - uno::Reference xLabelBroadcaster( m_aLabel, uno::UNO_QUERY ); - if ( xLabelBroadcaster.is() ) - xLabelBroadcaster->addModifyListener( aListener ); -} - -void SAL_CALL ScChart2LabeledDataSequence::removeModifyListener( const uno::Reference< util::XModifyListener >& aListener ) - throw (uno::RuntimeException) -{ - uno::Reference xDataBroadcaster( m_aData, uno::UNO_QUERY ); - if ( xDataBroadcaster.is() ) - xDataBroadcaster->removeModifyListener( aListener ); - uno::Reference xLabelBroadcaster( m_aLabel, uno::UNO_QUERY ); - if ( xLabelBroadcaster.is() ) - xLabelBroadcaster->removeModifyListener( aListener ); -} // DataSequence ============================================================== -- cgit From cfbddca53c5f0c795fa35612d739c3dabb8f0d48 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 2 Mar 2011 16:11:23 +0100 Subject: jl164 #i109096# osl_createProcesess failed if the executable had a long path on windows --- sal/osl/w32/module.cxx | 16 +++++++++------- sal/osl/w32/procimpl.cxx | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 7 deletions(-) mode change 100644 => 100755 sal/osl/w32/module.cxx mode change 100644 => 100755 sal/osl/w32/procimpl.cxx diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx old mode 100644 new mode 100755 index e628c8b9614c..00737ebbbaa4 --- a/sal/osl/w32/module.cxx +++ b/sal/osl/w32/module.cxx @@ -36,6 +36,7 @@ #include #include #include +#include /* under WIN32, we use the void* oslModule @@ -72,21 +73,22 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod //In case of long path names (\\?\c:\...) try to shorten the filename. //LoadLibrary cannot handle file names which exceed 260 letters. - if (hInstance == NULL && GetLastError() == ERROR_FILENAME_EXCED_RANGE) + //In case the path is to long, the function will fail. However, the error + //code can be different. For example, it returned ERROR_FILENAME_EXCED_RANGE + //on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit) + if (hInstance == NULL && Module->length > 260) { - wchar_t * buff = new wchar_t[Module->length + 1]; + std::vector > vec(Module->length + 1); DWORD len = GetShortPathNameW(reinterpret_cast(Module->buffer), - buff, Module->length + 1); + vec.begin(), Module->length + 1); if (len ) { - hInstance = LoadLibraryW(buff); + hInstance = LoadLibraryW(vec.begin()); if (hInstance == NULL) - hInstance = LoadLibraryExW(buff, NULL, + hInstance = LoadLibraryExW(vec.begin(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - } - delete[] buff; } diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx old mode 100644 new mode 100755 index fc04d5b84a8f..13e7141edbad --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -300,6 +300,39 @@ namespace /* private */ return quoted.makeStringAndClear(); } + //The parameter path must be a system path. If it is longer than 260 characters + //then it is shortened using the GetShortPathName function. This function only + //works if the path exists. Because "path" can be the path to an executable, it + //may not have the file extension ".exe". However, if the file on disk has the + //".exe" extension, then the function will fail. In this case a second attempt + //is started by adding the parameter "extension" to "path". + rtl::OUString getShortPath(rtl::OUString const & path, rtl::OUString const & extension) + { + rtl::OUString ret(path); + if (path.getLength() > 260) + { + std::vector > vec(path.getLength() + 1); + //GetShortPathNameW only works if the file can be found! + const DWORD len = GetShortPathNameW( + path.getStr(), vec.begin(), path.getLength() + 1); + + if (!len && GetLastError() == ERROR_FILE_NOT_FOUND + && extension.getLength()) + { + const rtl::OUString extPath(path + extension); + std::vector > vec2( + extPath.getLength() + 1); + const DWORD len2 = GetShortPathNameW( + extPath.getStr(), vec2.begin(), extPath.getLength() + 1); + ret = rtl::OUString(vec2.begin(), len2); + } + else + { + ret = rtl::OUString(vec.begin(), len); + } + } + return ret; + } //########################################################## // Returns the system path of the executable which can either // be provided via the strImageName parameter or as first @@ -326,6 +359,8 @@ namespace /* private */ if (osl_File_E_None != osl::FileBase::getSystemPathFromFileURL(exe_url, exe_path)) return rtl::OUString(); + exe_path = getShortPath(exe_path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".exe"))); + if (exe_path.indexOf(' ') != -1) exe_path = quote_string(exe_path); -- cgit From 3de320a3c332ace5bbe9adc9fa3a5960104e365b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 2 Mar 2011 16:45:19 +0100 Subject: jl164 #i109096# make patch::native_file_string_w windows only --- l10ntools/source/help/HelpCompiler.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 l10ntools/source/help/HelpCompiler.hxx diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx old mode 100644 new mode 100755 index 3426f914d2e6..8ce6098d21a9 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -102,13 +102,14 @@ namespace fs HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); return std::string(tmp.getStr()); } +#ifdef WNT wchar_t const * native_file_string_w() const { ::rtl::OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(data, ustrSystemPath); return ustrSystemPath.getStr(); } - +#endif std::string native_directory_string() const { return native_file_string(); } std::string toUTF8() const { -- cgit From 6b907a7f7a788731268b4f612e8d8a9fd053d049 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 2 Mar 2011 17:23:32 +0100 Subject: jl164 #i109096# wrong use of path::native_file_string_w in fopen for Linux --- l10ntools/source/help/HelpLinker.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 2c7fa51657e8..036208520ede 100755 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -242,7 +242,7 @@ public: #ifdef WNT //We need _wfopen to support long file paths on Windows XP FILE* pFile = _wfopen( rFileName.native_file_string_w(), L"wb" ); #else - FILE* pFile = fopen( rFileName.native_file_string_w().c_str(), "wb" ); + FILE* pFile = fopen( rFileName.native_file_string().c_str(), "wb" ); #endif if( pFile == NULL ) return; -- cgit From 341b1c22be91db5be26c28bdd8da03f279b86329 Mon Sep 17 00:00:00 2001 From: iha Date: Wed, 2 Mar 2011 22:04:54 +0100 Subject: chart55: #i112752# warning error --- sc/source/ui/unoobj/chart2uno.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 7fec2d653ca7..edc47f6c7a58 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1079,7 +1079,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequenceFro xResult->setLabel( xLabelSeq ); } } - catch( uno::Exception& ex ) + catch( const uno::Exception& ) { } } -- cgit From e4aa69025215074e4be1fdd9b501f34361a064f4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Mar 2011 10:42:58 +0100 Subject: debuglevels: open the smoketest doc read-only --- smoketestoo_native/smoketest.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx index a4e532123456..5fd16914b0d7 100755 --- a/smoketestoo_native/smoketest.cxx +++ b/smoketestoo_native/smoketest.cxx @@ -151,13 +151,18 @@ void Test::test() { CPPUNIT_ASSERT( test::getTestArgument( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("smoketest.doc")), &doc)); - css::uno::Sequence< css::beans::PropertyValue > args(1); + css::uno::Sequence< css::beans::PropertyValue > args(2); args[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")); args[0].Handle = -1; args[0].Value <<= com::sun::star::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; args[0].State = css::beans::PropertyState_DIRECT_VALUE; + args[1].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); + args[1].Handle = -1; + args[1].Value <<= sal_True; + args[1].State = css::beans::PropertyState_DIRECT_VALUE; css::util::URL url; url.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( -- cgit From a0fe7aceae7db1bef6c6af205094e34a911df7c1 Mon Sep 17 00:00:00 2001 From: "Marc Neumann [msc]" Date: Thu, 3 Mar 2011 11:09:20 +0100 Subject: cws chart51: #i117182# add wait --- testautomation/graphics/required/includes/global/id_004.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testautomation/graphics/required/includes/global/id_004.inc b/testautomation/graphics/required/includes/global/id_004.inc index c06f88c682b8..d0d9ae63a545 100644 --- a/testautomation/graphics/required/includes/global/id_004.inc +++ b/testautomation/graphics/required/includes/global/id_004.inc @@ -244,8 +244,10 @@ testcase tiInsertGraphic DialogTest (GrafikEinfuegenDlg) printlog " use file: global\input\graf_inp\stabler.tif) " Dateiname.settext Convertpath (gTesttoolPath + "global\input\graf_inp\stabler.tif") + wait(1000) printlog "click 'open' " Oeffnen.click + wait(1000) catch Warnlog "Insert graphic doesn't work :-(" endcatch -- cgit From 7f7df1e785ec5e66d34e5179aa7b1c3447fac072 Mon Sep 17 00:00:00 2001 From: iha Date: Thu, 3 Mar 2011 11:37:57 +0100 Subject: chart55: #117183# bad autoscaling for date axis --- chart2/source/view/axes/ScaleAutomatism.cxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index 075ad16347c2..966ab27ec8bc 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -49,9 +49,16 @@ using ::com::sun::star::chart::TimeUnit::MONTH; using ::com::sun::star::chart::TimeUnit::YEAR; const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500; -const sal_Int32 MAXIMUM_AUTO_INCREMENT_COUNT = 10; const sal_Int32 MAXIMUM_SUB_INCREMENT_COUNT = 100; +sal_Int32 lcl_getMaximumAutoIncrementCount( sal_Int32 nAxisType ) +{ + sal_Int32 nMaximumAutoIncrementCount = 10; + if( nAxisType==AxisType::DATE ) + nMaximumAutoIncrementCount = MAXIMUM_MANUAL_INCREMENT_COUNT; + return nMaximumAutoIncrementCount; +} + namespace { @@ -102,7 +109,7 @@ ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale, const Date& rNu : m_aSourceScale( rSourceScale ) , m_fValueMinimum( 0.0 ) , m_fValueMaximum( 0.0 ) - , m_nMaximumAutoMainIncrementCount( MAXIMUM_AUTO_INCREMENT_COUNT ) + , m_nMaximumAutoMainIncrementCount( lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ) ) , m_bExpandBorderToIncrementRhythm( false ) , m_bExpandIfValuesCloseToBorder( false ) , m_bExpandWideValuesToZero( false ) @@ -149,8 +156,8 @@ void ScaleAutomatism::setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMa { if( nMaximumAutoMainIncrementCount < 2 ) m_nMaximumAutoMainIncrementCount = 2; //#i82006 - else if( nMaximumAutoMainIncrementCount > MAXIMUM_AUTO_INCREMENT_COUNT ) - m_nMaximumAutoMainIncrementCount = MAXIMUM_AUTO_INCREMENT_COUNT; + else if( nMaximumAutoMainIncrementCount > lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ) ) + m_nMaximumAutoMainIncrementCount = lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ); else m_nMaximumAutoMainIncrementCount = nMaximumAutoMainIncrementCount; } @@ -692,6 +699,19 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis( nNumer = static_cast( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) ); if(nNumer<=0) nNumer=1; + if( rExplicitIncrement.MajorTimeInterval.TimeUnit == DAY ) + { + if( nNumer>2 && nNumer<7 ) + nNumer=7; + else if( nNumer>7 ) + { + rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH; + nDaysPerInterval = 31.0; + nNumer = static_cast( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) ); + if(nNumer<=0) + nNumer=1; + } + } rExplicitIncrement.MajorTimeInterval.Number = nNumer; nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval); } -- cgit From 0775f9eacec0e0758512c425c4e65190a651c3ae Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 3 Mar 2011 12:04:04 +0100 Subject: jl164 #i109096# fixing use of vectors as smart array in osl_loadModules and osl_createprocesswithredirectedio, I introduced them in one of the previous changesets in this cws --- sal/osl/w32/module.cxx | 6 +++--- sal/osl/w32/procimpl.cxx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx index 00737ebbbaa4..65a17eb1352d 100755 --- a/sal/osl/w32/module.cxx +++ b/sal/osl/w32/module.cxx @@ -80,13 +80,13 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod { std::vector > vec(Module->length + 1); DWORD len = GetShortPathNameW(reinterpret_cast(Module->buffer), - vec.begin(), Module->length + 1); + &vec[0], Module->length + 1); if (len ) { - hInstance = LoadLibraryW(vec.begin()); + hInstance = LoadLibraryW(&vec[0]); if (hInstance == NULL) - hInstance = LoadLibraryExW(vec.begin(), NULL, + hInstance = LoadLibraryExW(&vec[0], NULL, LOAD_WITH_ALTERED_SEARCH_PATH); } } diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index 13e7141edbad..a2f86422df2a 100755 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -314,7 +314,7 @@ namespace /* private */ std::vector > vec(path.getLength() + 1); //GetShortPathNameW only works if the file can be found! const DWORD len = GetShortPathNameW( - path.getStr(), vec.begin(), path.getLength() + 1); + path.getStr(), &vec[0], path.getLength() + 1); if (!len && GetLastError() == ERROR_FILE_NOT_FOUND && extension.getLength()) @@ -323,12 +323,12 @@ namespace /* private */ std::vector > vec2( extPath.getLength() + 1); const DWORD len2 = GetShortPathNameW( - extPath.getStr(), vec2.begin(), extPath.getLength() + 1); - ret = rtl::OUString(vec2.begin(), len2); + extPath.getStr(), &vec2[0], extPath.getLength() + 1); + ret = rtl::OUString(&vec2[0], len2); } else { - ret = rtl::OUString(vec.begin(), len); + ret = rtl::OUString(&vec[0], len); } } return ret; -- cgit From 15e9295ad80329dfa018a79c1d054479d553171b Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Thu, 3 Mar 2011 12:06:51 +0100 Subject: chart55: #117185# legend entries get lost after moving the legend --- chart2/source/view/main/VLegend.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 chart2/source/view/main/VLegend.cxx diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx old mode 100644 new mode 100755 index 33e1d1f26aa4..12548e888fec --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -918,8 +918,8 @@ void VLegend::createShapes( RelativeSize aRelativeSize; if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize)) { - aLegendSize.Width = aRelativeSize.Primary * rPageSize.Width; - aLegendSize.Height = aRelativeSize.Secondary * rPageSize.Height; + aLegendSize.Width = ::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width ); + aLegendSize.Height = ::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height ); } else eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH; -- cgit From 62b71564201e2df91fc9bb677b097c8fdeadba8b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Mar 2011 15:22:23 +0100 Subject: debuglevels: introduce SfxModule::GetModuleFieldUnit, taking an XFrame, to not rely on SfxObjectShell::Current, which is implicitly used by SfxModule::GetCurrentFieldUnit, and might (like all this static crap) fail unforseeably. Use this new method in the Metric Field (to be used in toolbars) and the Pos/Size status bar control. Finally, this prevents a sporadic assertion during the smoketest, where GetCurrentFieldUnit fails for whatever reasons --- sfx2/inc/sfx2/module.hxx | 12 ++++++++++++ sfx2/source/appl/module.cxx | 34 ++++++++++++++++++++++++++++++++++ svx/source/stbctrls/pszctrl.cxx | 2 +- svx/source/tbxctrls/itemwin.cxx | 4 ++-- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index f944b29c18da..5551df850ff2 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -34,6 +34,7 @@ #include #include #include +#include class ImageList; @@ -56,6 +57,9 @@ class SfxStbCtrlFactArr_Impl; class SfxTabPage; class Window; +namespace com { namespace sun { namespace star { namespace frame { + class XFrame; +} } } } //==================================================================== class SFX2_DLLPUBLIC SfxModule : public SfxShell @@ -97,6 +101,14 @@ public: static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL ); static FieldUnit GetCurrentFieldUnit(); + /** retrieves the field unit of the module belonging to the document displayed in the given frame + + Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to + the document in this frame, then this module's field unit. + + Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned. + */ + static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame ); FieldUnit GetFieldUnit() const; //#if 0 // _SOLAR__PRIVATE diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 90b93cc3748e..87953e134292 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -51,6 +51,7 @@ #include #include "sfx2/taskpane.hxx" #include +#include #define SfxModule #include "sfxslots.hxx" @@ -423,6 +424,39 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame ) return pSh ? pSh->GetModule() : 0; } +FieldUnit SfxModule::GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame ) +{ + ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FUNIT_100TH_MM ); + + // find SfxViewFrame for the given XFrame + SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(); + while ( pViewFrame != NULL ) + { + if ( pViewFrame->GetFrame().GetFrameInterface() == i_frame ) + break; + pViewFrame = SfxViewFrame::GetNext( *pViewFrame ); + } + ENSURE_OR_RETURN( pViewFrame != NULL, "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", FUNIT_100TH_MM ); + + // find the module + SfxModule const * pModule = GetActiveModule( pViewFrame ); + ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM ); + + SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC ); + if ( pItem == NULL ) + { +#if OSL_DEBUG_LEVEL > 0 + ::rtl::OStringBuffer message; + message.append( "SfxModule::GetFieldUnit: no metric item in the module implemented by '" ); + message.append( typeid( *pModule ).name() ); + message.append( "'!" ); + OSL_ENSURE( false, message.makeStringAndClear().getStr() ); +#endif + return FUNIT_100TH_MM; + } + return (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); +} + FieldUnit SfxModule::GetCurrentFieldUnit() { FieldUnit eUnit = FUNIT_INCH; diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 094cfbd96ee5..d1bc7d4d610e 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -78,7 +78,7 @@ String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal ) { // Applikations-Metrik besorgen und setzen - FieldUnit eOutUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eOutUnit = SfxModule::GetModuleFieldUnit( getFrameInterface() ); FieldUnit eInUnit = FUNIT_100TH_MM; String sMetric; diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 76fd7d423324..7666c1064e15 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -491,7 +491,7 @@ SvxMetricField::SvxMetricField( SetLast( 5000 ); SetFirst( 0 ); - eDlgUnit = SfxModule::GetCurrentFieldUnit(); + eDlgUnit = SfxModule::GetModuleFieldUnit( mxFrame ); SetFieldUnit( *this, eDlgUnit, sal_False ); Show(); } @@ -576,7 +576,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit ) void SvxMetricField::RefreshDlgUnit() { - FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit(); + FieldUnit eTmpUnit = SfxModule::GetModuleFieldUnit( mxFrame ); if ( eDlgUnit != eTmpUnit ) { eDlgUnit = eTmpUnit; -- cgit From 271137c2c5d3bcacdee5cf15b8df9138345316ed Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 3 Mar 2011 17:01:11 +0100 Subject: #i117186# call unopkg sync when building type installed or archive with the proper arguments, remove assertion from framework for the case that there is no user installation. --- framework/source/services/substitutepathvars.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 framework/source/services/substitutepathvars.cxx diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx old mode 100644 new mode 100755 index 90c460b74298..7db60eb9dede --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -1170,12 +1170,12 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable } aState = utl::Bootstrap::locateUserData( sVal ); + //There can be the valid case that there is no user installation. For example, "unopkg sync" + //is currently (OOo3.4) run as part of the setup. Then no user installation is required. + //Therefore we do not assert here. if( aState == ::utl::Bootstrap::PATH_EXISTS ) { aPreDefPathVariables.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal ); } - else { - LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Bootstrap code has no value for userpath"); - } // Set $(inst), $(instpath), $(insturl) aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTURL ] = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ]; -- cgit From b38c5bfecfa7bbe3d57eceb8bbba4bfe11d5e93e Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 3 Mar 2011 17:01:11 +0100 Subject: #i117186# call unopkg sync when building type installed or archive with the proper arguments, remove assertion from framework for the case that there is no user installation. --- solenv/bin/modules/installer/simplepackage.pm | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) mode change 100644 => 100755 solenv/bin/modules/installer/simplepackage.pm diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm old mode 100644 new mode 100755 index d76b81a55850..6148c88de376 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -127,25 +127,7 @@ sub register_extensions if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); } - my $localtemppath = installer::systemactions::create_directories("uno", $languagestringref); - - my $slash = ""; - - if ( $installer::globals::iswindowsbuild ) - { - if ( $^O =~ /cygwin/i ) - { - $localtemppath = $installer::globals::cyg_temppath; - $preregdir = qx{cygpath -m "$preregdir"}; - chomp($preregdir); - } - $localtemppath =~ s/\\/\//g; - $slash = "/"; # Third slash for Windows. Other OS pathes already start with "/" - } - - $preregdir =~ s/\/\s*$//g; - - my $systemcall = $unopkgfile . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file://" . $slash . $preregdir . "\"" . " -env:UserInstallation=file://" . $slash . $localtemppath . " -env:UNO_JAVA_JFW_ENV_JREHOME=true 2\>\&1 |"; + my $systemcall = $unopkgfile . " sync --verbose" . " -env:UNO_JAVA_JFW_ENV_JREHOME=true 2\>\&1 |"; print "... $systemcall ...\n"; -- cgit From e3e1ee8f961c0ae9417d427e3214dfd00bcb8160 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 4 Mar 2011 11:59:28 +0100 Subject: chart55: #i117207# wrong layout with empty titles --- chart2/source/view/main/ChartView.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index ad20a557756c..ee915ceac688 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2198,12 +2198,9 @@ std::auto_ptr lcl_createTitle( TitleHelper::eTitleType eType } uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, xChartModel ) ); - if(xTitle.is()) + rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) ); + if( aCompleteString.getLength() != 0 ) { - rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) ); - if ( aCompleteString.getLength() == 0 ) - return apVTitle;//don't create empty titles as the resulting diagram position is wrong then - //create title apVTitle = std::auto_ptr(new VTitle(xTitle)); rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) ); -- cgit From d859498a6a61eaeb65b3fd36513f5dd435aa947c Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 4 Mar 2011 12:12:13 +0100 Subject: CWS swlayoutrefactoring: avoid gcc3 specific workaround for passing temporary objects by reference --- sw/inc/ddefld.hxx | 1 - sw/source/ui/fldui/fldmgr.cxx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx index 07215ff435ad..6fb7a76c3728 100644 --- a/sw/inc/ddefld.hxx +++ b/sw/inc/ddefld.hxx @@ -89,7 +89,6 @@ public: void DecRefCnt() { if( !--nRefCnt && pDoc ) _RefCntChgd(); } void SetCRLFDelFlag( sal_Bool bFlag = sal_True ) { bCRLFFlag = bFlag; } - SwDDEFieldType( const SwDDEFieldType& ); }; /*-------------------------------------------------------------------- diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index e01be411c866..ccf91732ccef 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1034,8 +1034,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) sal_uInt16 nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator ); sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos ); - SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType( - SwDDEFieldType( rData.sPar1, sCmd, (sal_uInt16)nFormatId )); + SwDDEFieldType aType( rData.sPar1, sCmd, (sal_uInt16) nFormatId ); + SwDDEFieldType* pTyp = (SwDDEFieldType*) pCurShell->InsertFldType( aType ); pFld = new SwDDEField( pTyp ); break; } -- cgit From ef450ae7ef29f69a51357e2c2d6a469355c58764 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 4 Mar 2011 12:12:50 +0100 Subject: CWS swlayoutrefactoring: forgotten commit --- sw/source/core/view/vnew.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index ef82ed0b81a5..1a1facac0817 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -144,7 +144,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt ) { // switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016 - pLayout->Init( pDoc->GetDfltFrmFmt(), this ); + pLayout->Init( pDoc->GetDfltFrmFmt() ); } } SizeChgNotify(); //swmod 071108 -- cgit From bde549822041c6599102a8d155e2760f7fa95c4c Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 4 Mar 2011 12:13:27 +0100 Subject: CWS swlayoutrefactoring: fix missing cursor update --- sw/source/core/crsr/crsrsh.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 744767d598b0..1a100eae0682 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -322,7 +322,7 @@ if( GetWin() ) sal_uInt16 nParm = SwCrsrShell::CHKRANGE; if ( !bIdleEnd ) nParm |= SwCrsrShell::SCROLLWIN; - if( !IsViewLocked() ) +// if( !IsViewLocked() ) UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen { -- cgit From 13b4336da80b66cce2f157d984da1632d142168a Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 4 Mar 2011 14:29:58 +0100 Subject: sb142: #i116738# ignore test stuff from the Python implementation --- python/prj/d.lst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/python/prj/d.lst b/python/prj/d.lst index def1bb84a414..e5c4d5bcb273 100644 --- a/python/prj/d.lst +++ b/python/prj/d.lst @@ -3,9 +3,6 @@ mkdir: %_DEST%\lib%_EXT%\python\lib-old mkdir: %_DEST%\lib%_EXT%\python\lib-tk mkdir: %_DEST%\lib%_EXT%\python\site-packages mkdir: %_DEST%\lib%_EXT%\python\encodings -mkdir: %_DEST%\lib%_EXT%\python\test -mkdir: %_DEST%\lib%_EXT%\python\test\output -mkdir: %_DEST%\lib%_EXT%\python\test\data mkdir: %_DEST%\lib%_EXT%\python\email mkdir: %_DEST%\lib%_EXT%\python\email\mime mkdir: %_DEST%\lib%_EXT%\python\compiler @@ -38,9 +35,6 @@ mkdir: %_DEST%\lib%_EXT%\python\ctypes\macholib ..\%__SRC%\misc\build\Python-2.6.1\Lib\lib-old\* %_DEST%\lib%_EXT%\python\lib-old\* ..\%__SRC%\misc\build\Python-2.6.1\Lib\lib-tk\* %_DEST%\lib%_EXT%\python\lib-tk\* ..\%__SRC%\misc\build\Python-2.6.1\Lib\site-packages\* %_DEST%\lib%_EXT%\python\site-packages\* -..\%__SRC%\misc\build\Python-2.6.1\Lib\test\* %_DEST%\lib%_EXT%\python\test\* -..\%__SRC%\misc\build\Python-2.6.1\Lib\test\output\* %_DEST%\lib%_EXT%\python\test\output\* -..\%__SRC%\misc\build\Python-2.6.1\Lib\test\data\* %_DEST%\lib%_EXT%\python\test\data\* ..\%__SRC%\misc\build\Python-2.6.1\Lib\encodings\* %_DEST%\lib%_EXT%\python\encodings\* ..\%__SRC%\misc\build\Python-2.6.1\Lib\email\* %_DEST%\lib%_EXT%\python\email\* ..\%__SRC%\misc\build\Python-2.6.1\Lib\email\mime\* %_DEST%\lib%_EXT%\python\email\mime\* -- cgit From 6b4fa7ab87c548c6e8e2a71c33a9e92cc8e194de Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 4 Mar 2011 20:16:58 +0100 Subject: chart55: #i117185# correct object size --- chart2/source/controller/main/ChartController_Position.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 37cbdbb30f6b..d42d3112f67c 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -62,7 +62,7 @@ using namespace ::com::sun::star::chart2; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& rPosAndSize, const awt::Size aOriginalSize ) +void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size aOriginalSize ) { long nPosX(0); long nPosY(0); @@ -121,7 +121,7 @@ void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& r break; } - rPosAndSize = Rectangle(Point(nPosX,nPosY),Size(nSizX,nSizY)); + rPosAndSize = awt::Rectangle(nPosX,nPosY,nSizX,nSizY); } void SAL_CALL ChartController::executeDispatch_PositionAndSize() @@ -166,19 +166,18 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize() const SfxItemSet* pOutItemSet = pDlg->GetOutputItemSet(); if(pOutItemSet) { - Rectangle aObjectRect; + awt::Rectangle aObjectRect; aItemSet.Put(*pOutItemSet);//overwrite old values with new values (-> all items are set) lcl_getPositionAndSizeFromItemSet( aItemSet, aObjectRect, aSelectedSize ); awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) ); - Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height ); + awt::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height ); bool bChanged = false; if ( eObjectType == OBJECTTYPE_LEGEND ) bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true ); bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel() - , awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight()) - , awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) ); + , aObjectRect, aPageRect ); if( bMoved || bChanged ) aUndoGuard.commit(); } -- cgit From 2e2bd7aab73bbf4402034569c6c5ab7d227d9c83 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 4 Mar 2011 20:28:00 +0100 Subject: chart55: #i117183# bad autoscaling for date axis --- chart2/source/view/axes/ScaleAutomatism.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index 966ab27ec8bc..0ca83bf354e9 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -109,7 +109,7 @@ ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale, const Date& rNu : m_aSourceScale( rSourceScale ) , m_fValueMinimum( 0.0 ) , m_fValueMaximum( 0.0 ) - , m_nMaximumAutoMainIncrementCount( lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ) ) + , m_nMaximumAutoMainIncrementCount( lcl_getMaximumAutoIncrementCount( rSourceScale.AxisType ) ) , m_bExpandBorderToIncrementRhythm( false ) , m_bExpandIfValuesCloseToBorder( false ) , m_bExpandWideValuesToZero( false ) -- cgit From 64ecad989408b3ff9a2a817f9ef94ec5c6770567 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 7 Mar 2011 18:21:00 +0100 Subject: vcl120: #i114306# enforce setting a new document printer --- sfx2/source/view/viewprn.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index b125efc87267..50fe40dd9e0d 100755 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -349,7 +349,12 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt if( bCopyJobSetup && mpViewShell ) { - SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_False); + // #i114306# + // Note: this possibly creates a printer that gets immediately replaced + // by a new one. The reason for this is that otherwise we would not get + // the printer's SfxItemSet here to copy. Awkward, but at the moment there is no + // other way here to get the item set. + SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_True); if( pDocPrt ) { if( pDocPrt->GetName() == getPrinter()->GetName() ) -- cgit From 8b87f892235d27a48e69a35e660846805254ac63 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 8 Mar 2011 12:55:52 +0100 Subject: l10n36: #i117281# add isocodes fur jbo kab nso ny so --- solenv/bin/modules/installer/globals.pm | 8 +++++++- solenv/inc/langlist.mk | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 1536cb993db0..41df76644874 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -43,6 +43,7 @@ BEGIN "km", "nr", "ns", + "nso", "rw", "ss", "st", @@ -88,7 +89,12 @@ BEGIN "ml", "as", "ast", - "ht" + "ht", + "jbo", + "fur", + "ny", + "so", + "kab" ); @items_at_modules = ("Files", "Dirs", "Unixlinks"); @asianlanguages = ("ja", "ko", "zh-CN", "zh-TW"); diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk index e3ac2e5065ff..4f311a1bec4a 100644 --- a/solenv/inc/langlist.mk +++ b/solenv/inc/langlist.mk @@ -59,6 +59,7 @@ eu \ fa \ fi \ fr \ +fur \ ga \ gd \ gl \ @@ -73,6 +74,7 @@ hu \ is \ it \ ja \ +jbo \ kid \ ky \ ka \ @@ -104,6 +106,7 @@ nn \ nr \ ns \ nso \ +ny \ om \ oms \ oc \ @@ -131,7 +134,7 @@ sq \ sk \ sl \ sh \ -son \ +so \ sr \ ss \ st \ -- cgit From a152eed1d2a226c83164c8d86bad135793fca896 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 8 Mar 2011 12:55:52 +0100 Subject: l10n36: #i117281# add isocodes fur jbo kab nso ny so --- setup_native/source/win32/msi-encodinglist.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index ebfe9371f59f..ea4baf3217fb 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -36,6 +36,7 @@ fi 1252 1035 fo 1252 1080 # Faroese fr 1252 1036 fr-CA 1252 3084 +fur 0 1585 ga 0 2108 # Irish gd 0 1084 # Gaelic (Scotland) gl 1252 1110 # Galician @@ -51,7 +52,9 @@ id 1252 1057 # Indonesian is 1252 1039 # Icelandic it 1252 1040 ja 932 1041 +jbo 0 1624 ka 0 1079 # Georgian +kab 0 1625 kid 1252 1033 # key id pseudo language kk 0 1087 km 0 1107 # Khmer @@ -84,6 +87,8 @@ nn 1252 2068 no 1252 1044 nr 0 1580 # Ndebele South ns 0 1132 # Northern Sotho (Sepedi) +nso 0 1132 +ny 0 1598 oc 1252 1154 # Occitan-lengadocian om 0 2162 or 0 1096 # Oriya @@ -116,6 +121,7 @@ st 0 1072 # Southern Sotho, Sutu sv 1252 1053 sw 1252 1089 # Swahili sw-TZ 1252 1089 # Swahili +so 0 1143 ta 0 1097 # Tamil ta-IN 0 1097 # Tamil te 0 1098 -- cgit From 4a8b8ee334507f89ed7b918fda1678b213f6609b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 8 Mar 2011 19:28:14 +0100 Subject: vcl120: #i115695# respond to a PrinterName property used by the application --- sfx2/source/view/viewprn.cxx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 50fe40dd9e0d..4c04ef0774e8 100755 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -80,13 +80,15 @@ class SfxPrinterController : public vcl::PrinterController, public SfxListener sal_Bool m_bOrigStatus; sal_Bool m_bNeedsChange; sal_Bool m_bApi; + sal_Bool m_bTempPrinter; util::DateTime m_aLastPrinted; ::rtl::OUString m_aLastPrintedBy; Sequence< beans::PropertyValue > getMergedOptions() const; const Any& getSelectionObject() const; public: - SfxPrinterController( const Any& i_rComplete, + SfxPrinterController( const boost::shared_ptr& i_rPrinter, + const Any& i_rComplete, const Any& i_rSelection, const Any& i_rViewProp, const Reference< view::XRenderable >& i_xRender, @@ -105,7 +107,8 @@ public: virtual void jobFinished( com::sun::star::view::PrintableState ); }; -SfxPrinterController::SfxPrinterController( const Any& i_rComplete, +SfxPrinterController::SfxPrinterController( const boost::shared_ptr& i_rPrinter, + const Any& i_rComplete, const Any& i_rSelection, const Any& i_rViewProp, const Reference< view::XRenderable >& i_xRender, @@ -113,7 +116,8 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, SfxViewShell* pView, const uno::Sequence< beans::PropertyValue >& rProps ) - : maCompleteSelection( i_rComplete ) + : PrinterController( i_rPrinter) + , maCompleteSelection( i_rComplete ) , maSelection( i_rSelection ) , mxRenderable( i_xRender ) , mpLastPrinter( NULL ) @@ -122,6 +126,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, , m_bOrigStatus( sal_False ) , m_bNeedsChange( sal_False ) , m_bApi(i_bApi) + , m_bTempPrinter( i_rPrinter.get() != NULL ) { if ( mpViewShell ) { @@ -339,7 +344,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt rBind.Invalidate( SID_PRINTDOC ); rBind.Invalidate( SID_PRINTDOCDIRECT ); rBind.Invalidate( SID_SETUPPRINTER ); - bCopyJobSetup = true; + bCopyJobSetup = ! m_bTempPrinter; break; } @@ -613,8 +618,21 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro aSelection <<= GetObjectShell()->GetModel(); Any aComplete( makeAny( GetObjectShell()->GetModel() ) ); Any aViewProp( makeAny( xController ) ); + boost::shared_ptr aPrt; - boost::shared_ptr pController( new SfxPrinterController( aComplete, + const beans::PropertyValue* pVal = rProps.getConstArray(); + for( sal_Int32 i = 0; i < rProps.getLength(); i++ ) + { + if( pVal[i].Name.equalsAscii( "PrinterName" ) ) + { + aPrt.reset( new Printer( pVal[i].Name ) ); + break; + } + } + + boost::shared_ptr pController( new SfxPrinterController( + aPrt, + aComplete, aSelection, aViewProp, GetRenderable(), -- cgit From b7f2542845387b1942f6cd4a592d85805416bdbb Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 10 Mar 2011 12:25:12 +0100 Subject: masterfix DEV300: #i10000# fixed configure --- configure | 18 ++++++------------ configure.in | 3 +-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/configure b/configure index c36bab52f5aa..f8c57a0e0727 100755 --- a/configure +++ b/configure @@ -12963,10 +12963,8 @@ echo "${ECHO_T}yes" >&6 if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/)); fi else if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`", so it can be a program name with args. -set dummy ${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`", so it can be a program name with args. +set dummy ${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then @@ -12982,8 +12980,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MINGWSTRIP="${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`" + ac_cv_prog_MINGWSTRIP="${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -13004,10 +13001,8 @@ fi fi if test -z "$ac_cv_prog_MINGWSTRIP"; then ac_ct_MINGWSTRIP=$MINGWSTRIP - # Extract the first word of "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`", so it can be a program name with args. -set dummy `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`; ac_word=$2 + # Extract the first word of "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`", so it can be a program name with args. +set dummy `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then @@ -13023,8 +13018,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MINGWSTRIP="`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`" + ac_cv_prog_ac_ct_MINGWSTRIP="`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi diff --git a/configure.in b/configure.in index ec4d9ce11df4..b9fec5b18f25 100644 --- a/configure.in +++ b/configure.in @@ -3484,8 +3484,7 @@ if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/)); fi else - AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | -$SED -e s/c++/strip/`, false) + AC_CHECK_TOOL(MINGWSTRIP, `echo $WITH_MINGWIN | $SED -e s/g++/strip/ | $SED -e s/c++/strip/`, false) fi if test "$MINGWSTRIP" = "false"; then AC_MSG_ERROR(MinGW32 binutils needed. Install them.) -- cgit From da4071958ce368e1798987e665e442b9ab2c7c69 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 10 Mar 2011 13:28:06 +0100 Subject: vcl120: #i114306# tweak defaultprinter behavior again --- vcl/source/gdi/print3.cxx | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index c917ea8aa718..3873cdc6cb14 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -333,30 +333,13 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr // setup printer - // if no specific printer is already set, create one - - // #i108686# - // in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs - // however if no printer was already set by the print job's originator, - // and this is an API job, then use the system default location (because - // this is the only sensible default available if the user has no means of changing - // the destination + // #i114306# changed behavior back from persistence + // if no specific printer is already set, create the default printer if( ! pController->getPrinter() ) { rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() ); - bool bSetJobSetup = true; - if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() ) - { - // get printer name from configuration - SettingsConfigItem* pItem = SettingsConfigItem::get(); - aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) ); - bSetJobSetup = false; - } - boost::shared_ptr pPrinter( new Printer( aPrinterName ) ); - if( bSetJobSetup ) - pPrinter->SetJobSetup( i_rInitSetup ); + pPrinter->SetJobSetup( i_rInitSetup ); pController->setPrinter( pPrinter ); } -- cgit From 46696fc052f9501ed5bbb753cc4bfff4ac34db8a Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 11 Mar 2011 11:50:00 +0100 Subject: masterfix DEV300: #i10000# all -> allandcheck --- solenv/gbuild/extensions/post_PackModule.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/extensions/post_PackModule.mk b/solenv/gbuild/extensions/post_PackModule.mk index 3a573cbc5d7e..f39268a9eea7 100644 --- a/solenv/gbuild/extensions/post_PackModule.mk +++ b/solenv/gbuild/extensions/post_PackModule.mk @@ -41,7 +41,7 @@ packmodule : COMMAND := true endif endef -packmodule : all deliverlog +packmodule : allandcheck deliverlog $(eval $(call gb_PackModule_setpackmodulecommand)) $(COMMAND) -- cgit From e1b5567864cabc199a594b2376fb40b2288c36a1 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 11 Mar 2011 16:56:10 +0100 Subject: vcl120: #i115695# fix a stupid error --- sfx2/source/view/viewprn.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4c04ef0774e8..b91e8b4848ba 100755 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -625,7 +625,9 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro { if( pVal[i].Name.equalsAscii( "PrinterName" ) ) { - aPrt.reset( new Printer( pVal[i].Name ) ); + rtl::OUString aPrinterName; + pVal[i].Value >>= aPrinterName; + aPrt.reset( new Printer( aPrinterName ) ); break; } } -- cgit From 8f5e5867a9b31120502e59367b2f9d407390abdb Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 14 Mar 2011 11:15:36 +0100 Subject: a little less flicker --- framework/source/services/backingwindow.cxx | 57 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 27 deletions(-) mode change 100644 => 100755 framework/source/services/backingwindow.cxx diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx old mode 100644 new mode 100755 index 1d1e877a5a86..780efb1f3c6d --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -400,7 +400,7 @@ void BackingWindow::prepareRecentFileMenu() void BackingWindow::initBackground() { - SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() ); + SetBackground(); bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode(); if( bDark ) @@ -707,36 +707,39 @@ void BackingWindow::layoutButton( void BackingWindow::Paint( const Rectangle& ) { + Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() ); + Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); + Rectangle aBmpRect(maControlRect); + aBmpRect.Left() -= nShadowLeft; + aBmpRect.Top() -= nShadowTop; + aBmpRect.Right() += nShadowRight; + aBmpRect.Bottom() += nShadowBottom; + aClip.Exclude( aBmpRect ); + Push( PUSH_CLIPREGION ); + IntersectClipRegion( aClip ); + DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack ); + Pop(); + + VirtualDevice aDev( *this ); + aDev.EnableRTL( IsRTLEnabled() ); + aDev.SetOutputSizePixel( aBmpRect.GetSize() ); + Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() ); + aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); // draw bitmap - if( GetSettings().GetLayoutRTL() ) + Point aTL( 0, 0 ); + aDev.DrawBitmapEx( aTL, maBackgroundLeft ); + aTL.X() += maBackgroundLeft.GetSizePixel().Width(); + if( !!maBackgroundMiddle ) { - Point aTL( maControlRect.TopLeft() ); - aTL.X() -= nShadowRight; - aTL.Y() -= nShadowTop; - DrawBitmapEx( aTL, maBackgroundLeft ); - aTL.X() += maBackgroundLeft.GetSizePixel().Width(); - if( !!maBackgroundMiddle ) - { - DrawBitmapEx( aTL, maBackgroundMiddle ); - aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); - } - DrawBitmapEx( aTL, maBackgroundRight ); - } - else - { - Point aTL( maControlRect.TopLeft() ); - aTL.X() -= nShadowLeft; - aTL.Y() -= nShadowTop; - DrawBitmapEx( aTL, maBackgroundLeft ); - aTL.X() += maBackgroundLeft.GetSizePixel().Width(); - if( !!maBackgroundMiddle ) - { - DrawBitmapEx( aTL, maBackgroundMiddle ); - aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); - } - DrawBitmapEx( aTL, maBackgroundRight ); + aDev.DrawBitmapEx( aTL, maBackgroundMiddle ); + aTL.X() += maBackgroundMiddle.GetSizePixel().Width(); } + aDev.DrawBitmapEx( aTL, maBackgroundRight ); + + DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(), + Point( 0, 0 ), aBmpRect.GetSize(), + aDev ); } long BackingWindow::Notify( NotifyEvent& rNEvt ) -- cgit From 443380192320c23af71e31949158a6c252e57903 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 14 Mar 2011 13:55:57 +0100 Subject: masterfix DEV300: #i10000# make clean fix --- solenv/gbuild/gbuild.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 3c7010a32158..6d22074dc8e6 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -100,7 +100,7 @@ gb_ENABLE_PCH := $(false) endif # for clean, setuplocal and removelocal goals we switch off dependencies -ifneq ($(filter clean setuplocal removelocal showdeliverables,$(MAKECMDGOALS)),) +ifneq ($(filter cleanpackmodule clean setuplocal removelocal showdeliverables,$(MAKECMDGOALS)),) gb_FULLDEPS := $(false) else gb_FULLDEPS := $(true) -- cgit From 293ae23e7e69ed8fdff9a793cfbc111317b433a1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 14 Mar 2011 15:46:16 +0100 Subject: debuglevels: removed conflicting fix for a leaking WorkWindow - both changes together cause a crash --- sd/source/ui/framework/factories/BasicViewFactory.cxx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 8c2130c3005f..95c2833a2d12 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -50,7 +50,6 @@ #include #include #include -#include #include @@ -154,20 +153,6 @@ BasicViewFactory::BasicViewFactory ( BasicViewFactory::~BasicViewFactory (void) { - mpViewCache.reset(); - - Reference< awt::XWindow > xLocalPaneWindow( mxLocalPane->getWindow() ); - try - { - const Reference< XComponent > xLocalPaneComponent( mxLocalPane, UNO_QUERY_THROW ); - xLocalPaneComponent->dispose(); - const Reference< XComponent > xWindowComponent( xLocalPaneWindow, UNO_QUERY_THROW ); - xWindowComponent->dispose(); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } } -- cgit From d47730a56bbf27778558b86261dab9f0650c9c11 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 14 Mar 2011 16:01:46 +0100 Subject: masterfix DEV300: #i10000# always add gb_deliver.log to zip --- solenv/bin/packmodule | 1 + 1 file changed, 1 insertion(+) diff --git a/solenv/bin/packmodule b/solenv/bin/packmodule index d3ae30d48dcd..f2279cfed3f7 100755 --- a/solenv/bin/packmodule +++ b/solenv/bin/packmodule @@ -55,6 +55,7 @@ def main(args): deliverlog = open(os.path.join('inc', module, 'gb_deliver.log')) packedmodule = zipfile.ZipFile(os.path.join(zipdir,module+'.zip'), 'w') [packedmodule.write(path) for path in stripped_paths_to_pack(deliverlog)] + packedmodule.write(os.path.join('inc', module, 'gb_deliver.log')) packedmodule.close() if __name__ == "__main__": -- cgit From 7363d8a165443b6e8da150d193949e738daa9f05 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Mar 2011 15:26:25 +0100 Subject: vcl120: #i117267# better paper matching --- i18npool/source/paper/paper.cxx | 2 +- vcl/aqua/source/gdi/salprn.cxx | 22 +++++++++++++++++----- vcl/source/window/printdlg.cxx | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index 0d9235747fd6..aaac0e83a4eb 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -159,7 +159,7 @@ static PageDesc aDinTab[] = static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]); -#define MAXSLOPPY 11 +#define MAXSLOPPY 21 bool PaperInfo::doSloppyFit() { diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index a1d51376aa0b..ed80110cacc6 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -834,12 +834,24 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData ) for( unsigned int i = 0; i < nPapers; i++ ) { NSString* pPaper = [pPaperNames objectAtIndex: i]; - NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; - if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + // first try to match the name + rtl::OString aPaperName( [pPaper UTF8String] ); + Paper ePaper = PaperInfo::fromPSName( aPaperName ); + if( ePaper != PAPER_USER ) { - PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), - PtTo10Mu( aPaperSize.height ) ); - m_aPaperFormats.push_back( aInfo ); + m_aPaperFormats.push_back( PaperInfo( ePaper ) ); + } + else + { + NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; + if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + { + PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), + PtTo10Mu( aPaperSize.height ) ); + if( aInfo.getPaper() == PAPER_USER ) + aInfo.doSloppyFit(); + m_aPaperFormats.push_back( aInfo ); + } } } } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 98e93e748737..d38128e04f1e 100755 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2107,6 +2107,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); + preparePreview( true, false ); } else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) { -- cgit From 5bc52fffb70ccedd526703af4a151e2742812c4f Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Wed, 16 Mar 2011 13:12:46 +0100 Subject: DEV300 --- solenv/inc/minor.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index a1cbad32a4e0..19b8ca8eed4e 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=300 -RSCREVISION=300m102(Build:9577) -BUILD=9577 -LAST_MINOR=m102 +RSCREVISION=300m103(Build:9578) +BUILD=9578 +LAST_MINOR=m103 SOURCEVERSION=DEV300 -- cgit From f6c764706cd411d3353666da91b334a899a12154 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 16 Mar 2011 13:45:30 +0100 Subject: masterfix DEV300: #i10000# build breaker in sw --- sw/inc/editsh.hxx | 9 +-------- sw/inc/viewsh.hxx | 2 +- sw/source/core/edit/editsh.cxx | 8 ++++++++ sw/source/ui/inc/wrtsh.hxx | 2 ++ sw/source/ui/uno/unotxdoc.cxx | 2 -- sw/source/ui/wrtsh/wrtsh1.cxx | 9 +++++++++ 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index d75839f5736c..43992dc7b359 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -564,7 +564,7 @@ public: sal_Bool HasOtherCnt() const; // gibt es Rahmen, Fussnoten, ... /* Anwenden der ViewOptions mit Start-/EndAction */ - inline void ApplyViewOptions( const SwViewOption &rOpt ); + virtual void ApplyViewOptions( const SwViewOption &rOpt ); // Text innerhalb der Selektion erfragen // Returnwert liefert sal_False, wenn der selektierte Bereich @@ -940,13 +940,6 @@ private: const SwEditShell &operator=(const SwEditShell &); }; -inline void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt ) -{ - SwCrsrShell::StartAction(); - ViewShell::ApplyViewOptions( rOpt ); - SwEditShell::EndAction(); -} - inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const { return ((SwEditShell*)this)->GetLinkManager(); } diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 647a8f7f2048..2daf85092b40 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -439,7 +439,7 @@ public: void LayoutIdle(); inline const SwViewOption *GetViewOptions() const { return pOpt; } - void ApplyViewOptions( const SwViewOption &rOpt ); + virtual void ApplyViewOptions( const SwViewOption &rOpt ); void SetUIOptions( const SwViewOption &rOpt ); void SetReadonlyOption(sal_Bool bSet); // Readonly-Bit d. ViewOptions setzen void SetPDFExportOption(sal_Bool bSet); // set/reset PDF export mode diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index b90362cc906f..6465e703482f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1194,3 +1194,11 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const FOREACHPAM_END() } +void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt ) +{ + SwCrsrShell::StartAction(); + ViewShell::ApplyViewOptions( rOpt ); + SwEditShell::EndAction(); +} + + diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 70847d8d2e75..010c3792f258 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -452,6 +452,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); // die Core erzeugt eine Selektion, das SttSelect muss gerufen werden virtual void NewCoreSelection(); + virtual void ApplyViewOptions( const SwViewOption &rOpt ); + // autom. Update von Vorlagen void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet); void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index fd8944a77640..97d3f0756001 100755 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -4150,8 +4150,6 @@ SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOp SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() { m_rShell.ApplyViewOptions( m_aOldViewOptions ); - //#i115062# invalidate meta character slot - m_rShell.GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS ); } diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 465277890a28..21abeadfa5b1 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -98,6 +98,7 @@ #include #include #include +#include // -> #111827# #include @@ -1901,3 +1902,11 @@ String SwWrtShell::GetSelDescr() const return aResult; } +void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt ) +{ + SwFEShell::ApplyViewOptions( rOpt ); + //#i115062# invalidate meta character slot + GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS ); +} + + -- cgit From 78f80b020fe009bc48e9e5f8b7862de51f1f8381 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 16 Mar 2011 13:51:10 +0100 Subject: masterfix DEV300: #i117352#,#i10000# WaE converting to non-pointer type sal_uInt16 from NULL --- svl/source/undo/undo.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index af22c04c79ff..fae0250e9002 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -711,7 +711,7 @@ sal_uInt16 SfxUndoManager::GetUndoActionId() const DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" ); if ( m_pData->pActUndoArray->nCurUndoAction == 0 ) - return NULL; + return 0; return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId(); } -- cgit From 500204856e803133ad5214a3943f2f5d34dcb5a0 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 16 Mar 2011 14:02:20 +0100 Subject: masterfix DEV300: #i10000# fix damaged build.lst --- smoketestdoc/prj/build.lst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst index 57eb373dca9c..e778131427fe 100755 --- a/smoketestdoc/prj/build.lst +++ b/smoketestdoc/prj/build.lst @@ -1,4 +1,5 @@ smdoc smoketestdoc :: soltools codemaker unoil javaunohelper NULL smdoc smoketestdoc usr1 - all smdoc_mkout NULL +smdoc smoketestdoc nmake - all smdoc_main NULL smdoc smoketestdoc\data nmake - all smdoc_data NULL -smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL +smdoc smoketestdoc\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL -- cgit From 5d7f1bb1e74ae49ae7215588d836bd1ca2004b10 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 16 Mar 2011 16:16:13 +0100 Subject: masterfix DEV300: #i10000# fix build.lst, remove obsolete makefile.mk --- smoketestdoc/makefile.mk | 70 ---------------------------------------------- smoketestdoc/prj/build.lst | 1 - 2 files changed, 71 deletions(-) delete mode 100755 smoketestdoc/makefile.mk diff --git a/smoketestdoc/makefile.mk b/smoketestdoc/makefile.mk deleted file mode 100755 index 2096d07de90e..000000000000 --- a/smoketestdoc/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# 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. -# -#***********************************************************************/ - -PRJ = .. -PRJNAME = smoketestoo_native -TARGET = data - -.INCLUDE: settings.mk - -$(BIN)/smoketestdoc.sxw: $(MISC)/zip/smoketestdoc.sxw - $(COPY) $< $@ - -$(MISC)/zip/smoketestdoc.sxw: \ - Events.xml \ - Global.xml \ - OptionsDlg.xml \ - Test_10er.xml \ - Test_DB.xml \ - Test_Ext.xml \ - content.xml \ - dialog-lb.xml \ - dialog-lc.xml \ - manifest.xml \ - meta.xml \ - script-lb.xml \ - script-lc.xml \ - settings.xml \ - styles.xml - $(RM) -r $(MISC)/zip - $(MKDIR) $(MISC)/zip - $(COPY) content.xml meta.xml settings.xml styles.xml $(MISC)/zip/ - printf application/vnd.sun.xml.writer > $(MISC)/zip/mimetype - $(MKDIR) $(MISC)/zip/META-INF - $(COPY) manifest.xml $(MISC)/zip/META-INF/ - $(MKDIR) $(MISC)/zip/Basic - $(COPY) script-lc.xml $(MISC)/zip/Basic/ - $(MKDIR) $(MISC)/zip/Basic/Standard - $(COPY) script-lb.xml Events.xml Global.xml Test_10er.xml Test_DB.xml \ - Test_Ext.xml $(MISC)/zip/Basic/Standard/ - $(MKDIR) $(MISC)/zip/Dialogs - $(COPY) dialog-lc.xml $(MISC)/zip/Dialogs/ - $(MKDIR) $(MISC)/zip/Dialogs/Standard - $(COPY) dialog-lb.xml OptionsDlg.xml $(MISC)/zip/Dialogs/Standard/ - cd $(MISC)/zip && zip -rD $(@:f) . - -.INCLUDE: target.mk diff --git a/smoketestdoc/prj/build.lst b/smoketestdoc/prj/build.lst index e778131427fe..ec825ab48049 100755 --- a/smoketestdoc/prj/build.lst +++ b/smoketestdoc/prj/build.lst @@ -1,5 +1,4 @@ smdoc smoketestdoc :: soltools codemaker unoil javaunohelper NULL smdoc smoketestdoc usr1 - all smdoc_mkout NULL -smdoc smoketestdoc nmake - all smdoc_main NULL smdoc smoketestdoc\data nmake - all smdoc_data NULL smdoc smoketestdoc\com\sun\star\comp\smoketest nmake - all smdoc_ext NULL -- cgit From 5bda0f9a162f909ee7f818cf0a339fc64194ceee Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 17 Mar 2011 08:28:45 +0100 Subject: masterfix DEV300: #i10000# create misc/x64 directory missing --- solenv/inc/tg_wntx64.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solenv/inc/tg_wntx64.mk b/solenv/inc/tg_wntx64.mk index 12e049763a84..85f60c0f95a0 100644 --- a/solenv/inc/tg_wntx64.mk +++ b/solenv/inc/tg_wntx64.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -131,7 +131,7 @@ $(LIB2TARGET_X64) : $(LIB2FILES_X64) \ $(DEF1TARGETN_X64) : \ $(DEF1DEPN_X64) \ $(DEF1EXPORTFILE_X64) - @-$(MKDIR) $(MISC_X64) + @-$(MKDIR) $(MISC_X64) @-$(RM) $@.tmpfile @echo ------------------------------ @echo Making Module-Definitionfile : $@ @@ -210,7 +210,7 @@ $(DEF2TARGETN_X64) : \ SHL1VERSIONOBJ_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL1TARGET_X64))}$(VERSIONOBJ_X64:f) USE_VERSIONH_X64:=$(INCCOM)/$(SHL1VERSIONOBJ_X64:b).h SHL1VERSIONOBJDEP_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL1TARGET_X64))}$(VERSIONOBJ_X64:f) -$(MISC_X64)/$(SHL1VERSIONOBJ_X64:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL1VERSIONOBJ_X64:b).h +$(MISC_X64)/$(SHL1VERSIONOBJ_X64:b).c : make_x64_dirs $(SOLARENV)/src/version.c $(INCCOM)/$(SHL1VERSIONOBJ_X64:b).h $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ_X64:b).h/ > $@ .INIT : $(SHL1VERSIONOBJDEP_X64) .ENDIF @@ -354,7 +354,7 @@ ALLTAR : $(SHL2IMPLIBN_X64) SHL2VERSIONOBJ_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL2TARGET_X64))}$(VERSIONOBJ_X64:f) USE_VERSIONH_X64:=$(INCCOM)/$(SHL2VERSIONOBJ_X64:b).h SHL2VERSIONOBJDEP_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL2TARGET_X64))}$(VERSIONOBJ_X64:f) -$(MISC_X64)/$(SHL2VERSIONOBJ_X64:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL2VERSIONOBJ_X64:b).h +$(MISC_X64)/$(SHL2VERSIONOBJ_X64:b).c : make_x64_dirs $(SOLARENV)/src/version.c $(INCCOM)/$(SHL2VERSIONOBJ_X64:b).h $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ_X64:b).h/ > $@ .INIT : $(SHL2VERSIONOBJDEP_X64) .ENDIF -- cgit From e3511dc343c944530c6c48e6990b4f4f8d522535 Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 18 Mar 2011 07:22:29 +0100 Subject: masterfix DEV300: #i10000# fix for LAN" --- solenv/bin/cws.pl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/solenv/bin/cws.pl b/solenv/bin/cws.pl index c613d13bcbb1..62a6b2763761 100644 --- a/solenv/bin/cws.pl +++ b/solenv/bin/cws.pl @@ -407,16 +407,9 @@ sub hg_clone_cws_or_milestone my $masterws = $cws->master(); my ($master_local_source, $master_lan_source); - if ($rep_type eq "ooo" || $rep_type eq "so") - { - $master_local_source = "$hg_local_source/" . $masterws; - $master_lan_source = "$hg_lan_source/" . $masterws; - } - else - { - $master_local_source = "$hg_local_source/master_".$rep_type."/".$masterws; - $master_lan_source = "$hg_lan_source/master_".$rep_type."/".$masterws; - } + + $master_local_source = "$hg_local_source/" . $masterws; + $master_lan_source = "$hg_lan_source/" . $masterws; my $milestone_tag; if ( $clone_milestone_only ) { -- cgit