Commits

Anonymous committed 85111b8

cws swcoreseparation: #i117814#: remove last dependencies on docsh.hxx and unotxdoc.hxx from core and filter by providing static methods to create or retrieve an SwDoc

  • Participants
  • Parent commits c39e66e

Comments (0)

Files changed (20)

File Repository.mk

 	svx \
 	svxcore \
 	sw \
+	swcore \
 	swd \
 	swui \
 	textconversiondlgs \

File sw/Library_msword.mk

 
 $(eval $(call gb_Library_set_include,msword,\
 	-I$(SRCDIR)/sw/source/core/inc \
-	-I$(SRCDIR)/sw/source/ui/inc \
 	-I$(SRCDIR)/sw/source/filter/inc \
 	-I$(SRCDIR)/sw/inc/pch \
 	-I$(SRCDIR)/sw/inc \
 	svx \
 	svx \
 	svxcore \
-	sw \
 	tk \
 	tl \
 	ucbhelper \
     $(gb_STDLIBS) \
 ))
 
+# only for testing new core library
+ifneq ($(SWCORE),)
+$(eval $(call gb_Library_add_linked_libs,msword,\
+	swcore \
+))
+else
+$(eval $(call gb_Library_add_linked_libs,msword,\
+	sw \
+))
+endif
+
 $(eval $(call gb_Library_add_exception_objects,msword,\
 	sw/source/filter/rtf/rtffld \
 	sw/source/filter/rtf/rtffly \

File sw/Library_swcore.mk

+#*************************************************************************
+#
+# 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
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,swcore))
+
+$(eval $(call gb_Library_add_precompiled_header,swcore,$(SRCDIR)/sw/inc/pch/precompiled_sw))
+
+$(eval $(call gb_Library_set_include,swcore,\
+	-I$(SRCDIR)/sw/source/core/inc \
+	-I$(SRCDIR)/sw/source/filter/inc \
+	-I$(SRCDIR)/sw/inc/pch \
+	-I$(SRCDIR)/sw/inc \
+	$$(INCLUDE) \
+	-I$(OUTDIR)/inc/offuh \
+	-I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_set_defs,swcore,\
+	$$(DEFS) \
+	-DSW_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,swcore,\
+	avmedia \
+	basegfx \
+	comphelper \
+	cppu \
+	cppuhelper \
+	drawinglayer \
+	editeng \
+	i18nisolang1 \
+	i18nutil \
+	icuuc \
+	lng \
+	sal \
+	salhelper \
+	sb \
+	sfx \
+	sot \
+	stl \
+	svl \
+	svt \
+	svx \
+	svxcore \
+	tk \
+	tl \
+	ucbhelper \
+	utl \
+	vbahelper \
+	vcl \
+	vos3 \
+	xo \
+    $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,swcore,\
+	sw/source/core/SwNumberTree/SwNodeNum \
+	sw/source/core/SwNumberTree/SwNumberTree \
+	sw/source/core/access/acccell \
+	sw/source/core/access/acccontext \
+	sw/source/core/access/accdoc \
+	sw/source/core/access/accembedded \
+	sw/source/core/access/accfootnote \
+	sw/source/core/access/accframe \
+	sw/source/core/access/accframebase\
+	sw/source/core/access/accfrmobj \
+	sw/source/core/access/accfrmobjmap \
+	sw/source/core/access/accfrmobjslist \
+	sw/source/core/access/accgraphic \
+	sw/source/core/access/accheaderfooter \
+	sw/source/core/access/acchyperlink \
+	sw/source/core/access/acchypertextdata \
+	sw/source/core/access/accmap \
+	sw/source/core/access/accnotextframe \
+	sw/source/core/access/accpage \
+	sw/source/core/access/accpara \
+	sw/source/core/access/accportions \
+	sw/source/core/access/accpreview \
+	sw/source/core/access/accselectionhelper \
+	sw/source/core/access/acctable \
+	sw/source/core/access/acctextframe \
+	sw/source/core/access/parachangetrackinginfo \
+	sw/source/core/access/textmarkuphelper \
+	sw/source/core/attr/attrdesc \
+	sw/source/core/attr/calbck \
+	sw/source/core/attr/ccoll \
+	sw/source/core/attr/cellatr \
+	sw/source/core/attr/fmtfollowtextflow \
+	sw/source/core/attr/fmtwrapinfluenceonobjpos \
+	sw/source/core/attr/format \
+	sw/source/core/attr/hints \
+	sw/source/core/attr/shellres \
+	sw/source/core/attr/swatrset \
+	sw/source/core/attr/uiitems \
+	sw/source/core/bastyp/SwSmartTagMgr \
+	sw/source/core/bastyp/bparr \
+	sw/source/core/bastyp/breakit \
+	sw/source/core/bastyp/calc \
+	sw/source/core/bastyp/checkit \
+	sw/source/core/bastyp/index \
+	sw/source/core/bastyp/init \
+	sw/source/core/bastyp/ring \
+	sw/source/core/bastyp/swcache \
+	sw/source/core/bastyp/swrect \
+	sw/source/core/bastyp/swregion \
+	sw/source/core/bastyp/swtypes \
+	sw/source/core/bastyp/tabcol \
+	sw/source/core/config/caption \
+	sw/source/core/config/dbconfig \
+	sw/source/core/config/dbmgr \
+	sw/source/core/config/modcfg \
+	sw/source/core/config/prtopt \
+	sw/source/core/config/swdbtoolsclient \
+	sw/source/core/config/usrpref \
+	sw/source/core/crsr/BlockCursor \
+	sw/source/core/crsr/bookmrk \
+	sw/source/core/crsr/callnk \
+	sw/source/core/crsr/crbm \
+	sw/source/core/crsr/crossrefbookmark \
+	sw/source/core/crsr/crsrsh \
+	sw/source/core/crsr/crstrvl \
+	sw/source/core/crsr/crstrvl1 \
+	sw/source/core/crsr/findattr \
+	sw/source/core/crsr/findcoll \
+	sw/source/core/crsr/findfmt \
+	sw/source/core/crsr/findtxt \
+	sw/source/core/crsr/pam \
+	sw/source/core/crsr/paminit \
+	sw/source/core/crsr/swcrsr \
+	sw/source/core/crsr/trvlcol \
+	sw/source/core/crsr/trvlfnfl \
+	sw/source/core/crsr/trvlreg \
+	sw/source/core/crsr/trvltbl \
+	sw/source/core/crsr/unocrsr \
+	sw/source/core/crsr/viscrs \
+	sw/source/core/doc/SwStyleNameMapper \
+	sw/source/core/doc/acmplwrd \
+	sw/source/core/doc/dbgoutsw \
+	sw/source/core/doc/doc \
+	sw/source/core/doc/docbasic \
+	sw/source/core/doc/docbm \
+	sw/source/core/doc/docchart \
+	sw/source/core/doc/doccomp \
+	sw/source/core/doc/doccorr \
+	sw/source/core/doc/docdde \
+	sw/source/core/doc/docdesc \
+	sw/source/core/doc/docdraw \
+	sw/source/core/doc/docedt \
+	sw/source/core/doc/docfld \
+	sw/source/core/doc/docfly \
+	sw/source/core/doc/docfmt \
+	sw/source/core/doc/docftn \
+	sw/source/core/doc/docglos \
+	sw/source/core/doc/doclay \
+	sw/source/core/doc/docnew \
+	sw/source/core/doc/docnum \
+	sw/source/core/doc/docredln \
+	sw/source/core/doc/docruby \
+	sw/source/core/doc/docsort \
+	sw/source/core/doc/docstat \
+	sw/source/core/doc/doctxm \
+	sw/source/core/doc/docxforms \
+	sw/source/core/doc/extinput \
+	sw/source/core/doc/fmtcol \
+	sw/source/core/doc/ftnidx \
+	sw/source/core/doc/gctable \
+	sw/source/core/doc/htmltbl \
+	sw/source/core/doc/lineinfo \
+	sw/source/core/doc/list \
+	sw/source/core/doc/notxtfrm \
+	sw/source/core/doc/number \
+	sw/source/core/doc/poolfmt \
+	sw/source/core/doc/sortopt \
+	sw/source/core/doc/swserv \
+	sw/source/core/doc/swstylemanager \
+	sw/source/core/doc/tblafmt \
+	sw/source/core/doc/tblcpy \
+	sw/source/core/doc/tblrwcl \
+	sw/source/core/doc/visiturl \
+	sw/source/core/docnode/cancellablejob \
+	sw/source/core/docnode/finalthreadmanager \
+	sw/source/core/docnode/ndcopy \
+	sw/source/core/docnode/ndindex \
+	sw/source/core/docnode/ndnotxt \
+	sw/source/core/docnode/ndnum \
+	sw/source/core/docnode/ndsect \
+	sw/source/core/docnode/ndtbl \
+	sw/source/core/docnode/ndtbl1 \
+	sw/source/core/docnode/node \
+	sw/source/core/docnode/node2lay \
+	sw/source/core/docnode/nodes \
+	sw/source/core/docnode/observablethread \
+	sw/source/core/docnode/pausethreadstarting \
+	sw/source/core/docnode/retrievedinputstreamdata \
+	sw/source/core/docnode/retrieveinputstream \
+	sw/source/core/docnode/retrieveinputstreamconsumer \
+	sw/source/core/docnode/section \
+	sw/source/core/docnode/swbaslnk \
+	sw/source/core/docnode/swthreadjoiner \
+	sw/source/core/docnode/swthreadmanager \
+	sw/source/core/docnode/threadlistener \
+	sw/source/core/docnode/threadmanager \
+	sw/source/core/draw/dcontact \
+	sw/source/core/draw/dflyobj \
+	sw/source/core/draw/dobjfac \
+	sw/source/core/draw/dpage \
+	sw/source/core/draw/drawdoc \
+	sw/source/core/draw/dview \
+	sw/source/core/edit/acorrect \
+	sw/source/core/edit/autofmt \
+	sw/source/core/edit/edatmisc \
+	sw/source/core/edit/edattr \
+	sw/source/core/edit/eddel \
+	sw/source/core/edit/edfcol \
+	sw/source/core/edit/edfld \
+	sw/source/core/edit/edfldexp \
+	sw/source/core/edit/edfmt \
+	sw/source/core/edit/edglbldc \
+	sw/source/core/edit/edglss \
+	sw/source/core/edit/editsh \
+	sw/source/core/edit/edlingu \
+	sw/source/core/edit/ednumber \
+	sw/source/core/edit/edredln \
+	sw/source/core/edit/edsect \
+	sw/source/core/edit/edtab \
+	sw/source/core/edit/edtox \
+	sw/source/core/edit/edundo \
+	sw/source/core/edit/edws \
+	sw/source/core/except/dbgloop \
+	sw/source/core/except/errhdl \
+	sw/source/core/fields/authfld \
+	sw/source/core/fields/cellfml \
+	sw/source/core/fields/chpfld \
+	sw/source/core/fields/dbfld \
+	sw/source/core/fields/ddefld \
+	sw/source/core/fields/ddetbl \
+	sw/source/core/fields/docufld \
+	sw/source/core/fields/expfld \
+	sw/source/core/fields/fldbas \
+	sw/source/core/fields/flddat \
+	sw/source/core/fields/flddropdown \
+	sw/source/core/fields/fldlst \
+	sw/source/core/fields/macrofld \
+	sw/source/core/fields/postithelper \
+	sw/source/core/fields/reffld \
+	sw/source/core/fields/scrptfld \
+	sw/source/core/fields/tblcalc \
+	sw/source/core/fields/textapi \
+	sw/source/core/fields/usrfld \
+	sw/source/core/frmedt/fecopy \
+	sw/source/core/frmedt/fedesc \
+	sw/source/core/frmedt/fefly1 \
+	sw/source/core/frmedt/feflyole \
+	sw/source/core/frmedt/feshview \
+	sw/source/core/frmedt/fetab \
+	sw/source/core/frmedt/fews \
+	sw/source/core/frmedt/tblsel \
+	sw/source/core/graphic/grfatr \
+	sw/source/core/graphic/ndgrf \
+	sw/source/core/layout/anchoreddrawobject \
+	sw/source/core/layout/anchoredobject \
+	sw/source/core/layout/atrfrm \
+	sw/source/core/layout/calcmove \
+	sw/source/core/layout/colfrm \
+	sw/source/core/layout/dbg_lay \
+	sw/source/core/layout/findfrm \
+	sw/source/core/layout/flowfrm \
+	sw/source/core/layout/fly \
+	sw/source/core/layout/flycnt \
+	sw/source/core/layout/flyincnt \
+	sw/source/core/layout/flylay \
+	sw/source/core/layout/flypos \
+	sw/source/core/layout/frmtool \
+	sw/source/core/layout/ftnfrm \
+	sw/source/core/layout/hffrm \
+	sw/source/core/layout/layact \
+	sw/source/core/layout/laycache \
+	sw/source/core/layout/layouter \
+	sw/source/core/layout/movedfwdfrmsbyobjpos \
+	sw/source/core/layout/newfrm \
+	sw/source/core/layout/objectformatter \
+	sw/source/core/layout/objectformatterlayfrm \
+	sw/source/core/layout/objectformattertxtfrm \
+	sw/source/core/layout/objstmpconsiderwrapinfl \
+	sw/source/core/layout/pagechg \
+	sw/source/core/layout/pagedesc \
+	sw/source/core/layout/paintfrm \
+	sw/source/core/layout/sectfrm \
+	sw/source/core/layout/softpagebreak \
+	sw/source/core/layout/sortedobjs \
+	sw/source/core/layout/sortedobjsimpl \
+	sw/source/core/layout/ssfrm \
+	sw/source/core/layout/swselectionlist \
+	sw/source/core/layout/tabfrm \
+	sw/source/core/layout/trvlfrm \
+	sw/source/core/layout/unusedf \
+	sw/source/core/layout/virtoutp \
+	sw/source/core/layout/wsfrm \
+	sw/source/core/objectpositioning/anchoredobjectposition \
+	sw/source/core/objectpositioning/ascharanchoredobjectposition \
+	sw/source/core/objectpositioning/environmentofanchoredobject \
+	sw/source/core/objectpositioning/tocntntanchoredobjectposition \
+	sw/source/core/objectpositioning/tolayoutanchoredobjectposition \
+	sw/source/core/ole/ndole \
+	sw/source/core/para/paratr \
+	sw/source/core/swg/SwXMLBlockExport \
+	sw/source/core/swg/SwXMLBlockImport \
+	sw/source/core/swg/SwXMLBlockListContext \
+	sw/source/core/swg/SwXMLTextBlocks \
+	sw/source/core/swg/SwXMLTextBlocks1 \
+	sw/source/core/swg/swblocks \
+	sw/source/core/table/swnewtable \
+	sw/source/core/table/swtable \
+	sw/source/core/text/EnhancedPDFExportHelper \
+	sw/source/core/text/SwGrammarMarkUp \
+	sw/source/core/text/atrstck \
+	sw/source/core/text/blink \
+	sw/source/core/text/frmcrsr \
+	sw/source/core/text/frmform \
+	sw/source/core/text/frminf \
+	sw/source/core/text/frmpaint \
+	sw/source/core/text/guess \
+	sw/source/core/text/inftxt \
+	sw/source/core/text/itradj \
+	sw/source/core/text/itratr \
+	sw/source/core/text/itrcrsr \
+	sw/source/core/text/itrform2 \
+	sw/source/core/text/itrpaint \
+	sw/source/core/text/itrtxt \
+	sw/source/core/text/noteurl \
+	sw/source/core/text/porexp \
+	sw/source/core/text/porfld \
+	sw/source/core/text/porfly \
+	sw/source/core/text/porglue \
+	sw/source/core/text/porlay \
+	sw/source/core/text/porlin \
+	sw/source/core/text/pormulti \
+	sw/source/core/text/porref \
+	sw/source/core/text/porrst \
+	sw/source/core/text/portox \
+	sw/source/core/text/portxt \
+	sw/source/core/text/redlnitr \
+	sw/source/core/text/txtcache \
+	sw/source/core/text/txtdrop \
+	sw/source/core/text/txtfld \
+	sw/source/core/text/txtfly \
+	sw/source/core/text/txtfrm \
+	sw/source/core/text/txtftn \
+	sw/source/core/text/txthyph \
+	sw/source/core/text/txtinit \
+	sw/source/core/text/txtio \
+	sw/source/core/text/txtpaint \
+	sw/source/core/text/txttab \
+	sw/source/core/text/widorp \
+	sw/source/core/text/wrong \
+	sw/source/core/tox/tox \
+	sw/source/core/tox/toxhlp \
+	sw/source/core/tox/txmsrt \
+	sw/source/core/txtnode/SwGrammarContact \
+	sw/source/core/txtnode/atrfld \
+	sw/source/core/txtnode/atrflyin \
+	sw/source/core/txtnode/atrftn \
+	sw/source/core/txtnode/atrref \
+	sw/source/core/txtnode/atrtox \
+	sw/source/core/txtnode/chrfmt \
+	sw/source/core/txtnode/fmtatr2 \
+	sw/source/core/txtnode/fntcache \
+	sw/source/core/txtnode/fntcap \
+	sw/source/core/txtnode/modeltoviewhelper \
+	sw/source/core/txtnode/ndhints \
+	sw/source/core/txtnode/ndtxt \
+	sw/source/core/txtnode/swfntcch \
+	sw/source/core/txtnode/swfont \
+	sw/source/core/txtnode/thints \
+	sw/source/core/txtnode/txatbase \
+	sw/source/core/txtnode/txatritr \
+	sw/source/core/txtnode/txtatr2 \
+	sw/source/core/txtnode/txtedt \
+	sw/source/core/undo/SwRewriter \
+	sw/source/core/undo/SwUndoField \
+	sw/source/core/undo/SwUndoFmt \
+	sw/source/core/undo/SwUndoPageDesc \
+	sw/source/core/undo/SwUndoTOXChange \
+	sw/source/core/undo/docundo \
+	sw/source/core/undo/rolbck \
+	sw/source/core/undo/unattr \
+	sw/source/core/undo/unbkmk \
+	sw/source/core/undo/undel \
+	sw/source/core/undo/undobj \
+	sw/source/core/undo/undobj1 \
+	sw/source/core/undo/undoflystrattr \
+	sw/source/core/undo/undraw \
+	sw/source/core/undo/unfmco \
+	sw/source/core/undo/unins \
+	sw/source/core/undo/unmove \
+	sw/source/core/undo/unnum \
+	sw/source/core/undo/unoutl \
+	sw/source/core/undo/unovwr \
+	sw/source/core/undo/unredln \
+	sw/source/core/undo/unsect \
+	sw/source/core/undo/unsort \
+	sw/source/core/undo/unspnd \
+	sw/source/core/undo/untbl \
+	sw/source/core/undo/untblk \
+	sw/source/core/unocore/RefreshListenerContainer \
+	sw/source/core/unocore/docstyle \
+	sw/source/core/unocore/SwXTextDefaults \
+	sw/source/core/unocore/TextCursorHelper  \
+	sw/source/core/unocore/XMLRangeHelper \
+	sw/source/core/unocore/swunohelper \
+	sw/source/core/unocore/unobkm \
+	sw/source/core/unocore/unochart \
+	sw/source/core/unocore/unocoll \
+	sw/source/core/unocore/unocrsrhelper \
+	sw/source/core/unocore/unodraw \
+	sw/source/core/unocore/unoevent \
+	sw/source/core/unocore/unoevtlstnr \
+	sw/source/core/unocore/unofield \
+	sw/source/core/unocore/unoflatpara \
+	sw/source/core/unocore/unoframe \
+	sw/source/core/unocore/unoftn \
+	sw/source/core/unocore/unoidx \
+	sw/source/core/unocore/unomap \
+	sw/source/core/unocore/unoobj \
+	sw/source/core/unocore/unoobj2 \
+	sw/source/core/unocore/unoparagraph \
+	sw/source/core/unocore/unoport \
+	sw/source/core/unocore/unoportenum \
+	sw/source/core/unocore/unoprnms \
+	sw/source/core/unocore/unoredline \
+	sw/source/core/unocore/unoredlines \
+	sw/source/core/unocore/unorefmk \
+	sw/source/core/unocore/unosect \
+	sw/source/core/unocore/unosett \
+	sw/source/core/unocore/unosrch \
+	sw/source/core/unocore/unostyle \
+	sw/source/core/unocore/unotbl  \
+	sw/source/core/unocore/unotext \
+	sw/source/core/unocore/unotextmarkup \
+	sw/source/core/view/pagepreviewlayout \
+	sw/source/core/view/printdata \
+	sw/source/core/view/progress \
+	sw/source/core/view/vdraw \
+	sw/source/core/view/viewimp \
+	sw/source/core/view/viewoptionadjust \
+	sw/source/core/view/viewopt \
+	sw/source/core/view/viewpg \
+	sw/source/core/view/viewsh \
+	sw/source/core/view/vnew \
+	sw/source/core/view/vprint \
+	sw/source/filter/ascii/ascatr \
+	sw/source/filter/ascii/parasc \
+	sw/source/filter/ascii/wrtasc \
+	sw/source/filter/basflt/docfact \
+	sw/source/filter/basflt/fltini \
+	sw/source/filter/basflt/iodetect \
+	sw/source/filter/basflt/shellio \
+	sw/source/filter/basflt/sw3convert \
+	sw/source/filter/html/SwAppletImpl \
+	sw/source/filter/html/css1atr \
+	sw/source/filter/html/css1kywd \
+	sw/source/filter/html/htmlatr \
+	sw/source/filter/html/htmlbas \
+	sw/source/filter/html/htmlcss1 \
+	sw/source/filter/html/htmlctxt \
+	sw/source/filter/html/htmldraw \
+	sw/source/filter/html/htmlfld \
+	sw/source/filter/html/htmlfldw \
+	sw/source/filter/html/htmlfly \
+	sw/source/filter/html/htmlflyt \
+	sw/source/filter/html/htmlform \
+	sw/source/filter/html/htmlforw \
+	sw/source/filter/html/htmlftn \
+	sw/source/filter/html/htmlgrin \
+	sw/source/filter/html/htmlnum \
+	sw/source/filter/html/htmlplug \
+	sw/source/filter/html/htmlsect \
+	sw/source/filter/html/htmltab \
+	sw/source/filter/html/htmltabw \
+	sw/source/filter/html/parcss1 \
+	sw/source/filter/html/svxcss1 \
+	sw/source/filter/html/swhtml \
+	sw/source/filter/html/wrthtml \
+	sw/source/filter/writer/writer \
+	sw/source/filter/writer/wrt_fn \
+	sw/source/filter/writer/wrtswtbl \
+	sw/source/filter/ww1/fltshell \
+	sw/source/filter/ww1/w1class \
+	sw/source/filter/ww1/w1filter \
+	sw/source/filter/ww1/w1par \
+	sw/source/filter/ww1/w1sprm \
+	sw/source/filter/xml/swxml \
+	sw/source/filter/xml/SwXMLSectionList \
+	sw/source/filter/xml/wrtxml \
+	sw/source/filter/xml/xmlbrsh \
+	sw/source/filter/xml/xmlexp \
+	sw/source/filter/xml/xmlexpit \
+	sw/source/filter/xml/xmlfmt \
+	sw/source/filter/xml/xmlfmte \
+	sw/source/filter/xml/xmlfonte \
+	sw/source/filter/xml/xmlimp \
+	sw/source/filter/xml/xmlimpit \
+	sw/source/filter/xml/xmlitem \
+	sw/source/filter/xml/xmliteme \
+	sw/source/filter/xml/xmlitemi \
+	sw/source/filter/xml/xmlitemm \
+	sw/source/filter/xml/xmlithlp \
+	sw/source/filter/xml/xmlitmpr \
+	sw/source/filter/xml/xmlmeta \
+	sw/source/filter/xml/XMLRedlineImportHelper \
+	sw/source/filter/xml/xmlscript \
+	sw/source/filter/xml/xmltble \
+	sw/source/filter/xml/xmltbli \
+	sw/source/filter/xml/xmltext \
+	sw/source/filter/xml/xmltexte \
+	sw/source/filter/xml/xmltexti \
+))
+
+# vim: set noet sw=4 ts=4:

File sw/Module_sw.mk

 
 $(eval $(call gb_Module_Module,sw))
 
+# only for testing new core library
+ifneq ($(SWCORE),)
+$(eval $(call gb_Module_add_targets,sw,\
+	AllLangResTarget_sw \
+	Library_msword \
+	Library_swcore \
+	Package_misc \
+	Package_uiconfig \
+	Package_xml \
+))
+else
 $(eval $(call gb_Module_add_targets,sw,\
 	AllLangResTarget_sw \
 	Library_msword \
 	Package_uiconfig \
 	Package_xml \
 ))
+endif
 
 $(eval $(call gb_Module_add_subsequentcheck_targets,sw,\
 	JunitTest_sw_complex \

File sw/inc/doc.hxx

 // global function to start grammar checking in the document
 void StartGrammarChecking( SwDoc &rDoc );
 
+typedef SwDoc* (*FNGetDoc)( const com::sun::star::uno::Reference < com::sun::star::frame::XModel >& );
+
 class SW_DLLPUBLIC SwDoc :
     public IInterface,
     public IDocumentSettingAccess,
 
     ::std::auto_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry;
 
+    static FNGetDoc           pFnGetDoc;
+
 	// -------------------------------------------------------------------
 	// sonstige
 
     void   Paste( const SwDoc& );
     void SetEmbeddedLoadSave(bool bSet){ mbIsEmbeddedLoadSave=bSet; }
     bool IsEmbeddedLoadSave() const { return mbIsEmbeddedLoadSave; }
+    static void SetFNGetDoc( FNGetDoc p ) { pFnGetDoc = p; }
+    static FNGetDoc GetFNGetDoc() { return pFnGetDoc; }
 };
 
 

File sw/inc/docsh.hxx

-/*************************************************************************
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SWDOCSH_HXX
-#define _SWDOCSH_HXX
-
-#include <rtl/ref.hxx>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include <vcl/timer.hxx>
-#include <sfx2/docfac.hxx>
-#include <sfx2/objsh.hxx>
-#include "swdllapi.h"
-#include <swdll.hxx>
-#include <shellid.hxx>
-
-#include <svl/lstner.hxx>
-#include <svtools/embedhlp.hxx>
-
-class SwDoc;
-class SfxDocumentInfoDialog;
-class SfxStyleSheetBasePool;
-class SfxInPlaceClient;
-class FontList;
-class SwView;
-class SwWrtShell;
-class SwFEShell;
-class SwMergeMgr;
-class Reader;
-class SwReader;
-class SwCrsrShell;
-class SwSrcView;
-class SwOutlineNodes;
-class SwNodeChecker;
-class SwPaM;
-class SwgReaderOption;
-class SwOLEObj;
-class IDocumentDeviceAccess;
-class IDocumentSettingAccess;
-class IDocumentTimerAccess;
-class IDocumentChartDataProviderAccess;
-class SwTxtFmtColl;
-
-enum SwSplitDocType
-{
-	SPLITDOC_TO_GLOBALDOC,
-	SPLITDOC_TO_HTML
-};
-
-class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
-{
-	SwDoc*					pDoc;			// Document
-	rtl::Reference< SfxStyleSheetBasePool >	mxBasePool;		// Durchreiche fuer Formate
-	FontList*				pFontList;		// aktuelle FontListe
-
-	// Nix geht ohne die WrtShell (historische Gruende)
-	// RuekwaertsPointer auf die View (historische Gruende)
-	// Dieser gilt solange bis im Activate ein neuer gesetzt wird
-	// oder dieser im Dtor der View geloescht wird
-	//
-	SwView* 				pView;
-	SwWrtShell* 			pWrtShell;
-    SwMergeMgr*             pMergeMgr;
-
-	Timer					aFinishedTimer;	// Timer fuers ueberpriefen der
-											// Grafik-Links. Sind alle da,
-											// dann ist Doc voll. geladen
-
-    //SvPersistRef            xOLEChildList;  // fuers RemoveOLEObjects
-    comphelper::EmbeddedObjectContainer*    pOLEChildList;
-    sal_Int16               nUpdateDocMode; // contains the com::sun::star::document::UpdateDocMode
-    bool                    bInUpdateFontList; //prevent nested calls of UpdateFontList
-	// Methoden fuer den Zugriff aufs Doc
-	SW_DLLPRIVATE void					AddLink();
-	SW_DLLPRIVATE void					RemoveLink();
-
-	// Hint abfangen fuer DocInfo
-	SW_DLLPRIVATE virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
-
-	// FileIO
-    SW_DLLPRIVATE virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
-    SW_DLLPRIVATE virtual sal_Bool Load( SfxMedium& rMedium );
-    SW_DLLPRIVATE virtual sal_Bool LoadFrom( SfxMedium& rMedium );
-    SW_DLLPRIVATE virtual sal_Bool            ConvertFrom( SfxMedium &rMedium );
-    SW_DLLPRIVATE virtual sal_Bool            ConvertTo( SfxMedium &rMedium );
-    SW_DLLPRIVATE virtual sal_Bool SaveAs( SfxMedium& rMedium );
-    SW_DLLPRIVATE virtual sal_Bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
-
-	SW_DLLPRIVATE virtual sal_uInt16			PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
-
-	// DocInfo dem Doc melden
-	//
-	SW_DLLPRIVATE virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
-									Window *pParent, const SfxItemSet &);
-	// OLE-Geraffel
-	SW_DLLPRIVATE virtual void			Draw( OutputDevice*, const JobSetup&, sal_uInt16);
-
-	// Methoden fuer StyleSheets
-	SW_DLLPRIVATE sal_uInt16					Edit( const String &rName, const String& rParent, sal_uInt16 nFamily,
-									sal_uInt16 nMask, sal_Bool bNew,
-									sal_Bool bColumn = sal_False,
-									SwWrtShell* pActShell = 0,
-									sal_Bool bBasic = sal_False );
-	SW_DLLPRIVATE sal_uInt16					Delete(const String &rName, sal_uInt16 nFamily);
-	SW_DLLPRIVATE sal_uInt16					ApplyStyles(const String &rName, sal_uInt16 nFamily, SwWrtShell* pShell = 0,
-										sal_uInt16 nMode = 0 );
-	SW_DLLPRIVATE sal_uInt16					DoWaterCan( const String &rName, sal_uInt16 nFamily);
-	SW_DLLPRIVATE sal_uInt16					UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWrtShell* pShell = 0);
-	SW_DLLPRIVATE sal_uInt16					MakeByExample(const String &rName,
-											sal_uInt16 nFamily, sal_uInt16 nMask, SwWrtShell* pShell = 0);
-
-	SW_DLLPRIVATE void					InitDraw();
-	SW_DLLPRIVATE void					SubInitNew();   // fuer InitNew und HtmlSourceModus
-
-	SW_DLLPRIVATE void 					RemoveOLEObjects();
-	SW_DLLPRIVATE void					CalcLayoutForOLEObjects();
-
-    SW_DLLPRIVATE void                    Init_Impl();
-    SW_DLLPRIVATE DECL_STATIC_LINK( SwDocShell, IsLoadFinished, void* );
-
-
-    using SfxObjectShell::GetVisArea;
-    using SfxObjectShell::GetStyleFamilyBitmap;
-
-protected:
-    /// override to update text fields
-    virtual void                DoFlushDocInfo();
-
-public:
-    using SotObject::GetInterface;
-
-	// aber selbst implementieren
-	SFX_DECL_INTERFACE(SW_DOCSHELL)
-    SFX_DECL_OBJECTFACTORY()
-	TYPEINFO();
-
-    static SfxInterface *_GetInterface() { return GetStaticInterface(); }
-
-	static rtl::OUString GetEventName( sal_Int32 nId );
-
-	//Das Doc wird fuer SO-Datenaustausch benoetigt!
-	SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED );
-	SwDocShell( const sal_uInt64 i_nSfxCreationFlags );
-	SwDocShell( SwDoc *pDoc, SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD );
-	~SwDocShell();
-
-	// OLE 2.0-Benachrichtigung
-	DECL_LINK( Ole2ModifiedHdl, void * );
-
-	// OLE-Geraffel
-	virtual void	  SetVisArea( const Rectangle &rRect );
-	virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const;
-	virtual Printer  *GetDocumentPrinter();
-    virtual OutputDevice* GetDocumentRefDev();
-	virtual void	  OnDocumentPrinterChanged( Printer * pNewPrinter );
-	virtual sal_uLong	  GetMiscStatus() const;
-
-	virtual void			PrepareReload();
-	virtual void			SetModified( sal_Bool = sal_True );
-
-	// Dispatcher
-	void					Execute(SfxRequest &);
-	void					ExecStyleSheet(SfxRequest&);
-	void					ExecDB(SfxRequest&);
-
-	void					GetState(SfxItemSet &);
-	void					StateAlways(SfxItemSet &);
-	void					StateStyleSheet(SfxItemSet&, SwWrtShell* pSh = 0 );
-
-	// Doc rausreichen aber VORSICHT
-    inline SwDoc*                   GetDoc() { return pDoc; }
-    inline const SwDoc*             GetDoc() const { return pDoc; }
-    IDocumentDeviceAccess*          getIDocumentDeviceAccess();
-    const IDocumentSettingAccess*   getIDocumentSettingAccess() const;
-    IDocumentChartDataProviderAccess*       getIDocumentChartDataProviderAccess();
-
-    SwMergeMgr* GetMergeDBMgr();
-    void SetMergeDBMgr( SwMergeMgr* );
-
-    void                    UpdateFontList();
-	void					UpdateChildWindows();
-
-	// globaler IO
-	virtual sal_Bool			Save();
-
-	// fuer VorlagenPI
-	virtual SfxStyleSheetBasePool*	GetStyleSheetPool();
-
-	// Fuer Organizer
-	virtual sal_Bool Insert(SfxObjectShell &rSource,
-						sal_uInt16	nSourceIdx1,
-						sal_uInt16	nSourceIdx2,
-						sal_uInt16	nSourceIdx3,
-						sal_uInt16& nIdx1,
-						sal_uInt16& nIdx2,
-						sal_uInt16& nIdx3,
-						sal_uInt16& nRemovedIdx);
-
-	virtual sal_Bool Remove(sal_uInt16 nIdx1,
-						sal_uInt16 nIdx2 = INDEX_IGNORE,
-						sal_uInt16 nIdx3 = INDEX_IGNORE);
-
-	virtual Bitmap 		GetStyleFamilyBitmap( SfxStyleFamily eFamily, BmpColorMode eColorMode );
-
-	// View setzen fuer Aktionen ueber Shell
-	void 		  SetView(SwView* pVw);
-	const SwView *GetView() const { return pView; }
-    SwView       *GetView()       { return pView; }
-
-	// Zugriff auf die zur SwView gehoerige SwWrtShell
-		  SwWrtShell *GetWrtShell() 	  { return pWrtShell; }
-	const SwWrtShell *GetWrtShell() const { return pWrtShell; }
-
-	// fuer die Core - die kennt die DocShell aber keine WrtShell!
-		  SwFEShell *GetFEShell();
-	const SwFEShell *GetFEShell() const
-				{ return ((SwDocShell*)this)->GetFEShell(); }
-
-
-	// Fuer Einfuegen Dokument
-	Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
-							SwCrsrShell* pCrsrSh = 0, SwPaM* pPaM = 0);
-
-	virtual long DdeGetData( const String& rItem, const String& rMimeType,
-							 ::com::sun::star::uno::Any & rValue );
-	virtual long DdeSetData( const String& rItem, const String& rMimeType,
-								const ::com::sun::star::uno::Any & rValue );
-    virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
-	virtual void FillClass( SvGlobalName * pClassName,
-								   sal_uInt32 * pClipFormat,
-								   String * pAppName,
-								   String * pLongUserName,
-                                   String * pUserName,
-                                   sal_Int32 nFileFormat,
-                                   sal_Bool bTemplate = sal_False ) const;
-
-	virtual void LoadStyles( SfxObjectShell& rSource );
-
-    void _LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrentDocument );
-
-	// Seitenvorlagedialog anzeigen, ggf. auf Spaltenpage
-	void FormatPage( const String& rPage,
-						sal_Bool bColumn = sal_False,
-						SwWrtShell* 	pActShell = 0 );
-
-    // --> OD 2006-11-07 #i59688#
-    // linked graphics are now loaded on demand.
-    // Thus, loading of linked graphics no longer needed and necessary for
-    // the load of document being finished.
-//    // Timer starten fuers ueberpruefen der Grafik-Links. Sind alle
-//    // vollstaendig geladen, dann ist das Doc fertig
-//    void StartLoadFinishedTimer();
-    void LoadingFinished();
-    // <--
-
-	// eine Uebertragung wird abgebrochen (wird aus dem SFX gerufen)
-	virtual void CancelTransfers();
-
-	// Doc aus Html-Source neu laden
-	void	ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView );
-
-    sal_Int16   GetUpdateDocMode() const {return nUpdateDocMode;}
-
-	//Activate wait cursor for all windows of this document
-	//Optionally all dispatcher could be Locked
-	//Usually locking should be done using the class: SwWaitObject!
-	void EnterWait( sal_Bool bLockDispatcher );
-	void LeaveWait( sal_Bool bLockDispatcher );
-
-	void ToggleBrowserMode(sal_Bool bOn, SwView* pView);
-
-	sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt,
-								sal_Bool bUnoCall );
-	void ClearModel();
-
-	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >	GetEventNames();
-
-    // --> FME 2004-08-05 #i20883# Digital Signatures and Encryption
-    virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
-    // <--
-
-    // --> FME 2005-02-25 #i42634# Overwrites SfxObjectShell::UpdateLinks
-    // This new function is necessary to trigger update of links in docs
-    // read by the binary filter:
-    virtual void UpdateLinks();
-    // <--
-
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
-                                GetController();
-
-    SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef );
-
-    virtual const ::sfx2::IXmlIdRegistry* GetXmlIdRegistry() const;
-
-    // passwword protection for Writer (derived from SfxObjectShell)
-    // see also:    FN_REDLINE_ON, FN_REDLINE_ON
-    virtual bool    IsChangeRecording() const;
-    virtual bool    HasChangeRecordProtection() const;
-    virtual void    SetChangeRecording( bool bActivate );
-    virtual bool    SetProtectionPassword( const String &rPassword );
-    virtual bool    GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
-    virtual bool    CanSwitchReadOnlyCursor() const;
-    virtual bool    IsWeb() const;
-    void CreateLinguisticEventListener();
-
-	bool GenerateGlobalDoc( const String& rPath, const SwTxtFmtColl* pSplitColl = 0 ) 
-    { return GenerateDoc( SPLITDOC_TO_GLOBALDOC, rPath, pSplitColl ); }
-
-	bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 )
-    { return GenerateDoc( SPLITDOC_TO_GLOBALDOC, rPath, nOutlineLevel ); }
-
-	bool GenerateHTMLDoc( const String& rPath, const SwTxtFmtColl* pSplitColl = 0 )
-    { return GenerateDoc( SPLITDOC_TO_HTML, rPath, pSplitColl ); }
-
-	bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 )
-    { return GenerateDoc( SPLITDOC_TO_HTML, rPath, nOutlineLevel ); }
-
-	bool GenerateDoc( SwSplitDocType nDocType, const String& rPath, const SwTxtFmtColl* );
-	bool GenerateDoc( SwSplitDocType nDocType, const String& rPath, int nOutlineLevel );
-	bool SplitDoc( SwSplitDocType eDocType, const String& rPath, SwOutlineNodes*, const SwNodeChecker& rCheck );
-    SfxObjectShell* CreateCopy(bool bCallInitNew) const;
-};
-
-class Graphic;
-//implemented in source/ui/docvw/romenu.cxx
-String ExportGraphic( const Graphic &rGraphic, const String &rGrfName );
-
-SW_DLLPUBLIC sal_uInt16 GetHtmlMode( const SwDocShell* pShell );
-
-#endif

File sw/inc/shellid.hxx

-/*************************************************************************
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SHELLID_HXX
-#define _SHELLID_HXX
-
-#include <sfx2/shell.hxx>
-
-/*--------------------------------------------------------------------
-	Beschreibung:	Mapping fuer UI-Parameter
- --------------------------------------------------------------------*/
-
-#define SW_BASESHELL			(SFX_INTERFACE_SW_START + 1)
-#define SW_TEXTSHELL			(SFX_INTERFACE_SW_START + 2)
-#define SW_LISTSHELL			(SFX_INTERFACE_SW_START + 3)
-#define SW_TABSHELL 			(SFX_INTERFACE_SW_START + 4)
-#define SW_FRAMESHELL			(SFX_INTERFACE_SW_START + 5)
-#define SW_GRFSHELL 			(SFX_INTERFACE_SW_START + 6)
-#define SW_OLESHELL 			(SFX_INTERFACE_SW_START + 7)
-#define SW_DRAWSHELL			(SFX_INTERFACE_SW_START + 8)
-#define SW_DRWTXTSHELL			(SFX_INTERFACE_SW_START + 9)
-
-#define SW_INTERFACE_MODULE 	(SFX_INTERFACE_SW_START + 10)
-#define SW_DOCSHELL 			(SFX_INTERFACE_SW_START + 11)
-#define SW_VIEWSHELL			(SFX_INTERFACE_SW_START + 12)
-#define SW_PAGEPREVIEW			(SFX_INTERFACE_SW_START + 13)
-#define SW_GLOSDOCSHELL 		(SFX_INTERFACE_SW_START + 14)
-#define SW_SRC_VIEWSHELL 		(SFX_INTERFACE_SW_START + 15)
-
-#define SW_BEZIERSHELL 			(SFX_INTERFACE_SW_START + 16)
-#define SW_DRAWBASESHELL		(SFX_INTERFACE_SW_START + 17)
-#define SW_DRAWFORMSHELL		(SFX_INTERFACE_SW_START + 18)
-
-#define SW_WEBDOCSHELL			(SFX_INTERFACE_SW_START + 19)
-#define SW_WEBVIEWSHELL			(SFX_INTERFACE_SW_START + 20)
-#define SW_WEBBASESHELL			(SFX_INTERFACE_SW_START + 21)
-#define SW_WEBTEXTSHELL			(SFX_INTERFACE_SW_START + 22)
-#define SW_WEBFRAMESHELL		(SFX_INTERFACE_SW_START + 23)
-#define SW_WEBGLOSDOCSHELL 		(SFX_INTERFACE_SW_START + 24)
-#define SW_WEBLISTSHELL			(SFX_INTERFACE_SW_START + 25)
-#define SW_WEBTABSHELL 			(SFX_INTERFACE_SW_START + 26)
-#define SW_WEBGRFSHELL 			(SFX_INTERFACE_SW_START + 27)
-#define SW_WEBOLESHELL 			(SFX_INTERFACE_SW_START + 28)
-#define SW_WEBDRAWBASESHELL		(SFX_INTERFACE_SW_START + 29)
-#define SW_WEBDRAWFORMSHELL		(SFX_INTERFACE_SW_START + 30)
-
-#define SW_MEDIASHELL 			(SFX_INTERFACE_SW_START + 31)
-#define SW_ANNOTATIONSHELL 		(SFX_INTERFACE_SW_START + 32)
-
-#endif // _UIPARAM_HXX

File sw/inc/unotxdoc.hxx

-/*************************************************************************
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _UNOTXDOC_HXX
-#define _UNOTXDOC_HXX
-
-#include "swdllapi.h"
-#include <svl/svarray.hxx>
-#include <sfx2/sfxbasemodel.hxx>
-
-#include <com/sun/star/beans/PropertyValues.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/style/XAutoStylesSupplier.hpp>
-#include <com/sun/star/document/XLinkTargetSupplier.hpp>
-#include <com/sun/star/document/XRedlinesSupplier.hpp>
-#include <com/sun/star/text/XNumberingRulesSupplier.hpp>
-#include <com/sun/star/text/XFootnotesSupplier.hpp>
-#include <com/sun/star/text/XEndnotesSupplier.hpp>
-#include <com/sun/star/text/XEndnotesSettingsSupplier.hpp>
-#include <com/sun/star/text/XTextSectionsSupplier.hpp>
-#include <com/sun/star/text/XLineNumberingProperties.hpp>
-#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
-#include <com/sun/star/text/XPagePrintable.hpp>
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
-#include <com/sun/star/text/XTextTablesSupplier.hpp>
-#include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
-#include <com/sun/star/text/XBookmarksSupplier.hpp>
-#include <com/sun/star/text/XTextDocument.hpp>
-#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
-#include <com/sun/star/text/XReferenceMarksSupplier.hpp>
-#include <com/sun/star/text/XTextFramesSupplier.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/util/XReplaceable.hpp>
-#include <com/sun/star/util/XReplaceDescriptor.hpp>
-#include <com/sun/star/util/XRefreshable.hpp>
-#include <com/sun/star/util/XLinkUpdate.hpp>
-#include <com/sun/star/view/XRenderable.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/xforms/XFormsSupplier.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
-#include <com/sun/star/document/XDocumentLanguages.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <svl/itemprop.hxx>
-#include <svx/fmdmod.hxx>
-#include <editeng/UnoForbiddenCharsTable.hxx>
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/implbase2.hxx>	// helper for implementations
-#include <cppuhelper/implbase4.hxx>	// helper for implementations
-#include <RefreshListenerContainer.hxx>
-
-#include <viewopt.hxx>
-
-#define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \
-Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32
-
-#define __CLASS_IFC32 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \
-class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12, class Ifc13, class Ifc14, class Ifc15, class Ifc16, \
-class Ifc17, class Ifc18, class Ifc19, class Ifc20, class Ifc21, class Ifc22, class Ifc23, class Ifc24,\
-class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31 , class Ifc32
-
-#define __PUBLIC_IFC32 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \
-public Ifc13, public Ifc14, public Ifc15, public Ifc16, public Ifc17, public Ifc18, \
-public Ifc19, public Ifc20, public Ifc21, public Ifc22, public Ifc23, public Ifc24, \
-public Ifc25, public Ifc26, public Ifc27, public Ifc28, public Ifc29, public Ifc30, \
-public Ifc31, public Ifc32
-#include <cppuhelper/implbase_ex.hxx>
-#include <cppuhelper/implbase_ex_pre.hxx>
-#define __IFC_EX_TYPE_INIT32( class_cast ) \
-    __IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 7 ), __IFC_EX_TYPE_INIT( class_cast, 8 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 9 ), __IFC_EX_TYPE_INIT( class_cast, 10 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 11 ), __IFC_EX_TYPE_INIT( class_cast, 12 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 13 ), __IFC_EX_TYPE_INIT( class_cast, 14 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 15 ), __IFC_EX_TYPE_INIT( class_cast, 16 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 17 ), __IFC_EX_TYPE_INIT( class_cast, 18 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 19 ), __IFC_EX_TYPE_INIT( class_cast, 20 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 21 ), __IFC_EX_TYPE_INIT( class_cast, 22 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 23 ), __IFC_EX_TYPE_INIT( class_cast, 24 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 25 ), __IFC_EX_TYPE_INIT( class_cast, 26 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 27 ), __IFC_EX_TYPE_INIT( class_cast, 28 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 29 ), __IFC_EX_TYPE_INIT( class_cast, 30 ), \
-    __IFC_EX_TYPE_INIT( class_cast, 31 ), __IFC_EX_TYPE_INIT( class_cast, 32)
-#include <cppuhelper/implbase_ex_post.hxx>
-
-__DEF_IMPLHELPER_EX( 32 )
-
-namespace css = ::com::sun::star;
-
-class SwDoc;
-class SwDocShell;
-class UnoActionContext;
-class SwXBodyText;
-class SwXDrawPage;
-class SwUnoCrsr;
-class SwXDocumentPropertyHelper;
-class SfxViewFrame;
-class SwPrintUIOptions;
-class SwPrintData;
-class SwRenderData;
-class ViewShell;
-
-typedef UnoActionContext* UnoActionContextPtr;
-SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4)
-
-
-/******************************************************************************
- *
- ******************************************************************************/
-
-
-typedef cppu::WeakImplHelper32
-<
-	css::text::XTextDocument,
-	css::text::XLineNumberingProperties,
-	css::text::XChapterNumberingSupplier,
-    css::text::XNumberingRulesSupplier,
-	css::text::XFootnotesSupplier,
-	css::text::XEndnotesSupplier,
-	css::util::XReplaceable,
-	css::text::XPagePrintable,
-	css::text::XReferenceMarksSupplier,
-	css::text::XTextTablesSupplier,
-	css::text::XTextFramesSupplier,
-	css::text::XBookmarksSupplier,
-	css::text::XTextSectionsSupplier,
-	css::text::XTextGraphicObjectsSupplier,
-	css::text::XTextEmbeddedObjectsSupplier,
-	css::text::XTextFieldsSupplier,
-	css::style::XStyleFamiliesSupplier,
-	css::style::XAutoStylesSupplier,
-	css::lang::XServiceInfo,
-	css::drawing::XDrawPageSupplier,
-	css::text::XDocumentIndexesSupplier,
-	css::beans::XPropertySet,
-	css::beans::XPropertyState,
-	css::document::XLinkTargetSupplier,
-	css::document::XRedlinesSupplier,
-	css::util::XRefreshable,
-	css::util::XLinkUpdate,
-    css::view::XRenderable,
-    css::xforms::XFormsSupplier,
-    css::text::XFlatParagraphIteratorProvider,
-	css::document::XDocumentLanguages,
-    css::util::XCloneable
->
-SwXTextDocumentBaseClass;
-
-class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass,
-	public SvxFmMSFactory,
-	public SfxBaseModel
-{
-	ActionContextArr		aActionArr;
-	SwRefreshListenerContainer	aRefreshCont;
-
-    const SfxItemPropertySet* pPropSet;
-
-	SwDocShell* 			pDocShell;
-	sal_Bool					bObjectValid;
-
-	SwXDrawPage*			pDrawPage;
-	css::uno::Reference< css::drawing::XDrawPage > *			pxXDrawPage;
-
-	css::uno::Reference< css::text::XText > 				xBodyText;
-	SwXBodyText*			pBodyText;
-	css::uno::Reference< css::uno::XAggregation > 			xNumFmtAgg;
-
-    css::uno::Reference< css::container::XIndexAccess > *     pxXNumberingRules;
-    css::uno::Reference< css::container::XIndexAccess > *     pxXFootnotes;
-	css::uno::Reference< css::beans::XPropertySet > *        pxXFootnoteSettings;
-	css::uno::Reference< css::container::XIndexAccess > *		pxXEndnotes;
-	css::uno::Reference< css::beans::XPropertySet > *        pxXEndnoteSettings;
-	css::uno::Reference< css::container::XNameAccess > *			pxXReferenceMarks;
-	css::uno::Reference< css::container::XEnumerationAccess > *	pxXTextFieldTypes;
-	css::uno::Reference< css::container::XNameAccess > *			pxXTextFieldMasters;
-	css::uno::Reference< css::container::XNameAccess > *			pxXTextSections;
-	css::uno::Reference< css::container::XNameAccess > *			pxXBookmarks;
-	css::uno::Reference< css::container::XNameAccess > *			pxXTextTables;
-	css::uno::Reference< css::container::XNameAccess > *			pxXTextFrames;
-	css::uno::Reference< css::container::XNameAccess > *			pxXGraphicObjects;
-	css::uno::Reference< css::container::XNameAccess > *			pxXEmbeddedObjects;
-	css::uno::Reference< css::container::XNameAccess > *			pxXStyleFamilies;
-    mutable css::uno::Reference< css::style::XAutoStyles > *  pxXAutoStyles;
-    css::uno::Reference< css::container::XIndexReplace > *        pxXChapterNumbering;
-	css::uno::Reference< css::container::XIndexAccess > *		pxXDocumentIndexes;
-
-	css::uno::Reference< css::beans::XPropertySet > * 		pxXLineNumberingProperties;
-	css::uno::Reference< css::container::XNameAccess > *			pxLinkTargetSupplier;
-	css::uno::Reference< css::container::XEnumerationAccess >* 	pxXRedlines;
-	css::uno::Reference< css::container::XNameContainer> 		xXFormsContainer;
-
-    //temporary frame to enable PDF export if no valid view is available
-    SfxViewFrame*                                   m_pHiddenViewFrame;
-    css::uno::Reference< css::uno::XInterface>      xPropertyHelper;
-    SwXDocumentPropertyHelper*                      pPropertyHelper;
-    
-    SwPrintUIOptions *                              m_pPrintUIOptions;
-    SwRenderData *                               m_pRenderData;
-
-	void					GetBodyText();
-	void					GetNumberFormatter();
-
-    // used for XRenderable implementation
-    SfxViewShell *  GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() );
-    SwDoc *         GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport );
-    SfxViewShell *  GetRenderView( bool &rbIsSwSrcView, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions, bool bIsPDFExport );
-
-	rtl::OUString			maBuildId;
-
-    using SfxBaseModel::addEventListener;
-    using SfxBaseModel::removeEventListener;
-
-protected:
-	virtual ~SwXTextDocument();
-public:
-	SwXTextDocument(SwDocShell* pShell);
-
-	inline void notifyRefreshListeners() { aRefreshCont.Refreshed(); }
-    virtual 	css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL acquire(  ) throw();
-    virtual void SAL_CALL release(  ) throw();
-
-	//XWeak
-    virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter(  ) throw(css::uno::RuntimeException);
-
-	virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) throw(css::uno::RuntimeException);
-
-	static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-	//XUnoTunnel
-	virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException);
-
-	//XTextDocument
-	virtual css::uno::Reference< css::text::XText >  SAL_CALL getText(void) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL reformat(void) throw( css::uno::RuntimeException );
-
-	//XModel
-    virtual sal_Bool SAL_CALL attachResource( const ::rtl::OUString& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) throw(css::uno::RuntimeException);
-    virtual ::rtl::OUString SAL_CALL getURL(  ) throw(css::uno::RuntimeException);
-    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL connectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL disconnectController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL lockControllers(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL unlockControllers(  ) throw(css::uno::RuntimeException);
-    virtual sal_Bool SAL_CALL hasControllersLocked(  ) throw(css::uno::RuntimeException);
-    virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL setCurrentController( const css::uno::Reference< css::frame::XController >& xController ) throw(css::container::NoSuchElementException, css::uno::RuntimeException);
-    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection(  ) throw(css::uno::RuntimeException);
-
-	//XComponent
-	virtual void SAL_CALL dispose(void) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException );
-
-    //XCloseable
-    virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw (css::util::CloseVetoException, css::uno::RuntimeException);
-
-    //XLineNumberingProperties
-	virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getLineNumberingProperties(void) throw( css::uno::RuntimeException );
-
-	//XChapterNumberingSupplier
-	virtual css::uno::Reference< css::container::XIndexReplace >  SAL_CALL getChapterNumberingRules(void) throw( css::uno::RuntimeException );
-
-    //XNumberingRulesSupplier
-    virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getNumberingRules() throw (css::uno::RuntimeException);
-
-	//XFootnotesSupplier
-	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getFootnotes(void) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::beans::XPropertySet >  SAL_CALL getFootnoteSettings(void) throw( css::uno::RuntimeException );
-
-	//XEndnotesSupplier
-	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getEndnotes(void) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::beans::XPropertySet >  SAL_CALL getEndnoteSettings(void) throw( css::uno::RuntimeException );
-
-	//XReplaceable
-	virtual css::uno::Reference< css::util::XReplaceDescriptor >  SAL_CALL createReplaceDescriptor(void) throw( css::uno::RuntimeException );
-	virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
-
-	//XSearchable
-	virtual css::uno::Reference< css::util::XSearchDescriptor >  SAL_CALL createSearchDescriptor(void) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL findNext(const css::uno::Reference< css::uno::XInterface > & xStartAt, const css::uno::Reference< css::util::XSearchDescriptor > & xDesc) throw( css::uno::RuntimeException );
-
-	//XPagePrintable
-	virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPagePrintSettings(void) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL setPagePrintSettings(const css::uno::Sequence< css::beans::PropertyValue >& aSettings) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL printPages(const css::uno::Sequence< css::beans::PropertyValue >& xOptions) throw( css::lang::IllegalArgumentException, css::uno::RuntimeException );
-
-	//XReferenceMarksSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getReferenceMarks(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextFieldsSupplier
-	virtual css::uno::Reference< css::container::XEnumerationAccess >  SAL_CALL getTextFields(void) throw( css::uno::RuntimeException );
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextFieldMasters(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextEmbeddedObjectsSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getEmbeddedObjects(void) throw( css::uno::RuntimeException );
-
-//	// css::text::XTextShapesSupplier
-//    virtual css::uno::Reference< css::container::XIndexAccess >  getShapes(void) throw( css::uno::RuntimeException );
-
-	// css::text::XBookmarksSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getBookmarks(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextSectionsSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextSections(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextTablesSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextTables(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextGraphicObjectsSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getGraphicObjects(void) throw( css::uno::RuntimeException );
-
-	// css::text::XTextFramesSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getTextFrames(void) throw( css::uno::RuntimeException );
-
-	//XStyleFamiliesSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getStyleFamilies(void) throw( css::uno::RuntimeException );
-
-    //XAutoStylesSupplier
-    virtual css::uno::Reference< css::style::XAutoStyles > SAL_CALL getAutoStyles(  ) throw (css::uno::RuntimeException);
-
-    //XMultiServiceFactory
-	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL createInstance(const rtl::OUString& ServiceSpecifier)
-				throw( css::uno::Exception, css::uno::RuntimeException );
-	virtual css::uno::Reference< css::uno::XInterface >  SAL_CALL createInstanceWithArguments(const rtl::OUString& ServiceSpecifier,
-				const css::uno::Sequence< css::uno::Any >& Arguments)
-				throw( css::uno::Exception, css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void)
-				throw( css::uno::RuntimeException );
-
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
-
-	// css::drawing::XDrawPageSupplier
-	virtual css::uno::Reference< css::drawing::XDrawPage >  SAL_CALL getDrawPage(void) throw( css::uno::RuntimeException );
-
-	// css::text::XDocumentIndexesSupplier
-	virtual css::uno::Reference< css::container::XIndexAccess >  SAL_CALL getDocumentIndexes(void) throw( css::uno::RuntimeException );
-
-	//XPropertySet
-    virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-
-	//XPropertyState
-	virtual css::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
-    virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< ::rtl::OUString >& rPropertyNames ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
-    virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
-    virtual css::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName ) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-
-	//XLinkTargetSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getLinks(void) throw( css::uno::RuntimeException );
-
-	//XRedlinesSupplier
-	virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getRedlines(  ) throw(css::uno::RuntimeException);
-
-	// css::util::XRefreshable
-	virtual void SAL_CALL refresh(void) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException );
-	virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > & l) throw( css::uno::RuntimeException );
-
-	// css::util::XLinkUpdate,
-    virtual void SAL_CALL updateLinks(  ) throw(css::uno::RuntimeException);
-
-    // css::view::XRenderable
-    virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
-    virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
-    virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& xOptions ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
-
-    // css::xforms::XFormsSupplier
-    virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getXForms(  ) throw (css::uno::RuntimeException);
-
-    // css::document::XDocumentLanguages
-    virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getDocumentLanguages( ::sal_Int16 nScriptTypes, ::sal_Int16 nCount ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
-
-    // css::text::XFlatParagraphIteratorProvider:
-    virtual css::uno::Reference< css::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (css::uno::RuntimeException);
-
-    // ::com::sun::star::util::XCloneable
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(  ) throw (::com::sun::star::uno::RuntimeException);
-    
-    
-    //
-	void						Invalidate();
-	void						Reactivate(SwDocShell* pNewDocShell);
-	SwXDocumentPropertyHelper * GetPropertyHelper ();
-	sal_Bool 			  		IsValid() const {return bObjectValid;}
-
-	void						InitNewDoc();
-
-	SwUnoCrsr* 					CreateCursorForSearch(css::uno::Reference< css::text::XTextCursor > & xCrsr);
-	SwUnoCrsr* 					FindAny(const css::uno::Reference< css::util::XSearchDescriptor > & xDesc,
-											css::uno::Reference< css::text::XTextCursor > & xCrsr, sal_Bool bAll,
-											sal_Int32& nResult,
-											css::uno::Reference< css::uno::XInterface >  xLastResult);
-
-	SwXDrawPage*				GetDrawPage();
-	SwDocShell* 				GetDocShell() {return pDocShell;}
-
-    
-    void * SAL_CALL operator new( size_t ) throw();
-	void SAL_CALL operator delete( void * ) throw();
-
-};
-/* -----------------25.10.99 11:02-------------------
-
- --------------------------------------------------*/
-class SwXLinkTargetSupplier : public cppu::WeakImplHelper2
-<
-	css::container::XNameAccess,
-	css::lang::XServiceInfo
->
-{
-	SwXTextDocument* pxDoc;
-	String sTables;
-	String sFrames;
-	String sGraphics;
-	String sOLEs;
-	String sSections;
-	String sOutlines;
-	String sBookmarks;
-
-public:
-	SwXLinkTargetSupplier(SwXTextDocument& rxDoc);
-	~SwXLinkTargetSupplier();
-
-	//XNameAccess
-	virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name)  throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException );
-
-	//XElementAccess
-    virtual css::uno::Type SAL_CALL getElementType(  ) throw(css::uno::RuntimeException);
-    virtual sal_Bool SAL_CALL hasElements(  ) throw(css::uno::RuntimeException);
-
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
-
-	//
-	void	Invalidate() {pxDoc = 0;}
-};
-/* -----------------26.10.99 09:05-------------------
-
- --------------------------------------------------*/
-class SwXLinkNameAccessWrapper : public cppu::WeakImplHelper4
-<
-	css::beans::XPropertySet,
-	css::container::XNameAccess,
-	css::lang::XServiceInfo,
-	css::document::XLinkTargetSupplier
->
-{
-    css::uno::Reference< css::container::XNameAccess >    xRealAccess;
-    const SfxItemPropertySet*                                                       pPropSet;
-    const String                                                                    sLinkSuffix;
-    const String                                                                    sLinkDisplayName;
-	css::uno::Reference< css::text::XTextDocument >  		xDoc;
-    SwXTextDocument*                                                                pxDoc;
-
-
-public:
-	SwXLinkNameAccessWrapper(css::uno::Reference< css::container::XNameAccess >  xAccess,
-			const String& rLinkDisplayName, String sSuffix);
-	SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc,
-			const String& rLinkDisplayName, String sSuffix);
-	~SwXLinkNameAccessWrapper();
-
-	//XNameAccess
-	virtual css::uno::Any SAL_CALL getByName(const rtl::OUString& Name)  throw( css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( css::uno::RuntimeException );
-
-	//XElementAccess
-    virtual css::uno::Type SAL_CALL getElementType(  ) throw(css::uno::RuntimeException);
-    virtual sal_Bool SAL_CALL hasElements(  ) throw(css::uno::RuntimeException);
-
-	//XPropertySet
-    virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-
-	//XLinkTargetSupplier
-	virtual css::uno::Reference< css::container::XNameAccess >  SAL_CALL getLinks(void) throw( css::uno::RuntimeException );
-
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
-
-};
-/* -----------------26.10.99 15:46-------------------
-
- --------------------------------------------------*/
-class SwXOutlineTarget : public cppu::WeakImplHelper2
-<
-	css::beans::XPropertySet,
-	css::lang::XServiceInfo
->
-{
-    const SfxItemPropertySet*   pPropSet;
-    String                      sOutlineText;
-
-public:
-	SwXOutlineTarget(const String& rOutlineText);
-	~SwXOutlineTarget();
-
-	//XPropertySet
-    virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(css::uno::RuntimeException);
-    virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-    virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException);
-
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( css::uno::RuntimeException );
-	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( css::uno::RuntimeException );
-	virtual css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( css::uno::RuntimeException );
-};
-#endif
-
-class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable
-{
-	css::uno::Reference < css::uno::XInterface > xDashTable;
-	css::uno::Reference < css::uno::XInterface > xGradientTable;
-	css::uno::Reference < css::uno::XInterface > xHatchTable;
-	css::uno::Reference < css::uno::XInterface > xBitmapTable;
-	css::uno::Reference < css::uno::XInterface > xTransGradientTable;
-	css::uno::Reference < css::uno::XInterface > xMarkerTable;
-	css::uno::Reference < css::uno::XInterface > xDrawDefaults;
-
-    SwDoc*  m_pDoc;
-public:
-	SwXDocumentPropertyHelper(SwDoc& rDoc);
-	~SwXDocumentPropertyHelper();
-	css::uno::Reference<css::uno::XInterface> GetDrawTable(short nWhich);
-	void Invalidate();
-
-    virtual void onChange();
-};
-

File sw/source/core/doc/docnew.cxx

 const sal_Char __FAR_DATA sTxtCollStr[] = "Textformatvorlage";
 const sal_Char __FAR_DATA sGrfCollStr[] = "Graphikformatvorlage";
 
+FNGetDoc SwDoc::pFnGetDoc = 0;
+
 SV_IMPL_PTRARR( SwNumRuleTbl, SwNumRulePtr)
 SV_IMPL_PTRARR( SwTxtFmtColls, SwTxtFmtCollPtr)
 SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr)
  * global functions...
  */
 
- uno::Reference< linguistic2::XProofreadingIterator > SwDoc::GetGCIterator() const
+uno::Reference< linguistic2::XProofreadingIterator > SwDoc::GetGCIterator() const
 {
     if (!m_xGCIterator.is() && SvtLinguConfig().HasGrammarChecker())
     {

File sw/source/core/docnode/section.cxx

 			if( !sFileName.Len() )
 			{
                 xDocSh = pDoc->GetDocPersist();
+				pSrcDoc = pDoc;
 				nRet = 1;
 			}
 			else if ( pDoc->GetDocShell() )

File sw/source/filter/basflt/shellio.cxx

 #include <pagedesc.hxx>
 #include <poolfmt.hxx>
 #include <fltini.hxx>
-#include <docsh.hxx>
 #include <redline.hxx>
 #include <swerror.h>
-
 #include <paratr.hxx>
-
-// --> OD 2007-03-30 #i73788#
 #include <pausethreadstarting.hxx>
-// <--
-
 
 using namespace ::com::sun::star;
 
 				SvtModuleOptions aModuleOptions;
 				if( aModuleOptions.IsWriter() )
 				{
-					SwDocShell *pDocSh =
-						new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
-                    SfxObjectShellLock xDocSh = pDocSh;
-					if( pDocSh->DoInitNew( 0 ) )
-					{
-						pTemplate = pDocSh->GetDoc();
+                    pTemplate = (*SwDoc::GetFNGetDoc())( uno::Reference < frame::XModel >() );                   
+                    if ( pTemplate )
+                    {
+                        SfxObjectShellLock aLock( pTemplate->GetPersist() );
 						pTemplate->SetOle2Link( Link() );
-                        // always FALSE
                         pTemplate->GetIDocumentUndoRedo().DoUndo( false );
                         pTemplate->set(IDocumentSettingAccess::BROWSE_MODE, bTmplBrowseMode );
                         pTemplate->RemoveAllFmtLanguageDependencies();

File sw/source/filter/ww8/docxexportfilter.cxx

 #include "rtfexportfilter.hxx"
 #include "rtfimportfilter.hxx"
 #include "docxexport.hxx"
-
-#include <docsh.hxx>
 #include <pam.hxx>
-#include <unotxdoc.hxx>
-
+#include <doc.hxx>
 #include <cppuhelper/factory.hxx>
 
 using namespace ::comphelper;
 {
     OSL_TRACE(, "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
 
-    // get SwDoc*
-    uno::Reference< uno::XInterface > xIfc( getModel(), uno::UNO_QUERY );
-    SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
-    if ( !pTxtDoc )
-        return false;
-
-    SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc();
+    uno::Reference< frame::XModel > xIfc( m_xDstDoc, uno::UNO_QUERY );
+    SwDoc* pDoc = (*SwDoc::GetFNGetDoc())( xIfc );
     if ( !pDoc )
         return false;
 

File sw/source/filter/ww8/rtfexportfilter.cxx

 #include <rtfexportfilter.hxx>
 #include <rtfexport.hxx>
 #include <rtfimportfilter.hxx>
-
-#include <docsh.hxx>
 #include <doc.hxx>
 #include <pam.hxx>
-#include <unotxdoc.hxx>
-
 #include <cppuhelper/factory.hxx>
 #include <comphelper/mediadescriptor.hxx>
 #include <unotools/ucbstreamhelper.hxx>
     m_pStream = utl::UcbStreamHelper::CreateStream( xStream, sal_True );
     m_aWriter.SetStream(m_pStream);
 
-    // get SwDoc*
-    uno::Reference< uno::XInterface > xIfc( m_xSrcDoc, uno::UNO_QUERY );
-    SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
-    if ( !pTxtDoc ) {
+    uno::Reference< frame::XModel > xIfc( m_xSrcDoc, uno::UNO_QUERY );
+    SwDoc* pDoc = (*SwDoc::GetFNGetDoc())( xIfc );
+    if ( !pDoc )
         return sal_False;
-    }
-
-    SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc();
-    if ( !pDoc ) {
-        return sal_False;
-    }
 
     // get SwPaM*
     // we get SwPaM for the entire document; copy&paste is handled internally, not via UNO

File sw/source/filter/ww8/rtfimportfilter.cxx

 #include "rtfimportfilter.hxx"
 #include "../rtf/swparrtf.hxx"
 
-#include <docsh.hxx>
 #include <doc.hxx>
 #include <pam.hxx>
-#include <unotxdoc.hxx>
 #include <swerror.h>
-
 #include <cppuhelper/factory.hxx>
 #include <comphelper/mediadescriptor.hxx>
 #include <unotools/ucbstreamhelper.hxx>
-
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
 
         return sal_False;
 
     // get SwDoc*
-    uno::Reference< uno::XInterface > xIfc( m_xDstDoc, uno::UNO_QUERY );
-    SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
-    if (!pTxtDoc)
-        return sal_False;
-    SwDoc *pDoc = pTxtDoc->GetDocShell()->GetDoc();
+    uno::Reference< frame::XModel > xIfc( m_xDstDoc, uno::UNO_QUERY );
+    SwDoc* pDoc = (*SwDoc::GetFNGetDoc())( xIfc );
     if (!pDoc)
         return sal_False;
 

File sw/source/filter/xml/xmlimp.cxx

 #include <editsh.hxx>
 #include "xmlimp.hxx"
 #include <xmloff/DocumentSettingsContext.hxx>
-#include <docsh.hxx>
 #include <editeng/unolingu.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/xmlgrhlp.hxx>
 #include <stringhash.hxx>
 #include <vcl/svapp.hxx>
 #include <vos/mutex.hxx>
-#include <unotxdoc.hxx>
 #include <xmloff/xmlmetai.hxx>
 #include <xmloff/xformsimport.hxx>
 #include <com/sun/star/xforms/XFormsSupplier.hpp>
 
 SwDoc* SwImport::GetDocFromXMLImport( SvXMLImport& rImport )
 {
-	uno::Reference<lang::XUnoTunnel> xModelTunnel( rImport.GetModel(), uno::UNO_QUERY );
-    SwXTextDocument *pTxtDoc = reinterpret_cast< SwXTextDocument *>(
-            sal::static_int_cast< sal_IntPtr >(  xModelTunnel->getSomething(SwXTextDocument::getUnoTunnelId() )));
-	ASSERT( pTxtDoc, "Where is my model?" )
-	ASSERT( pTxtDoc->GetDocShell(), "Where is my shell?" )
-	SwDoc* pDoc = pTxtDoc->GetDocShell()->GetDoc();
-	ASSERT( pDoc, "Where is my document?" )
-	return pDoc;
+    return (*SwDoc::GetFNGetDoc())( rImport.GetModel() );
 }
 
 
 void SwXMLImport::initXForms()
 {
-    // obtain SwDoc
-	Reference<XUnoTunnel> xDocTunnel( GetModel(), UNO_QUERY );
-    if( ! xDocTunnel.is() )
-        return;
-    SwXTextDocument* pXTextDocument = reinterpret_cast<SwXTextDocument*>(
-        xDocTunnel->getSomething( SwXTextDocument::getUnoTunnelId() ) );
-    if( pXTextDocument == NULL )
-        return;
-
-	SwDoc *pDoc = pXTextDocument->GetDocShell()->GetDoc();
+    SwDoc* pDoc = (*SwDoc::GetFNGetDoc())( GetModel() );
 
     // init XForms (if not already done)
     // (no default model, since we'll load the models)

File sw/source/ui/app/swmodule.cxx

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-
 #include <hintids.hxx>
-#ifndef _SWERROR_H
 #include <swerror.h>
-#endif
 #include <vcl/wrkwin.hxx>
 #include <vcl/graph.hxx>
 #include <svx/galbrws.hxx>
 #include <com/sun/star/scanner/XScannerManager.hpp>
 #include <com/sun/star/container/XSet.hpp>
 #include <comphelper/processfactory.hxx>
-#ifndef _DOCSH_HXX
 #include <docsh.hxx>
-#endif
 #include <swmodule.hxx>
 #include <swevent.hxx>
 #include <swacorr.hxx>
-#ifndef _CMDID_H
 #include <cmdid.h>
-#endif
 #include <dobjfac.hxx>
 #include <init.hxx>
 #include <pview.hxx>
 #include <wview.hxx>
 #include <wdocsh.hxx>
 #include <globdoc.hxx>
-#ifndef _SRCVIEW_HXX //autogen
 #include <srcview.hxx>
-#endif
 #include <glshell.hxx>
 #include <tabsh.hxx>
 #include <listsh.hxx>
 #include <beziersh.hxx>
 #include <wtextsh.hxx>
 #include <wfrmsh.hxx>
-#ifndef _DRFORMSH_HXX
 #include <drformsh.hxx>
-#endif
-#ifndef _WGRFSH_HXX
 #include <wgrfsh.hxx>
-#endif
-#ifndef _WOLESH_HXX
 #include <wolesh.hxx>
-#endif
-#ifndef _WLISTSH_HXX
 #include <wlistsh.hxx>
-#endif
-#ifndef _WTABSH_HXX
 #include <wtabsh.hxx>
-#endif
 #include <navipi.hxx>
 #include <chartins.hxx>
 #include <inputwin.hxx>
 #include <workctrl.hxx>
 #include <tbxanchr.hxx>
 #include <fldwrap.hxx>
-#ifndef _REDLNDLG_HXX
 #include <redlndlg.hxx>
-#endif
-#ifndef _SYNCBTN_HXX
 #include <syncbtn.hxx>
-#endif
 #include <mailmergechildwindow.hxx>
 #include <modcfg.hxx>
 #include <fontcfg.hxx>
 #include <swatrset.hxx>
 #include <idxmrk.hxx>
 #include <dlelstnr.hxx>
-#ifndef _BARCFG_HXX
 #include <barcfg.hxx>
-#endif
 #include <svx/rubydialog.hxx>
-// OD 14.02.2003 #107424#
 #include <svtools/colorcfg.hxx>
-
 #include <editeng/acorrcfg.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <SwSmartTagMgr.hxx>
-#ifndef _AVMEDIA_MEDIAPPLAYER_HXX
 #include <avmedia/mediaplayer.hxx>
-#endif
 #include <avmedia/mediatoolbox.hxx>
-
 #include <annotsh.hxx>
-
 #include <app.hrc>
 #include <svx/xmlsecctrl.hxx>
+#include <sfx2/app.hxx>
+#include <svx/svxerr.hxx>
+#include <unomid.h>
+#include <doc.hxx>
+#include <unotxdoc.hxx>
 
 sal_Bool 	bNoInterrupt 	= sal_False;
 
-#include <sfx2/app.hxx>
-
-#include <svx/svxerr.hxx>
-
-#include <unomid.h>
-
 using namespace com::sun::star;
 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
+SwDoc* GetSwDoc( const uno::Reference < frame::XModel >& xModel )
+{
+    if ( xModel.is() ) 
+    {
+        uno::Reference< uno::XInterface > xIfc( xModel, uno::UNO_QUERY );
+        SwXTextDocument *pTxtDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
+        return pTxtDoc->GetDoc();
+    }
+    else 
+        return SwXTextDocument::CreateDocument( SFX_CREATE_MODE_INTERNAL );
+}
+
 //************************************************************************
 
 SwModule::SwModule( SfxObjectFactory* pWebFact,
     // member <pColorConfig> is created and the color configuration is applied
     // at the view options.
     GetColorConfig();
+
+    SwDoc::SetFNGetDoc( &GetSwDoc );
 }
 
 //************************************************************************

File sw/source/ui/inc/docsh.hxx

+/*************************************************************************
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWDOCSH_HXX
+#define _SWDOCSH_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include <vcl/timer.hxx>
+#include <sfx2/docfac.hxx>
+#include <sfx2/objsh.hxx>
+#include "swdllapi.h"
+#include <swdll.hxx>
+#include <shellid.hxx>
+
+#include <svl/lstner.hxx>
+#include <svtools/embedhlp.hxx>
+
+class SwDoc;
+class SfxDocumentInfoDialog;
+class SfxStyleSheetBasePool;