summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-06-13 15:22:56 +0200
committerMathias Bauer <mba@openoffice.org>2010-06-13 15:22:56 +0200
commitebc5777548dea42ed966a16c66d879b1485bbfb4 (patch)
treebbba6f44a8ddd5c25683de28f8c56331589a3bc1 /sw/inc
parenta572c2e12be5c2c40088269f3dc96e75e5912398 (diff)
CWS swlayoutrefactoring: #i81480#: enable sw code to use multiple layouts
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/IDocumentLayoutAccess.hxx9
-rw-r--r--sw/inc/doc.hxx25
-rwxr-xr-xsw/inc/docsh.hxx2
-rw-r--r--sw/inc/ndnotxt.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/node.hxx15
-rw-r--r--sw/inc/swcrsr.hxx4
-rw-r--r--sw/inc/txtftn.hxx3
-rwxr-xr-x[-rw-r--r--]sw/inc/viewopt.hxx16
-rwxr-xr-xsw/inc/viewsh.hxx12
10 files changed, 57 insertions, 33 deletions
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 <swtypes.hxx>
+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<SwRootFrm*> 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<sal_Int32>& 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
index f0036e7abf35..8037bec0f4de 100644..100755
--- 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 <ring.hxx>
#include <swrect.hxx>
#include <errhdl.hxx>
+#include <boost/shared_ptr.hpp>// swmod 080115
#include <vcl/mapmod.hxx>
#include <vcl/print.hxx>
@@ -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<SwRootFrm> 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