summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-06-05 08:44:38 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-01 13:30:10 +0200
commit378dc6ef20ffd0e657d78dbf6646d48059be4045 (patch)
treed4e50dfd3b492b8433f04da848fe0f7fd2f75859
parentc3f70303cf3725cfd64d3b07c0e7e895f8ac629d (diff)
Related: #i124638# Corrected relationship between DrawModel and...
DocShell in Writer, made SwDrawModel and handling more known (includes suspicious removal of setting SID_ATTR_LINEEND_WIDTH_DEFAULT) (cherry picked from commit a7ccadbf3b1ac378ca15d3630d48f48734700e5c) Conflicts: sw/inc/IDocumentDrawModelAccess.hxx sw/inc/doc.hxx sw/inc/docsh.hxx sw/inc/dpage.hxx sw/inc/drawdoc.hxx sw/source/core/access/accmap.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/docnew.cxx sw/source/core/draw/dcontact.cxx sw/source/core/draw/dpage.cxx sw/source/core/draw/drawdoc.cxx sw/source/core/frmedt/feshview.cxx sw/source/core/layout/fly.cxx sw/source/core/layout/frmtool.cxx sw/source/core/layout/newfrm.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/undo/docundo.cxx sw/source/core/undo/unattr.cxx sw/source/core/unocore/unodraw.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/view/vdraw.cxx sw/source/core/view/viewimp.cxx sw/source/core/view/viewsh.cxx sw/source/filter/html/htmldrawreader.cxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/rtf/swparrtf.cxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/rtfattributeoutput.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/ww8graf.cxx sw/source/filter/xml/swxml.cxx sw/source/filter/xml/xmlexp.cxx sw/source/filter/xml/xmlimp.cxx sw/source/ui/app/docshdrw.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uno/unodefaults.cxx sw/source/uibase/app/docst.cxx sw/source/uibase/app/docstyle.cxx sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx sw/source/uibase/lingu/sdrhhcwrap.cxx sw/source/uibase/shells/drwbassh.cxx sw/source/uibase/shells/frmsh.cxx sw/source/uibase/shells/grfsh.cxx sw/source/uibase/shells/textsh1.cxx sw/source/uibase/uno/unotxdoc.cxx sw/source/uibase/utlui/content.cxx Conflicts: sw/source/uibase/app/docshdrw.cxx Change-Id: Icb99eaa7bfb1eb8922a9fd928b5e4149821130dd
-rw-r--r--sw/inc/IDocumentDrawModelAccess.hxx10
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/inc/docsh.hxx6
-rw-r--r--sw/inc/dpage.hxx4
-rw-r--r--sw/inc/drawdoc.hxx6
-rw-r--r--sw/source/core/doc/DocumentDrawModelManager.cxx12
-rw-r--r--sw/source/core/doc/doc.cxx3
-rw-r--r--sw/source/core/doc/docfly.cxx3
-rw-r--r--sw/source/core/doc/doclay.cxx1
-rw-r--r--sw/source/core/doc/docnew.cxx9
-rw-r--r--sw/source/core/draw/dcontact.cxx1
-rw-r--r--sw/source/core/draw/dpage.cxx4
-rw-r--r--sw/source/core/draw/drawdoc.cxx40
-rw-r--r--sw/source/core/frmedt/feshview.cxx2
-rw-r--r--sw/source/core/inc/DocumentDrawModelManager.hxx12
-rw-r--r--sw/source/core/layout/frmtool.cxx1
-rw-r--r--sw/source/core/layout/newfrm.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx4
-rw-r--r--sw/source/core/undo/docundo.cxx4
-rw-r--r--sw/source/core/unocore/unodraw.cxx3
-rw-r--r--sw/source/core/unocore/unoframe.cxx6
-rw-r--r--sw/source/core/view/viewimp.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx2
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx3
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx9
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx7
-rw-r--r--sw/source/filter/xml/swxml.cxx1
-rw-r--r--sw/source/filter/xml/xmlexp.cxx3
-rw-r--r--sw/source/filter/xml/xmlimp.cxx4
-rw-r--r--sw/source/uibase/app/docsh.cxx3
-rw-r--r--sw/source/uibase/app/docshdrw.cxx66
-rw-r--r--sw/source/uibase/app/docshini.cxx5
-rw-r--r--sw/source/uibase/app/docst.cxx6
-rw-r--r--sw/source/uibase/app/docstyle.cxx5
-rw-r--r--sw/source/uibase/lingu/sdrhhcwrap.cxx1
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx4
-rw-r--r--sw/source/uibase/shells/frmsh.cxx2
-rw-r--r--sw/source/uibase/shells/grfsh.cxx5
-rw-r--r--sw/source/uibase/shells/textsh1.cxx8
-rw-r--r--sw/source/uibase/uiview/view.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx8
-rw-r--r--sw/source/uibase/utlui/content.cxx14
43 files changed, 151 insertions, 149 deletions
diff --git a/sw/inc/IDocumentDrawModelAccess.hxx b/sw/inc/IDocumentDrawModelAccess.hxx
index ad8415a4b91b..7cf0b8607965 100644
--- a/sw/inc/IDocumentDrawModelAccess.hxx
+++ b/sw/inc/IDocumentDrawModelAccess.hxx
@@ -22,7 +22,7 @@
#include <svx/svdtypes.hxx>
-class SwDrawDocument;
+class SwDrawModel;
class SdrPageView;
class IDocumentDrawModelAccess
@@ -31,10 +31,10 @@ public:
/** Draw Model and id accessors
*/
- virtual const SwDrawDocument* GetDrawModel() const = 0;
- virtual SwDrawDocument* GetDrawModel() = 0;
- virtual SwDrawDocument* _MakeDrawModel() = 0;
- virtual SwDrawDocument* GetOrCreateDrawModel() = 0;
+ virtual const SwDrawModel* GetDrawModel() const = 0;
+ virtual SwDrawModel* GetDrawModel() = 0;
+ virtual SwDrawModel* _MakeDrawModel() = 0;
+ virtual SwDrawModel* GetOrCreateDrawModel() = 0;
virtual SdrLayerID GetHeavenId() const = 0;
virtual SdrLayerID GetHellId() const = 0;
virtual SdrLayerID GetControlsId() const = 0;
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 37a6fda6bc59..2f84c0d44bea 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -87,7 +87,7 @@ class Outliner;
class OutputDevice;
class Point;
class SbxArray;
-class SdrModel;
+class SwDrawModel;
class SdrObject;
class SdrUndoAction;
class VirtualDevice;
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 2aeafa6912bd..4e03e15ad4ec 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -51,6 +51,12 @@ class IDocumentDeviceAccess;
class IDocumentSettingAccess;
class IDocumentTimerAccess;
class IDocumentChartDataProviderAccess;
+class SwDocShell;
+class SwDrawModel;
+
+// initialize DrawModel (in form of a SwDrawModel) and DocShell (in form of a SwDocShell)
+// as needed, one or both parameters may be zero
+void SAL_DLLPRIVATE InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawModel);
class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
{
diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx
index 38bd63eff62a..5881dd938a26 100644
--- a/sw/inc/dpage.hxx
+++ b/sw/inc/dpage.hxx
@@ -23,7 +23,7 @@
#include <svx/svdobj.hxx>
class SdrPageGridFrameList;
-class SwDrawDocument;
+class SwDrawModel;
class SwDoc;
class SwDPage : public FmFormPage, public SdrObjUserCall
@@ -32,7 +32,7 @@ class SwDPage : public FmFormPage, public SdrObjUserCall
SwDoc& rDoc;
public:
- SwDPage(SwDrawDocument& rNewModel, bool bMasterPage=false);
+ SwDPage(SwDrawModel& rNewModel, bool bMasterPage=false);
virtual ~SwDPage();
// #i3694#
diff --git a/sw/inc/drawdoc.hxx b/sw/inc/drawdoc.hxx
index f06d5b5be386..2bc65c6c0362 100644
--- a/sw/inc/drawdoc.hxx
+++ b/sw/inc/drawdoc.hxx
@@ -24,12 +24,12 @@
class SwDoc;
class SwDocShell;
-class SwDrawDocument : public FmFormModel
+class SwDrawModel : public FmFormModel
{
SwDoc* pDoc;
public:
- SwDrawDocument( SwDoc* pDoc );
- virtual ~SwDrawDocument();
+ SwDrawModel( SwDoc* pDoc );
+ virtual ~SwDrawModel();
const SwDoc& GetDoc() const { return *pDoc; }
SwDoc& GetDoc() { return *pDoc; }
diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx
index 7dc30f947837..2a8b56c53a9d 100644
--- a/sw/source/core/doc/DocumentDrawModelManager.cxx
+++ b/sw/source/core/doc/DocumentDrawModelManager.cxx
@@ -98,8 +98,8 @@ void DocumentDrawModelManager::InitDrawModel()
m_rSwdoc.GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
SAL_INFO( "sw.doc", "before create DrawDocument" );
- // The document owns the SwDrawDocument. We always have two layers and one page.
- mpDrawModel = new SwDrawDocument( &m_rSwdoc );
+ // The document owns the SwDrawModel. We always have two layers and one page.
+ mpDrawModel = new SwDrawModel( &m_rSwdoc );
mpDrawModel->EnableUndo( m_rSwdoc.GetIDocumentUndoRedo().DoesUndo() );
@@ -196,17 +196,17 @@ void DocumentDrawModelManager::ReleaseDrawModel()
-const SwDrawDocument* DocumentDrawModelManager::GetDrawModel() const
+const SwDrawModel* DocumentDrawModelManager::GetDrawModel() const
{
return mpDrawModel;
}
-SwDrawDocument* DocumentDrawModelManager::GetDrawModel()
+SwDrawModel* DocumentDrawModelManager::GetDrawModel()
{
return mpDrawModel;
}
-SwDrawDocument* DocumentDrawModelManager::_MakeDrawModel()
+SwDrawModel* DocumentDrawModelManager::_MakeDrawModel()
{
OSL_ENSURE( !mpDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
@@ -229,7 +229,7 @@ SwDrawDocument* DocumentDrawModelManager::_MakeDrawModel()
return mpDrawModel;
}
-SwDrawDocument* DocumentDrawModelManager::GetOrCreateDrawModel()
+SwDrawModel* DocumentDrawModelManager::GetOrCreateDrawModel()
{
return GetDrawModel() ? GetDrawModel() : _MakeDrawModel();
}
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 289b13fcfef3..cfe2ef95afd1 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -22,7 +22,6 @@
#include <DocumentDrawModelManager.hxx>
#include <UndoManager.hxx>
#include <hintids.hxx>
-
#include <tools/shl.hxx>
#include <tools/globname.hxx>
#include <svx/svxids.hrc>
@@ -117,11 +116,9 @@
#include <vector>
#include <map>
-
#include <osl/diagnose.h>
#include <osl/interlck.h>
#include <vbahelper/vbaaccesshelper.hxx>
-
#include "switerator.hxx"
/* @@@MAINTAINABILITY-HORROR@@@
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 31c9fe217ac9..f2b8466d2e1e 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -28,7 +28,6 @@
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <dcontact.hxx>
-
#include <ndgrf.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
@@ -447,7 +446,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
{
- SdrModel* pDrawModel = getIDocumentDrawModelAccess().GetOrCreateDrawModel();
+ SwDrawModel* pDrawModel = getIDocumentDrawModelAccess().GetOrCreateDrawModel();
SfxItemIter aIter(rSet);
for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem; pItem = aIter.NextItem())
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 52c62633ee08..bf97e7cf144d 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -37,7 +37,6 @@
#include <svx/svdouno.hxx>
#include <svx/fmpage.hxx>
#include <editeng/frmdiritem.hxx>
-
#include <swmodule.hxx>
#include <modcfg.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 882719e4060b..9ebd79715114 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -677,13 +677,20 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
}
mpLinkMgr->SetPersist( mpDocShell );
+
if( GetDocumentDrawModelManager().GetDrawModel() )
{
- ((SwDrawDocument*)GetDocumentDrawModelManager().GetDrawModel())->SetObjectShell( mpDocShell );
+ GetDocumentDrawModelManager().GetDrawModel()->SetObjectShell( mpDocShell );
GetDocumentDrawModelManager().GetDrawModel()->SetPersist( mpDocShell );
OSL_ENSURE( GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist(),
"draw model's persist is out of sync" );
}
+
+ // set DocShell pointer also on DrawModel
+ InitDrawModelAndDocShell(mpDocShell, GetDocumentDrawModelManager().GetDrawModel());
+ OSL_ENSURE(!GetDocumentDrawModelManager().GetDrawModel() ||
+ GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist(),
+ "draw model's persist is out of sync");
}
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 1734bb462572..ce33281b7031 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -67,6 +67,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <switerator.hxx>
#include <algorithm>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index d98bfd4d9929..b1cef170ae1c 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -48,7 +48,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::frame;
-SwDPage::SwDPage(SwDrawDocument& rNewModel, bool bMasterPage) :
+SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage) :
FmFormPage(rNewModel, bMasterPage),
pGridLst( 0 ),
rDoc(rNewModel.GetDoc())
@@ -83,7 +83,7 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
const SdrPageGridFrameList* SwDPage::GetGridFrameList(
const SdrPageView* pPV, const Rectangle *pRect ) const
{
- SwViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetCurrentViewShell();
+ SwViewShell *pSh = static_cast< SwDrawModel* >(GetModel())->GetDoc().GetCurrentViewShell();
while (pSh && pSh->Imp()->GetPageView() != pPV)
pSh = (SwViewShell*)pSh->GetNext();
if (pSh)
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 8090dfe770e5..149408b30275 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -49,7 +49,7 @@ const OUString GetPalettePath()
return aPathOpt.GetPalettePath();
}
-SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
+SwDrawModel::SwDrawModel( SwDoc* pD ) :
FmFormModel( ::GetPalettePath(), &pD->GetAttrPool(),
pD->GetDocShell(), true ),
pDoc( pD )
@@ -57,29 +57,9 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SetScaleUnit( MAP_TWIP );
SetSwapGraphics( true );
- SwDocShell* pDocSh = pDoc->GetDocShell();
- if ( pDocSh )
- {
- SetObjectShell( pDocSh );
- SvxColorListItem* pColItem = ( SvxColorListItem* )
- ( pDocSh->GetItem( SID_COLOR_TABLE ) );
- XColorListRef pXCol = pColItem ? pColItem->GetColorList() :
- XColorList::GetStdColorList();
- SetPropertyList( static_cast<XPropertyList *> (pXCol.get()) );
-
- if ( !pColItem )
- pDocSh->PutItem( SvxColorListItem( pXCol, SID_COLOR_TABLE ) );
-
- pDocSh->PutItem( SvxGradientListItem( GetGradientList(), SID_GRADIENT_LIST ));
- pDocSh->PutItem( SvxHatchListItem( GetHatchList(), SID_HATCH_LIST ) );
- pDocSh->PutItem( SvxBitmapListItem( GetBitmapList(), SID_BITMAP_LIST ) );
- pDocSh->PutItem( SvxDashListItem( GetDashList(), SID_DASH_LIST ) );
- pDocSh->PutItem( SvxLineEndListItem( GetLineEndList(), SID_LINEEND_LIST ) );
- pDocSh->PutItem( SfxUInt16Item(SID_ATTR_LINEEND_WIDTH_DEFAULT, 111) );
- SetObjectShell( pDocSh );
- }
- else
- SetPropertyList( static_cast<XPropertyList *> (XColorList::GetStdColorList().get()) );
+ // use common InitDrawModelAndDocShell which will set the associations as needed,
+ // including SvxColorTableItem with WhichID SID_COLOR_TABLE
+ InitDrawModelAndDocShell(pDoc ? pDoc->GetDocShell() : 0, this);
// copy all the default values to the SdrModel
SfxItemPool* pSdrPool = pD->GetAttrPool().GetSecondaryPool();
@@ -119,7 +99,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
// Destructor
-SwDrawDocument::~SwDrawDocument()
+SwDrawModel::~SwDrawModel()
{
Broadcast(SdrHint(HINT_MODELCLEARED));
@@ -133,25 +113,25 @@ SwDrawDocument::~SwDrawDocument()
*
* @return Pointer to the new page.
*/
-SdrPage* SwDrawDocument::AllocPage(bool bMasterPage)
+SdrPage* SwDrawModel::AllocPage(bool bMasterPage)
{
SwDPage* pPage = new SwDPage(*this, bMasterPage);
pPage->SetName(OUString("Controls"));
return pPage;
}
-uno::Reference<embed::XStorage> SwDrawDocument::GetDocumentStorage() const
+uno::Reference<embed::XStorage> SwDrawModel::GetDocumentStorage() const
{
return pDoc->GetDocStorage();
}
-SdrLayerID SwDrawDocument::GetControlExportLayerId( const SdrObject & ) const
+SdrLayerID SwDrawModel::GetControlExportLayerId( const SdrObject & ) const
{
//for versions < 5.0, there was only Hell and Heaven
return (SdrLayerID)pDoc->getIDocumentDrawModelAccess().GetHeavenId();
}
-uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
+uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
{
uno::Reference< uno::XInterface > xModel;
@@ -164,7 +144,7 @@ uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
}
catch( uno::RuntimeException& )
{
- OSL_FAIL( "<SwDrawDocument::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
+ OSL_FAIL( "<SwDrawModel::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
}
return xModel;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 0aca2c689059..7cb37cccf3d6 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -18,7 +18,6 @@
*/
#include "hintids.hxx"
-
#include <svx/sdrobjectfilter.hxx>
#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
@@ -80,6 +79,7 @@
#include <HandleAnchorNodeChg.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <switerator.hxx>
+#include <drawdoc.hxx>
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/Aspects.hpp>
diff --git a/sw/source/core/inc/DocumentDrawModelManager.hxx b/sw/source/core/inc/DocumentDrawModelManager.hxx
index d142c719bb0d..c9052e75867f 100644
--- a/sw/source/core/inc/DocumentDrawModelManager.hxx
+++ b/sw/source/core/inc/DocumentDrawModelManager.hxx
@@ -25,7 +25,7 @@
#include <boost/utility.hpp>
#include <svx/svdtypes.hxx>
-class SwDrawDocument;
+class SwDrawModel;
class SdrPageView;
class SwDoc;
@@ -44,10 +44,10 @@ public:
void DrawNotifyUndoHdl();
//IDocumentDrawModelAccess
- virtual const SwDrawDocument* GetDrawModel() const SAL_OVERRIDE;
- virtual SwDrawDocument* GetDrawModel() SAL_OVERRIDE;
- virtual SwDrawDocument* _MakeDrawModel() SAL_OVERRIDE;
- virtual SwDrawDocument* GetOrCreateDrawModel() SAL_OVERRIDE;
+ virtual const SwDrawModel* GetDrawModel() const SAL_OVERRIDE;
+ virtual SwDrawModel* GetDrawModel() SAL_OVERRIDE;
+ virtual SwDrawModel* _MakeDrawModel() SAL_OVERRIDE;
+ virtual SwDrawModel* GetOrCreateDrawModel() SAL_OVERRIDE;
virtual SdrLayerID GetHeavenId() const SAL_OVERRIDE;
virtual SdrLayerID GetHellId() const SAL_OVERRIDE;
virtual SdrLayerID GetControlsId() const SAL_OVERRIDE;
@@ -70,7 +70,7 @@ private:
SwDoc& m_rSwdoc;
- SwDrawDocument* mpDrawModel;
+ SwDrawModel* mpDrawModel;
/** Draw Model Layer IDs
* LayerIds, Heaven == above document
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index b47482329da4..0d0e8cee58a5 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -65,6 +65,7 @@
//UUUU
#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
+#include <drawdoc.hxx>
// ftnfrm.cxx:
void sw_RemoveFtns( SwFtnBossFrm* pBoss, bool bPageOnly, bool bEndNotes );
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 4aaa767a9b2a..23ab1796eae6 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -484,7 +484,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() );
bCallbackActionEnabled = false; // needs to be set to sal_True before leaving!
- SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMd )
{
// Disable "multiple layout"
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3678af7e5a55..2dde87b5fae2 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -79,10 +79,10 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-//UUUU
#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
#include <drawinglayer/processor2d/processor2dtools.hxx>
#include <ndtxt.hxx>
+#include <drawdoc.hxx>
#define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200)
@@ -7607,7 +7607,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* )
{
Graphic aRet;
- SdrModel *pMod = getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pMod = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMod )
{
SdrObject *pObj = FindSdrObject();
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index f097c2147075..a8733771ba39 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -20,9 +20,7 @@
#include <UndoManager.hxx>
#include <vcl/wrkwin.hxx>
-
#include <svx/svdmodel.hxx>
-
#include <swmodule.hxx>
#include <doc.hxx>
#include <drawdoc.hxx>
@@ -85,7 +83,7 @@ void UndoManager::DoUndo(bool const bDoUndo)
{
EnableUndo(bDoUndo);
- SdrModel *const pSdrModel = m_rDrawModelAccess.GetDrawModel();
+ SwDrawModel*const pSdrModel = m_rDrawModelAccess.GetDrawModel();
if( pSdrModel )
{
pSdrModel->EnableUndo(bDoUndo);
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 2717324d72ea..473aa361e8f3 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -65,6 +65,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <com/sun/star/drawing/PointSequence.hpp>
#include <switerator.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
@@ -828,7 +829,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage()
{
SolarMutexGuard aGuard;
// #i52858#
- SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
+ SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
SdrPage* pPage = pModel->GetPage( 0 );
{
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index bf9a249db400..f77b8af02cab 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -117,7 +117,6 @@
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
-//UUUU
#include <svx/unobrushitemhelper.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xbtmpit.hxx>
@@ -137,6 +136,7 @@
#include <svx/xflhtit.hxx>
#include <svx/xfltrit.hxx>
#include <swunohelper.hxx>
+#include <drawdoc.hxx>
// from fefly1.cxx
extern bool sw_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -1304,7 +1304,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject(SwFlyFrmFmt &rFmt)
{
SwDoc *pDoc = rFmt.GetDoc();
// #i52858# - method name changed
- SdrModel *pDrawModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
+ SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
SwFlyDrawContact* pContactObject
= new SwFlyDrawContact( &rFmt, pDrawModel );
pObject = pContactObject->GetMaster();
@@ -1691,7 +1691,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
{
SdrObject* pObject =
GetOrCreateSdrObject( (SwFlyFrmFmt&)*pFmt );
- SdrModel *pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel *pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
pDrawModel->GetPage(0)->
SetObjectOrdNum(pObject->GetOrdNum(), nZOrder);
}
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 34e15aab44bd..71e2a3e9c1b3 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -35,13 +35,13 @@
#include <accmap.hxx>
#include <pagepreviewlayout.hxx>
-
#include <comcore.hrc>
#include <svx/svdundo.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentDrawModelAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentSettingAccess.hxx>
+#include <drawdoc.hxx>
void SwViewImp::Init( const SwViewOption *pNewOpt )
{
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index cc802987f242..1b6b1e594536 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -757,7 +757,7 @@ void SwViewShell::SetAddExtLeading( bool bNew )
{
SwWait aWait( *GetDoc()->GetDocShell(), true );
pIDSA->set(IDocumentSettingAccess::ADD_EXT_LEADING, bNew );
- SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel();
if ( pTmpDrawModel )
pTmpDrawModel->SetAddExtLeading( bNew );
const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx
index a50926e589d0..346c94dcf78d 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -360,8 +360,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
// Ein DrawTxtobj anlegen
// #i52858# - method name changed
- SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
-
+ SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
SdrPage* pPg = pModel->GetPage( 0 );
pMarquee = SdrObjFactory::MakeNewObject( SdrInventor,
OBJ_TEXT, pPg, pModel );
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 6dabc9332613..3ac3a873f23b 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -31,7 +31,6 @@
#include <rtl/ustring.hxx>
#include <rtl/tencinfo.h>
#include <svtools/rtfkeywd.hxx>
-
#include <editeng/fontitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/adjustitem.hxx>
@@ -1716,7 +1715,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const sw::Frame& rFrame, const Poin
bool bSwapInPage = false;
if (!pSdrObj->GetPage())
{
- if (SdrModel* pModel = m_rExport.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
+ if (SwDrawModel* pModel = m_rExport.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
{
if (SdrPage* pPage = pModel->GetPage(0))
{
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index a7bef43797cf..9a97ae5cb4b9 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -96,6 +96,7 @@
#include "sfx2/sfxsids.hrc"
#include <svl/urihelper.hxx>
#include <unotools/saveopt.hxx>
+#include <drawdoc.hxx>
#include <algorithm>
@@ -1002,7 +1003,7 @@ sal_uInt32 WW8Export::GetSdrOrdNum( const SwFrmFmt& rFmt ) const
SwFrmFmt* pFmt = (SwFrmFmt*)&rFmt;
nOrdNum = pDoc->GetSpzFrmFmts()->GetPos( pFmt );
- const SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
if( pModel )
nOrdNum += pModel->GetPage( 0 )->GetObjCount();
}
@@ -2162,7 +2163,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType
void SwBasicEscherEx::Init()
{
MapUnit eMap = MAP_TWIP;
- if (SdrModel *pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
+ if (SwDrawModel *pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
{
// PPT arbeitet nur mit Einheiten zu 576DPI
// WW hingegen verwendet twips, dh. 1440DPI.
@@ -2296,7 +2297,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
bool bSwapInPage = false;
if (!pSdrObj->GetPage())
{
- if (SdrModel* pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
+ if (SwDrawModel* pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel())
{
if (SdrPage *pPage = pModel->GetPage(0))
{
@@ -3028,7 +3029,7 @@ void SwEscherEx::WriteOCXControl( const SwFrmFmt& rFmt, sal_uInt32 nShapeId )
{
OpenContainer( ESCHER_SpContainer );
- SdrModel *pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel *pModel = rWrt.pDoc->getIDocumentDrawModelAccess().GetDrawModel();
OutputDevice *pDevice = Application::GetDefaultDevice();
OSL_ENSURE(pModel && pDevice, "no model or device");
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c69ee3f5fbe2..b1c1f82f720b 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -23,12 +23,9 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <unotools/ucbstreamhelper.hxx>
-
#include <algorithm>
-
#include <map>
#include <set>
-
#include <hintids.hxx>
#include <string.h>
#include <osl/endian.h>
@@ -94,15 +91,11 @@
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
#include "ww8attributeoutput.hxx"
-
#include <IDocumentMarkAccess.hxx>
#include <xmloff/odffields.hxx>
-
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
-
#include "dbgoutsw.hxx"
-
#include <sfx2/docfile.hxx>
#include <sfx2/request.hxx>
#include <sfx2/frame.hxx>
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 50986594a290..afce16264c55 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -57,7 +57,6 @@
#include <unotextrange.hxx>
#include <swmodule.hxx>
#include <SwXMLSectionList.hxx>
-
#include <statstr.hrc>
#include <SwStyleNameMapper.hxx>
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 090c675d65f3..19fabca7d708 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -63,6 +63,7 @@
#include <IDocumentDrawModelAccess.hxx>
#include <pausethreadstarting.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -230,7 +231,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 )
{
//Auf die Korrektheit der OrdNums sind wir schon angewiesen.
- SdrModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
if( pModel )
pModel->GetPage( 0 )->RecalcObjOrdNums();
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 2e7d37038eb6..ad9a02197ecc 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -672,7 +672,7 @@ void SwXMLImport::startDocument()
pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); // #i52858# - method name changed
// SJ: #i49801# locking the modell to disable repaints
- SdrModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
if ( pDrawModel )
pDrawModel->setLock(true);
@@ -872,7 +872,7 @@ void SwXMLImport::endDocument( void )
pDoc->PrtOLENotify( true );
}
- SdrModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
if ( pDrawModel )
pDrawModel->setLock(false);
}
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index bffe05521330..b2998a10e7cb 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -71,6 +71,7 @@
#include <IDocumentUndoRedo.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
+#include <IDocumentDrawModelAccess.hxx>
#include <docstat.hxx>
#include <pagedesc.hxx>
#include <pview.hxx>
@@ -281,7 +282,7 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
}
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->getIDocumentDrawModelAccess().GetDrawModel() : 0);
delete pRdr;
diff --git a/sw/source/uibase/app/docshdrw.cxx b/sw/source/uibase/app/docshdrw.cxx
index f24a98dc63b1..2fcfac178864 100644
--- a/sw/source/uibase/app/docshdrw.cxx
+++ b/sw/source/uibase/app/docshdrw.cxx
@@ -33,25 +33,59 @@
using namespace ::com::sun::star;
// Load Document
-void SwDocShell::InitDraw()
+void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocument)
{
- SdrModel *pDrDoc = mpDoc->getIDocumentDrawModelAccess().GetDrawModel();
- if( pDrDoc )
+ if(pSwDrawDocument)
{
- // create Lists and Tables DocShell's ItemSet
- PutItem( SvxGradientListItem( pDrDoc->GetGradientList(), SID_GRADIENT_LIST ) );
- PutItem( SvxHatchListItem( pDrDoc->GetHatchList(), SID_HATCH_LIST ) );
- PutItem( SvxBitmapListItem( pDrDoc->GetBitmapList(), SID_BITMAP_LIST ) );
- PutItem( SvxDashListItem( pDrDoc->GetDashList(), SID_DASH_LIST ) );
- PutItem( SvxLineEndListItem( pDrDoc->GetLineEndList(), SID_LINEEND_LIST ) );
- PutItem( SvxColorListItem( pDrDoc->GetColorList(), SID_COLOR_TABLE ));
-
- Outliner& rOutliner = pDrDoc->GetDrawOutliner();
- uno::Reference<linguistic2::XHyphenator> xHyphenator( ::GetHyphenator() );
- rOutliner.SetHyphenator( xHyphenator );
+ if(pSwDocShell == pSwDrawDocument->GetObjectShell())
+ {
+ // association already done, nothing to do
+ }
+ else
+ {
+ // set object shell (mainly for FormControl stuff), maybe zero
+ pSwDrawDocument->SetObjectShell(pSwDocShell);
+
+ // set persist, maybe zero
+ pSwDrawDocument->SetPersist(pSwDocShell);
+
+ // get and decide on the color table to use
+ if(pSwDocShell)
+ {
+ const SvxColorListItem* pColItemFromDocShell = static_cast< const SvxColorListItem* >(pSwDocShell->GetItem(SID_COLOR_TABLE));
+
+ if(pColItemFromDocShell)
+ {
+ // the DocShell has a ColorTable, use it also in DrawingLayer
+ XColorListRef xCol(pColItemFromDocShell->GetColorList());
+ pSwDrawDocument->SetPropertyList(static_cast<XPropertyList*>(xCol.get()));
+ }
+ else
+ {
+ // Use the ColorTable which is used at the DrawingLayer's SdrModel
+ pSwDocShell->PutItem(SvxColorListItem(pSwDrawDocument->GetColorList(), SID_COLOR_TABLE));
+ }
+
+ // add other tables in SfxItemSet of the DocShell
+ pSwDocShell->PutItem(SvxGradientListItem(pSwDrawDocument->GetGradientList(), SID_GRADIENT_LIST));
+ pSwDocShell->PutItem(SvxHatchListItem(pSwDrawDocument->GetHatchList(), SID_HATCH_LIST));
+ pSwDocShell->PutItem(SvxBitmapListItem(pSwDrawDocument->GetBitmapList(), SID_BITMAP_LIST));
+ pSwDocShell->PutItem(SvxDashListItem(pSwDrawDocument->GetDashList(), SID_DASH_LIST));
+ pSwDocShell->PutItem(SvxLineEndListItem(pSwDrawDocument->GetLineEndList(), SID_LINEEND_LIST));
+ }
+
+ // init hyphenator for DrawingLayer outliner
+ uno::Reference<linguistic2::XHyphenator> xHyphenator(::GetHyphenator());
+ Outliner& rOutliner = pSwDrawDocument->GetDrawOutliner();
+
+ rOutliner.SetHyphenator(xHyphenator);
+ }
+ }
+ else if(pSwDocShell)
+ {
+ // fallback: add the default color list to have one when someone requests it from the DocShell
+ pSwDocShell->PutItem(SvxColorListItem(XColorList::GetStdColorList(), SID_COLOR_TABLE));
}
- else
- PutItem( SvxColorListItem( XColorList::GetStdColorList(), SID_COLOR_TABLE ));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index bc5b40a627b9..719282e6702e 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -61,6 +61,7 @@
#include <doc.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
+#include <IDocumentDrawModelAccess.hxx>
#include <docfac.hxx>
#include <docstyle.hxx>
#include <shellio.hxx>
@@ -549,7 +550,7 @@ bool SwDocShell::Load( SfxMedium& rMedium )
}
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->getIDocumentDrawModelAccess().GetDrawModel() : 0);
SetError( nErr, OUString( OSL_LOG_PREFIX ) );
bRet = !IsError( nErr );
@@ -615,7 +616,7 @@ void SwDocShell::SubInitNew()
OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" );
mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
UpdateFontList();
- InitDraw();
+ InitDrawModelAndDocShell(this, mpDoc ? mpDoc->getIDocumentDrawModelAccess().GetDrawModel() : 0);
mpDoc->getIDocumentSettingAccess().setLinkUpdateMode( GLOBALSETTING );
mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index b95e8e64e61a..0fe7bae54968 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -47,11 +47,8 @@
#include <SwRewriter.hxx>
#include <numrule.hxx>
#include <swundo.hxx>
-
-//UUUU
#include <svx/svdmodel.hxx>
#include <svx/drawitem.hxx>
-
#include "view.hxx"
#include "wrtsh.hxx"
#include "docsh.hxx"
@@ -77,7 +74,6 @@
#include "swevent.hxx"
#include "edtwin.hxx"
#include "unochart.hxx"
-
#include "app.hrc"
#include "swabstdlg.hxx"
@@ -754,7 +750,7 @@ sal_uInt16 SwDocShell::Edit(
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
SfxItemSet& rSet = xTmp->GetItemSet();
- const SdrModel* pDrawModel = GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pDrawModel = GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
rSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
rSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index ecc667fbda1c..146022b1e2b7 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -56,12 +56,11 @@
#include <svx/svxids.hrc>
#include <svx/xdef.hxx>
#include <SwRewriter.hxx>
-
-//UUUU
#include <svx/xfillit0.hxx>
#include <svx/xflftrit.hxx>
#include <svx/svdmodel.hxx>
#include <svx/drawitem.hxx>
+#include <drawdoc.hxx>
// The Format names in the list of all names have the
// following family as their first character:
@@ -1201,7 +1200,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
- const SdrModel* pDrawModel = rDoc.getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pDrawModel = rDoc.getIDocumentDrawModelAccess().GetDrawModel();
aCoreSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx
index 9875627404d2..0e801238545d 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx
@@ -44,6 +44,7 @@
#include <IDocumentDrawModelAccess.hxx>
#include <docary.hxx>
#include <edtwin.hxx>
+#include <drawdoc.hxx>
using namespace ::com::sun::star;
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 3be552931d23..3efcc94a07e3 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -50,7 +50,6 @@
#include <svx/svdogrp.hxx>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
-
#include <shells.hrc>
#define SwDrawBaseShell
#include <sfx2/msg.hxx>
@@ -63,7 +62,6 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
-
#include <IDocumentDrawModelAccess.hxx>
#include <boost/scoped_ptr.hpp>
@@ -609,7 +607,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
else
{
nRet = 1;
- SdrModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel();
SdrObjListIter aIter( *(pModel->GetPage(0)), IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
{
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index da54124baf8b..e58e37b680a8 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -445,7 +445,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
- const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
aSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index ed018dc31be2..0b17b5487602 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -26,7 +26,6 @@
#include <svl/urihelper.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/dispatch.hxx>
-
#include <sfx2/objface.hxx>
#include <editeng/sizeitem.hxx>
#include <editeng/protitem.hxx>
@@ -73,12 +72,10 @@
#include <doc.hxx>
#include <docsh.hxx>
#include <svx/drawitem.hxx>
-
#define SwGrfShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
-
#include "swabstdlg.hxx"
#include <boost/scoped_ptr.hpp>
@@ -241,7 +238,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
- const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
aSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 3bb5a6301840..76025c2af799 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -81,7 +81,6 @@
#include <edtwin.hxx>
#include <redlndlg.hxx>
#include "fldmgr.hxx"
-
#include <globals.hrc>
#include <shells.hrc>
#include <app.hrc>
@@ -91,15 +90,12 @@
#include <vcl/svapp.hxx>
#include <sfx2/app.hxx>
#include <breakit.hxx>
-
#include <SwSmartTagMgr.hxx>
-
#include <editeng/acorrcfg.hxx>
#include "swabstdlg.hxx"
#include "misc.hrc"
#include "chrdlg.hrc"
#include <IDocumentStatistics.hxx>
-
#include <sfx2/sfxdlg.hxx>
#include <unotools/lingucfg.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -120,10 +116,8 @@
#include <svx/nbdtmgfact.hxx>
#include <svx/nbdtmg.hxx>
-//UUUU
#include <svx/svdmodel.hxx>
#include <svx/drawitem.hxx>
-
#include <numrule.hxx>
#include <boost/scoped_ptr.hpp>
@@ -930,7 +924,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
// Do this after GetCurAttr, this resets the ItemSet content again
- const SdrModel* pDrawModel = GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ const SwDrawModel* pDrawModel = GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
aCoreSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 37060cc43eb7..1d0db016bb3c 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1633,8 +1633,8 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// regarded while switching from readonly-mode to edit-mode
if( !bReadonly )
{
- SwDrawDocument * pDrawDoc = 0;
- if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) ) )
+ SwDrawModel * pDrawDoc = GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ if (pDrawDoc)
{
if( !pDrawDoc->GetOpenInDesignMode() )
break;// don't touch the design mode
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index b61eb77d98f1..9ceee4566add 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1918,7 +1918,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
break;
case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel * pDrawDoc;
bool bAuto = *(sal_Bool*) aValue.getValue();
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
@@ -1938,7 +1938,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
break;
case WID_DOC_APPLY_FORM_DESIGN_MODE:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel * pDrawDoc;
bool bMode = *(sal_Bool*)aValue.getValue();
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
@@ -2088,7 +2088,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
break;
case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel * pDrawDoc;
bool bAuto;
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
bAuto = pDrawDoc->GetAutoControlFocus();
@@ -2099,7 +2099,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
break;
case WID_DOC_APPLY_FORM_DESIGN_MODE:
{
- SwDrawDocument * pDrawDoc;
+ SwDrawModel * pDrawDoc;
bool bMode;
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
bMode = pDrawDoc->GetOpenInDesignMode();
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index faf33712b038..c69eea0125f9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -413,7 +413,7 @@ void SwContentType::Init(bool* pbInvalidateWindow)
{
sTypeToken = OUString();
nMemberCount = 0;
- SdrModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel();
if(pModel)
{
SdrPage* pPage = pModel->GetPage(0);
@@ -741,7 +741,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
pMember->DeleteAndDestroyAll();
IDocumentDrawModelAccess* pIDDMA = pWrtShell->getIDocumentDrawModelAccess();
- SdrModel* pModel = pIDDMA->GetDrawModel();
+ SwDrawModel* pModel = pIDDMA->GetDrawModel();
if(pModel)
{
SdrPage* pPage = pModel->GetPage(0);
@@ -871,7 +871,7 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
const sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )
@@ -964,7 +964,7 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )
@@ -1408,7 +1408,7 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
SdrView* pDrawView = pActiveShell->GetDrawView();
if (pDrawView)
{
- SdrModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
@@ -2677,7 +2677,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
{
pDrawView->SdrEndTextEdit();//Change from "EndTextEdit" to "SdrEndTextEdit" for acc migration
- SdrModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+ SwDrawModel* pDrawModel = pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
bool hasObjectMarked = false;
@@ -3352,7 +3352,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
{
pDrawView->SdrEndTextEdit();
pDrawView->UnmarkAll();
- SdrModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel();
+ SwDrawModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel();
SdrPage* pPage = _pModel->GetPage(0);
sal_uInt32 nCount = pPage->GetObjCount();
for( sal_uInt32 i=0; i< nCount; i++ )